Skip to content

feat(agents): Agent Templates edit/clone flow + dialog polish + security hoist - #2269

Closed
qh2244 wants to merge 2 commits into
kirodotdev:mainfrom
qh2244:feat/agent-template-edit-polish
Closed

feat(agents): Agent Templates edit/clone flow + dialog polish + security hoist#2269
qh2244 wants to merge 2 commits into
kirodotdev:mainfrom
qh2244:feat/agent-template-edit-polish

Conversation

@qh2244

@qh2244 qh2244 commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Summary

Addresses all 5 items from #2255 (fast-follow to #2023):

  1. Edit/clone flow - Edit and Clone buttons on user-owned templates open the dialog in edit mode (name locked, fields pre-filled, PUT endpoint) or clone mode (name cleared, POST).
  2. Commit pending drafts on submit - A valid tool typed but never Enter'd is auto-committed into the payload on Create/Save.
  3. Shield (auto-approve) discoverability - "Click the shield" promoted from tooltip into a visible helper line.
  4. Suggestion cap overflow cue - "+N more (type to search)" when suggestions exceed 12.
  5. Security-predicate hoist - 6 symbols moved from handler into the shared security module as public helpers. Zero behavior change.

Backend

  • PUT /api/agents/installed/{name} - full-replace a user-owned template
  • Security predicates now live in the shared security module

Frontend

  • AgentTemplateCreator.tsx gains editTarget + cloneMode props
  • AgentsPage.tsx adds Edit/Clone buttons (user-owned only)
  • api/client.ts adds agentUpdate (PUT)
  • 8 new i18n keys

Testing

  • test_agent_template_create.py - 106 passed
  • test_security.py - 320 passed
  • test_redaction_mirror_parity.py - 6 passed
  • AgentTemplateCreator.test.tsx - 19 passed
  • tsc --noEmit clean, isort/flake8 clean

Screenshots

Inspector with Edit/Clone buttons

inspector

Edit dialog (name disabled, pre-filled)

edit

Clone dialog (name empty, rest pre-filled)

clone

Create dialog with shield hint + suggestions

create

Closes #2255

RohanK6 and others added 2 commits August 8, 2026 14:37
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.
@qh2244
qh2244 requested a review from a team August 8, 2026 20:14
@qh2244
qh2244 requested a review from a team as a code owner August 8, 2026 20:15
@github-actions github-actions Bot added fork Pull request from a fork (external contributor) readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running merge conflict Branch has merge conflicts with its base — author must resolve before merge and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Aug 8, 2026
@qh2244

qh2244 commented Aug 9, 2026

Copy link
Copy Markdown
Contributor Author

Closing: the branch was based on the unmerged #2023 and cannot cleanly rebase onto current main (AgentsPage.tsx was heavily refactored upstream). Will re-implement from scratch on fresh main.

@qh2244 qh2244 closed this Aug 9, 2026
@github-actions github-actions Bot removed the readiness: action required A blocking check or review needs attention label Aug 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fork Pull request from a fork (external contributor) merge conflict Branch has merge conflicts with its base — author must resolve before merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Agent Templates: edit flow + deferred dialog polish and security-predicate hoist (fast-follow to #2023)

2 participants