Repository navigation
fix: surface proxy host refusals at the spawn grant - #407
Merged
Merged
Conversation
A confined process can fail with whatever the client printed (HTTP 403, "token invalid", "Forbidden"). That is not a per-app problem. The CONNECT proxy already recorded the refused host; the grant used to route the spawn now carries that log so bash and exec_command return SandboxDenied. Session HITL stays generic: grant the host, retry confined. A real 403 after an allowed CONNECT still fails through.
mohitranka
added a commit
that referenced
this pull request
Aug 21, 2026
A confined process can fail with whatever the client printed (HTTP 403, "token invalid", "Forbidden"). That is not a per-app problem. The CONNECT proxy already recorded the refused host; the grant used to route the spawn now carries that log so bash and exec_command return SandboxDenied. Session HITL stays generic: grant the host, retry confined. A real 403 after an allowed CONNECT still fails through.
mohitranka
added a commit
that referenced
this pull request
Sep 11, 2026
A confined process can fail with whatever the client printed (HTTP 403, "token invalid", "Forbidden"). That is not a per-app problem. The CONNECT proxy already recorded the refused host; the grant used to route the spawn now carries that log so bash and exec_command return SandboxDenied. Session HITL stays generic: grant the host, retry confined. A real 403 after an allowed CONNECT still fails through.
mohitranka
added a commit
that referenced
this pull request
Sep 11, 2026
A confined process can fail with whatever the client printed (HTTP 403, "token invalid", "Forbidden"). That is not a per-app problem. The CONNECT proxy already recorded the refused host; the grant used to route the spawn now carries that log so bash and exec_command return SandboxDenied. Session HITL stays generic: grant the host, retry confined. A real 403 after an allowed CONNECT still fails through.
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.
Why
#406 merged the first commit only. That version special-cased failed commands in the session loop when the proxy had refused a host, and the tests were named around
gh.The follow-up that actually moved the fact to the spawn grant never landed.
This PR
The CONNECT proxy already records refused hosts. The
EgressGrantused to route a confined spawn now carries that control plane. After any confined process exits non-zero:SandboxDenied { denied_host }(HITL to allow the host, retry confined).Session HITL stays generic. No per-app tools.
gh,curl,cargo,npmall hit the same path.Removes the GitHub-named test tool that landed in #406.
Test plan
cargo test --package forge-tools --lib proxy_refusalcargo test --package forge-tools --lib without_a_proxy_refusalcargo test --package forge-core --lib a_denied_hostd3cf438