Repository navigation
fix(agent-config): route Claude Code's PowerShell tool to gate-egress - #1131
Open
sandstream wants to merge 4 commits into
Open
sandstream wants to merge 4 commits into
sandstream wants to merge 4 commits into
Conversation
The opt-in gate-egress reads PowerShell's Invoke-WebRequest but was installed with the matcher Bash, so a command Claude Code ran through its PowerShell tool never reached it. Reuse the gate-bash matcher helpers: install Bash|PowerShell, fail enforcement gate liveness on a stale egress matcher where the gate is wired, and widen it in place on kit agent-config --broker-gate. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…r gate-egress Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Base automatically changed from
claude/web-kit-status-sync-p6fg9a-protected-pwsh-matcher
to
main
November 27, 2026 11:27
…egress-pwsh-matcher
|
Docker image built, scanned, and smoke-tested in CI. The PR image is local to this run and is not published. |
There was a problem hiding this comment.
kit review gate at bdfe259704ab: not approved.
- checks did not pass: build-and-test, linux shard 1/4
- touches protected paths (permissions), which the owner approves:
src/agent-config.ts - changes modules many others import, which the owner approves:
src/check-security.ts(101 importers)
…ress-pwsh-matcher Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Docker image built, scanned, and smoke-tested in CI. The PR image is local to this run and is not published. |
This branch has not been deployed
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.
What
Stacked on #1110: the base is
claude/web-kit-status-sync-p6fg9a-protected-pwsh-matcher. Merge #1110 first; this PR then retargets to main.#1110 matched
gate-bashtoBash|PowerShell. The opt-ingate-egress(kit agent-config --broker-gate) was still installed with the matcherBash, although its docs say it reads PowerShell'sInvoke-WebRequest,Invoke-RestMethodandTest-NetConnection. A command Claude Code ran through itsPowerShelltool, the only shell on Windows without Git Bash, never reached the egress gate.Found while working kit-research#239 (
docs/research/prismor-always-allowed-rules-vs-kit.md), next to the #1110 matcher fix.Change
It reuses #1110's helpers in
src/gate-bash-matcher.ts, now keyed on a subcommand (ShellGate = "gate-bash" | "gate-egress"). The existinggate-bashnames stay as they were.installBrokerGateswritesBash|PowerShellforgate-egress. On a re-run it widens a staleBash-only egress group in place (widenGateEgressMatchers), with no second entry.enforcement gate livenessfails on a stale egress matcher only wheregate-egressis wired, and nameskit agent-config --broker-gateas the repair. The message comes from one helper,staleShellGateDetail, for both gates.src/agent-config.tsgoes from 1771 to 1775 lines; the frozen limit is 1780.Before / after
A scratch project,
installInstallGate,installEnvWriteGateandinstallBrokerGates, thencheckGateLiveness. Then the egress group is rewritten to"Bash", andinstallBrokerGatesruns again.Before (#1110 head 059ea7e):
After:
Tests:
src/gate-egress-matcher.test.tscovers the fresh install, stale detection, repair and idempotence, and that the egress repair leaves thegate-bashgroup alone.src/agent-config.test.tsnow expectsBash|PowerShellfor the broker gate.Harnesses
gate-egressis wired.gate-egressis wired for Claude Code only. Codex, Cursor CLI, Gemini CLI, Copilot CLI, Antigravity, Amazon Q, Kiro, Cline, Droid, Augment, OpenCode and Aider get no egress gate, so there is no matcher there to fix.Choice for the owner
The repair for a stale egress matcher is
kit agent-config --broker-gate, not a plainkit agent-config. The egress gate is an opt-in and fails closed, so a plain run does not touch it, the same as before. Thekit hooks gatesSessionStart repair from #1110 coversgate-bashandgate-envonly, so it does not widen the egress matcher.Protected paths
Touches
src/agent-config.ts(protected, "permissions"): protected — owner merges.Platforms
Tested on Linux. The point of the change is Windows. CI covers Windows, but no test runs a live Claude Code PowerShell tool. macOS is unverified.
Docs and changelog
docs/COMMANDS.md: thekit gate-egressrow.docs/ENFORCEMENT_AND_AUDIT.md: fix(agent-config): route Claude Code's PowerShell tool to gate-bash #1110's matcher paragraph.changes/egress-pwsh-matcher.md.Generated by Claude Code