Repository navigation
fix(agent-config): make the install gate run, and fail closed, in Codex, Amazon Q, Kiro, Cursor, Droid and Aider - #1136
Merged
Merged
Conversation
…ex, Amazon Q, Kiro, Cursor, Droid and Aider - Codex: kit agent-config prints the trust steps; kit check warns (codex install-gate trust) until the project and the hook are trusted. The hash is Codex's own, checked against Codex's test fixtures. kit never writes trusted_hash. apply_patch stays out of the matcher. - Amazon Q: add execute_cmd (Windows shell tool), also for Kiro legacy agents; a test proves fs_write never reaches gate-bash. - Cursor: failClosed: true plus gate-bash --format cursor (explicit allow verdict). Droid: onFailure: "block", and hooks.json keyed by event name as Droid documents. Existing kit entries are migrated in place. - Kiro: standalone .kiro/hooks/kit-install-gate.json for IDE 1.0 / CLI V3, covering .md agents; array-form agents are no longer falsely "wired". - Aider: kit check warns when git-commit-verify is off; CONVENTIONS.md block says so. - agent-audit reads Droid's event-keyed hooks.json. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Kit-Hook-Tree: 65926aeda99f3411d78a8504b6fb7b55bea0fef1
…ommand A look-alike command ending in gate-bash was treated as kit's entry and copied to new matchers. Installers now match only the exact lines kit writes, leave a look-alike untouched and name it, and always write kitGateInvocation(). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Kit-Hook-Tree: 8bb7fa8158e4a4d30a539282f7271b3e782c5de6
…handlers, split installers - kit-gate-command: own-entry test compares against the exact strings kit writes on this machine; path shape proves nothing. Look-alikes glued to a shell operator (`kit gate-bash; id`) are reported too. - Droid legacy wrapper: only kit's handlers move; foreign handlers stay put. - Installers for Amazon Q, Kiro, Cursor and Droid move to agent-gate-installers.ts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Kit-Hook-Tree: 0a1d75526384fcdbe99803b11fe8b4c63e3285bf
…ecute matcher A kit line under a non-shell matcher never fires on a shell call, so a repo could plant one and make kit report the gate as wired. Lifted handlers now always land under Execute. Also: split the Droid installer, rename the installer tests after their module, unexport KIRO_HOOK_FILE. Test-Growth: one fixture test per agent contract (Codex trust hash, Amazon Q Windows matcher, Kiro hook file, Cursor and Droid fail-closed, Aider commit-verify) plus look-alike tests for each installer; each covers a gate that silently did not block. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Kit-Hook-Tree: a302a759897adb41d76813ec608d35d06dfd4ef1
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Kit-Hook-Tree: 7c1cdc6
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Kit-Hook-Tree: 2027b50
|
Docker image built, scanned, and smoke-tested in CI. The PR image is local to this run and is not published. |
sandstream
added a commit
that referenced
this pull request
Nov 27, 2026
Resolves the conflict with #1136, which moved the Amazon Q, Kiro, Cursor and Droid installers into src/agent-gate-installers.ts and added src/kit-gate-command.ts: - the Gemini, OpenCode, Cline and Antigravity installers join them in agent-gate-installers.ts; src/kit-invocation.ts is dropped for kit-gate-command.ts. - Gemini and Antigravity treat an entry as kit's only on an exact isKitGateCommand match, so a look-alike is left alone; `--format gemini` is one of the forms kit writes. - the Gemini trust step and the OpenCode version notes use #1136's `next` steps, which `kit agent-config` prints. - this branch's tests move to src/agent-gate-contracts.test.ts. - pull-agent-files.test.ts now reads both installer files, which showed that `kit pull` did not name `.amazonq/cli-agents/` files; it does now. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Kit-Hook-Tree: 20cae07
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Phase 0.5 of the agent-parity work: kit's install gate (
kit gate-bash) was wired into several agents in a way that did not block, or did not block reliably. Each fix below is based on the agent's own source or docs (references in the changelog fragment and in the fixture comments).What was broken, per agent
trusted_hash, openai/codexhooks/src/engine/discovery.rs:953-960). kit said nothing, so the gate looked wired while it did not run.kit agent-configprints the steps with the exact command to trust.kit checkwarns (codex install-gate trust) until both hold. kit computes the hash as Codex does (checked against Codex's test fixtures) and never writes the trust itself.execute_cmd; theexecute_bashmatcher never fired.execute_cmdentry. A test provesfs_write(whose input also has acommandfield) can never reachgate-bash.failClosed: true, plus--format cursorso the gate always prints an explicit verdict.hookswrapper that Droid'shooks.jsondoes not use, so the gate never loaded. Also failed open.onFailure: "block", existing entries migrated..kiro/hooks/*.json;.mdagents were skipped..kiro/hooks/kit-install-gate.json; legacy wiring kept for CLI 2.x.--no-verifyunlessgit-commit-verify: true, so kit's git hooks never run.kit checkrowaider git hooks, and theCONVENTIONS.mdblock says it.Security hardening (from automated review during this work)
/tmp/kit gate-bash,./node_modules/x/cli.js gate-bash, a UNC path). A look-alike is left in place and named in the output, never copied to a new matcher, migrated, or offered for trust.Executematcher. A kit line planted under another matcher (which never fires on shell calls) no longer makes kit report the gate as wired.kit gate-bash; id) are reported too.The Cursor, Amazon Q, Kiro and Droid installers moved to
src/agent-gate-installers.ts(agent-config.ts was over the size limit).Tests
Fixture tests per agent contract, each with the source file it is based on. Every look-alike and matcher test failed on the code before the fix. Local gate:
node scripts/prepush.mjsgreen (tests of changed files, kit review --enforce, self-audit, coverage gate). Test growth is over the 400-line cap; the reason is in the commit trailer.Not verified
apply_patchin Codex is deliberately not added to thegate-bashmatcher: Codex sends the raw patch intool_input.command, whichgate-bashwould misread. It belongs to the write-gate phase.🤖 Generated with Claude Code