Repository navigation
feat(kiro): add upgrade-guardian and generic rev-eng agents #17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
e3e92ad
a692613
c71886b
5542cec
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,62 @@ | ||
| { | ||
| "name": "rev-eng", | ||
| "description": "Generic reverse-engineering agent — discovers a target web app's internal API via Playwright browser automation and documents it for a TypeScript client. Read-only: never commits, pushes, publishes, or mutates project source outside the docs API folder.", | ||
| "prompt": "file://../prompts/rev-eng.md", | ||
| "resources": [ | ||
| "file://README.md", | ||
| "file://AGENTS.md", | ||
| "file://package.json", | ||
| "file://.env.example", | ||
| "file://.kiro/steering/**/*.md", | ||
| "file://docs/api/**/*.md" | ||
| ], | ||
| "tools": [ | ||
| "read", | ||
| "write", | ||
| "shell", | ||
| "grep", | ||
| "glob", | ||
| "web_search", | ||
| "web_fetch", | ||
| "introspect", | ||
| "thinking", | ||
| "@playwright" | ||
| ], | ||
| "allowedTools": [ | ||
| "read", | ||
| "grep", | ||
| "glob", | ||
| "web_search", | ||
| "web_fetch", | ||
| "introspect", | ||
| "thinking", | ||
| "@playwright" | ||
| ], | ||
| "toolsSettings": { | ||
| "write": { | ||
| "allowedPaths": ["docs/api/**"] | ||
| }, | ||
|
Comment on lines
+13
to
+38
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛑 Security Vulnerability: The Footnotes
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Rebutting — same intentional "ask-before-write" pattern as |
||
| "shell": { | ||
| "autoAllowReadonly": true, | ||
| "deniedCommands": [ | ||
| ".*git commit.*", | ||
| ".*git push.*", | ||
| ".*git tag .*", | ||
| ".*npm publish.*", | ||
| ".*rm -rf.*" | ||
| ] | ||
| } | ||
| }, | ||
| "mcpServers": { | ||
| "playwright": { | ||
| "command": "npx", | ||
| "args": [ | ||
| "@playwright/mcp@latest", | ||
| "--browser=chromium", | ||
| "--headless", | ||
| "--caps=core,network,storage", | ||
| "--console-level=info" | ||
| ] | ||
| } | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,52 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "name": "upgrade-guardian", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "description": "Assesses the safety of a dependency/framework upgrade in an isolated worktree. Read-only: analyzes real breaking changes, project impact and verification, then returns a reasoned LOW/MEDIUM/HIGH risk verdict. Never commits, pushes, publishes, or opens PRs.", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "prompt": "file://../prompts/upgrade-guardian.md", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "resources": [ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "file://README.md", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "file://AGENTS.md", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "file://package.json", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "file://.kiro/steering/**/*.md" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "tools": [ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "read", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "write", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "shell", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "grep", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "glob", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "web_search", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "web_fetch", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "introspect", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "thinking", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "code" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+11
to
+22
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛑 Security Vulnerability: The "write" tool is declared in the "tools" array but not in "allowedTools", creating the same security bypass as in rev-eng.json. An agent could use shell commands to write files outside the allowed paths, violating the read-only guarantees. Remove "write" from the "tools" array.1
Suggested change
Footnotes
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "allowedTools": [ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "read", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "shell", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "grep", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "glob", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "web_search", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "web_fetch", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "introspect", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "thinking", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "code" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "toolsSettings": { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "write": { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "allowedPaths": [".kiro/upgrade-reports/**", "docs/upgrades/**"] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+11
to
+37
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛑 Security Vulnerability: The
Suggested change
Footnotes
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Rebutting — this is the intentional BePower "ask-before-write" pattern, not an ambiguity. The write capability is required and deliberate: upgrade-guardian writes its report only to |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "shell": { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "autoAllowReadonly": true, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "deniedCommands": [ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ".*git commit.*", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ".*git push.*", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ".*git tag .*", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ".*npm publish.*", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ".*gh pr create.*", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ".*gh pr merge.*", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ".*npm (install|i|add).*(-S|-D|-O|-E|--save).*", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ".*rm -rf.*" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| # Hooks — `runtime` tagging + `init-kiro` filtering | ||
|
|
||
| Hooks are tagged by the runtime they make sense in, instead of being split into | ||
| `ide/` vs `safety/` folders. Files stay flat; a front-matter field decides who | ||
| gets them. | ||
|
|
||
| ## The `runtime` field | ||
|
|
||
| | Value | Meaning | Example | | ||
| |-------|---------|---------| | ||
| | `any` | Applies in every runtime — IDE and autonomous KiroCrew alike. | `safety-gate.md` | | ||
| | `ide` | Only meaningful with a human in an editor (fires on IDE file events; no-op headless). | `barrel-export.md` | | ||
|
|
||
| Deprecated hooks additionally carry: | ||
|
|
||
| ```yaml | ||
| deprecated: true | ||
| superseded_by: "<what replaces it>" | ||
| ``` | ||
|
|
||
| They are **kept, not deleted**, pending a decision on whether to archive them: | ||
|
|
||
| | Hook | runtime | Status | | ||
| |------|---------|--------| | ||
| | `safety-gate.md` | `any` | KEEP | | ||
| | `barrel-export.md` | `ide` | KEEP (IDE-only) | | ||
| | `context-injection.md` | `ide` | DEPRECATED → superseded by Skills-Discovered-by-Search | | ||
| | `post-task-summary.md` | `any` | DEPRECATED → superseded by native end-of-task summary | | ||
|
|
||
| ## How `init-kiro` should filter (proposed) | ||
|
|
||
| `init-kiro` copies `kiro/hooks/*` into `~/.kiro/hooks/`. Proposed behavior: | ||
|
|
||
| - **Default (IDE developer):** install all non-deprecated hooks (`runtime: any` | ||
| and `runtime: ide`). Deprecated hooks are skipped by default. | ||
| - **Headless / autonomous mode** (e.g. a future `--headless` / `--autonomous` | ||
| flag): install only `runtime: any` hooks; skip `runtime: ide` (they can never | ||
| fire without editor events) and skip `deprecated: true`. | ||
| - The installer reads the `runtime` and `deprecated` front-matter fields to decide. | ||
|
|
||
| ## Agent distribution decision | ||
|
|
||
| - **All agents ship to everyone.** No conditional selection; consistent with how | ||
| `init-kiro` copies the whole `kiro/` payload. `upgrade-guardian` and the generic | ||
| `rev-eng` are distributed globally like `bepower-setup` and `functional-analyst`. | ||
| - **`rev-eng` stays global**, not scaffolded conditionally on "is this an | ||
| api-client project". It self-contextualizes at runtime; if the project has no | ||
| target to reverse-engineer, the agent simply has nothing to do — no conditional | ||
| install logic is needed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛑 Security Vulnerability: The "write" tool is declared in the "tools" array but not in "allowedTools", which creates a security bypass. An agent could potentially use the "shell" tool with commands like
echo "content" > file.txtto write to files outside the allowed paths, circumventing the write restrictions.Remove "write" from the "tools" array to enforce the read-only guarantee.1
Footnotes
CWE-732: Incorrect Permission Assignment for Critical Resource - https://cwe.mitre.org/data/definitions/732.html ↩