feat: add dashboard authoring for custom Agent Templates - #2023
Conversation
9247585 to
9593a19
Compare
GPT 5.6 Review (fork) —
|
UX Review (Fable 5, fork) — ⏭️ skippedRevision |
Design Review (Fable 5, fork) —
|
Opus 4.8 Review (fork) —
|
9593a19 to
576dfc5
Compare
576dfc5 to
1515920
Compare
1515920 to
b0d695f
Compare
0733cfa to
925e1ac
Compare
925e1ac to
7c289ee
Compare
|
Responding to the advisory (non-blocking) items from the UX and Design reviews on UX — WatchPending tool draft lost on submit. Valid catch, and the smallest of the two fixes proposed (auto-add a valid non-empty Shield discoverability. Agreed the hover-only UX — Suggestions
Design — WatchBespoke secret screening in the handler. Two parts to this:
Create-without-edit half loop. Correct, and named in the PR description as the scope cut: create-only ships first, edit/clone is the immediate follow-up. Until then the dead-end is mitigated by the inspector view making the written JSON visible right after create. Design — SuggestionHoist predicates into |
iamwhatever
left a comment
There was a problem hiding this comment.
Very cool, could you please also handle concerns raised in design and UX reviews? If not reasonable, please leave comments to push back.
|
Thanks for the review! I went through every UX and Design item — I'd like to push back on folding them into this PR, with reasoning per item. Happy to reverse on any of these if you'd prefer them in this diff. The common thread: this PR is deliberately scoped to the create-only core. The remaining items are either dialog polish that belongs in the edit-flow fast-follow, or a refactor that's easier to review as its own small diff than folded into an already-large feature commit. All of the deferred work is now tracked in #2255. UX — pending tool draft lost on submit. Real catch, and auto-adding a valid UX — shield auto-approve discoverability. Agreed. Promoting the InfoTip sentence to the visible helper line is a one-liner that rides with the follow-up above (it touches the same helper-line block the toolDraft fix restructures). UX — suggestion cap with no overflow cue. Polish, not a gap: every tool remains reachable by typing (free-text covers the full set), so nothing is lost — only undiscoverable. "+N more" cue queued for the follow-up. UX — tooltip "skill://" mechanism leak. Intentional: the docs section this PR adds teaches hand-authors that dialog skill mappings ARE Design — secret predicates living in the handler. Agreed on the destination ( Design — create-without-edit half loop. This is the named scope cut in the PR description: create-only ships first, edit/clone is the immediate follow-up (where the three UX items above land). Until then the inspector view shows the written JSON right after create, so the dead-end is visible rather than silent. If you're good with this split, the deferred items are tracked in #2255 — the edit-flow fast-follow carries the toolDraft auto-add, shield helper-line promotion, "+N more" cue, and the security.py predicate hoist. |
|
Re: the review's blocking finding on I'd like to push back on this one — it's a genuine false positive for this layer, for three reasons: 1. It's a consumption-time TOCTOU, which no authoring-time check can close. The validation runs when the template is created; the file is read when the agent starts, arbitrarily later. Between those two moments an attacker who already has write access to the user's home directory can swap any referenced path for a symlink — that is true of every 2. The endpoint is not the trust boundary here. The same template can be hand-written to 3. The prescribed fix removes the feature. "Reject What the PR does do at authoring time is the appropriate, in-scope hardening: reject sensitive literal targets ( That said — happy to hear if the reviewers feel the conservative posture is warranted anyway. If so I can either (a) gate |
|
Status: this PR is ready for review. I am currently working through the newest incoming merge conflicts in the shared i18n translation registry ( |
|
The Frontend Tests failure here is a pre-existing upstream issue on The failing suite is Evidence it's on
These are the exact counts/keys this PR's CI reports. A re-run won't clear it; it needs a This PR's own suites are green — backend |
|
Updated screenshots. Rebased onto latest |
|
Overlap notice — three PRs implement Agent Template authoring from the dashboard:
Recommendation: consolidate on #2383 as the base — widest scope (create/edit/clone + all #2255 items), the only branch without merge conflicts, and it matches what issues #1829 and #2255 asked for. However, #2383 is not yet merge-ready: CI is failing (frontend i18n gates, backend test shard, coverage gate), it ships no tests, and only the
@kyleseaman @RohanK6 — inviting you both to review #2383 so the best parts of all three land. If maintainers prefer the original sequencing (#2023 first, #2383 rebased back into the fast-follow it started as), that also works; the main thing is that the tests and i18n coverage from the other two PRs are not lost. |
|
Happy to close mine. I like this change. |
The Agent Templates surface could inspect installed templates and edit
their model and skill mappings, but could not create one — a user who
needed a different capability set had to hand-edit ~/.kiro/agents/.
Backend: POST /api/agents/installed validates the complete template
(name charset doubling as the file stem, reserved/duplicate identity by
spec name across all specs, shape-validated tools/allowedTools/
mcpServers/resources/deniedCommands with an allowlist per MCP server
entry), maps catalog skill keys to skill:// resources through the
enumerated catalog (never by joining caller strings onto a path), and
writes ~/.kiro/agents/{name}.json atomically under the config lock. The
written stem equals the spec name, so discovery classifies it as
user-owned; framework and package ownership rules are untouched. Every
rejection names the offending field alongside the error-code contract.
Frontend: a Create template action on Agent Capabilities → Agent
Templates (plus an empty-state entry point) opens a structured
authoring dialog — identity, model, system prompt, skill catalog
toggles, tool chips with per-tool auto-approve, inline MCP server rows,
and advanced resources/guardrails. Nothing saves until Create; a server
rejection highlights the named field without discarding the draft. The
created template is selected in the inspector and appears in the Crew
template selector immediately.
|
Resolving in favor of #2383 |





Problem
The Agent Templates surface is half of a capability model it cannot complete. A crew binds to an agent template and inherits everything from it — tools, MCP servers, skills, guardrails — and the dashboard can inspect installed templates and edit their model and skill mappings. But it cannot create one. A user who needs two crews with different capability sets has to leave Kiro Crew and hand-author a JSON file under
~/.kiro/agents/, guessing at the schema the inspector already renders.Closes #1829.
Fix
A Create template action on Agent Capabilities → Agent Templates (and an empty-state entry point when no templates are installed) opens a structured authoring dialog over the same agent model the inspector reads. One
POST /api/agents/installedvalidates the complete draft and writes the new user-owned spec atomically.End-to-end flow
Design decisions
{name}.jsonwhosenamematches the stem as user-owned (builtin). Framework files (kirocrew.json, …) and package files (pkg--agent.json) keep their existing ownership protections untouched; reserved names are refused outright.apply_skill_mappingthe Skills editor uses, so the onlyskill://paths ever written are ones the enumeration discovered. Free-formresourcesacceptfile://URIs only — a hand-typedskill://cannot bypass the boundary.code+field; the dialog surfaces the message on the named field without discarding anything typed. Duplicate names are also refused client-side before spending a request.Screenshots
All data below is synthetic fixture data from the capture harness (
website/scripts/capture-agent-template-create.mjs— real built SPA, network stubbed).fs_readauto-approved (green shield), inline MCP server feeding an@release-notesmount suggestion, guardrailsTesting
test/test_agent_template_create.py— 28 tests in three layers: VALIDATE (_build_template_specfield rules, unsafe/reserved names, field-naming errors), WRITE (aiohttp-level: duplicate filename AND duplicate spec-name conflicts, unknown skills write nothing, catalog mapping lands inresources, deniedCommands →toolsSettings), PROTECT (reserved names, non-object bodies).website/src/test/AgentTemplateCreator.test.tsx— 10 tests: client-side name validation and duplicate refusal, single-POST payload shape (empty sections stay off the wire), shield toggle →allowedTools, tool removal cleanup, MCP rows with space-split args, server field-error mapping that keeps the draft, 409 conflict surfacing, probed@serversuggestions.unitLiterals15s timeout under parallel load passes standalone),tsc -b,npm run build, eslint 0 errors under the warning ratchet, i18n master check + diff-scoped strings gate vsorigin/main, locale style tests (bn/fr/hi/zh-CN informal register), docs-lint, backend isort/black/flake8 + pytest including the error-code contract.i18n
39 new keys across
pages.agentsPageand a newcomponents.agentTemplateCreatornamespace, translated in all 10 target catalogs (+ regenerateden-XA), with a context-sidecar entry for the ≤3-char "Add".