Repository navigation
feat(agents): platform-admin enable/disable toggle per agent CLI - #629
Conversation
Platform admins can switch individual agent CLIs (kiro, claude, opencode, codex) off in Admin -> Agents -> Agent CLIs. Disabled CLIs are greyed out on the compose page and in space settings, and the backend rejects new selections with agent_cli_disabled at intent start, DRAFT compose, DRAFT discussion assists, and when changing a space's recommended CLI. Intents that already pinned a CLI are unaffected. The disabled set lives in a new disabled-clis SSM parameter (seeded from the disabled_clis Terraform variable, empty by default, then Admin UI managed). A missing parameter means every CLI is enabled, so existing deployments keep their behavior. Clarifies that codex_model only pins a default model and does not enable Codex. Refs aws-samples#368
|
Thanks for your contribution @gpmattoo , could you please add a screenshot of the result, so we can see what it looks like? |
|
Thanks @jeromevdl! Here's how it looks, with Codex disabled as the example. Admin → Agents → Agent CLIs (new card): one switch per CLI. The last enabled CLI can't be switched off. Space Settings → Agent → Recommended CLI: a disabled CLI is greyed out and labelled "disabled by admin". The intent compose page CLI picker shows the same label and disables the card. These are the actual components from this branch, rendered locally with mocked API responses rather than captured from a deployed stack. |
jeromevdl
left a comment
There was a problem hiding this comment.
No major issue found.
Optional suggestions
- Creating a space ignores the toggle.
lambda/projects/index.js:1590still writesdata.agentCli || 'kiro'without checking the disabled list. With Kiro disabled, a new space recommends a greyed-out CLI. This is only cosmetic, because selection is still enforced at start. Default to the first enabled CLI. - A failed settings load in
AgentClisCardcan re-enable CLIs. If the load fails, the card shows everything enabled; toggling and saving then overwrites the stored list.DefaultModelsCardbehaves the same way, so this follows the existing pattern. Disabling Save after a load error would close the gap.
Thanks for contributing!
…s load A new space now recommends Kiro, or the first enabled CLI when Kiro is disabled, and rejects an explicitly requested disabled CLI. A failed settings read does not block space creation, because the recommendation is advisory. The Agent CLIs card now blocks saving and editing when the stored settings fail to load, so it cannot overwrite the saved list with an all-enabled default.
|
Thanks for the review @jeromevdl. Both suggestions are in 63608a2. Creating a space now respects the toggle. A new space recommends Kiro, or the first enabled CLI when Kiro is disabled (new A failed settings load no longer lets the card overwrite the saved list. Added tests: |
|
Thanks again for contributing @gpmattoo, merged into main. |


Summary
Implements the approach proposed in #368: a per-CLI enabled/disabled toggle in platform settings, so only enabled CLIs can be selected.
disabled-clisSSM parameter (JSON array), seeded from a newdisabled_clisTerraform variable (default[]) withignore_changes, then Admin UI managed — same pattern asstage-skipping/pr-strategy. A missing parameter means all CLIs are enabled, so existing deployments are unchanged.agent_cli_disabled, 400): inresolveSelectedAgentCredential, the shared path for every new selection — intent start, DRAFT compose, DRAFT discussion assists — and on changing a space's recommended CLI (re-saving the current recommendation stays allowed). An SSM read failure on these paths fails closed./projects/{id}/agent-capabilitiesand/agents/capabilitiesmark disabled CLIsenabled: false, exclude them fromavailable, and returndisabledClis. Compose page and space settings grey them out as "disabled by admin".codex_modeldescription clarified: it only pins a default model, it doesn't enable Codex. Default unchanged.platform-settings.md,projects.md.Deployment: requires a Terraform apply (new SSM parameter + IAM grants) alongside the Lambda/frontend deploy.
Screenshots
Testing
lambda/shared/test/agent-cli-availability.test.js(validation, SSM read semantics, selection gate)lambda/agents/test/settings.test.js(GET default/parse, admin-only PUT, rejects unknown / all-disabled)AgentClisCard.test.tsx, compose-page "disabled by admin" case,PlatformAdmin.test.tsx;npm --prefix frontend run buildintents.test.js(start rejects disabled CLI without mutating DRAFT),projects.test.js(recommended CLI),history-auth.test.js(capabilities marking), and the rest of the container-backed backend suite. Relying on CI.terraform fmt/validatenot run locally (Terraform not installed).AppSidebar.test.tsx/intentSectionPreference.test.tsfail locally on Node 26 (localStorageundefined); identical on cleanmain.Refs #368