Repository navigation
fix: surface proxy host refusals at the spawn grant - #406
Merged
Merged
Conversation
gh prints "authentication token is invalid" / GraphQL 403 when the CONNECT proxy refuses api.github.com, because it never sees "Forge Sandbox Denied". If the proxy recorded a denied host during the command, pause for a host allow instead of handing the model a fake auth failure. A real GitHub 403 after an allowed CONNECT still fails through.
4 of 5 tasks
mohitranka
added a commit
that referenced
this pull request
Aug 21, 2026
gh prints "authentication token is invalid" / GraphQL 403 when the CONNECT proxy refuses api.github.com, because it never sees "Forge Sandbox Denied". If the proxy recorded a denied host during the command, pause for a host allow instead of handing the model a fake auth failure. A real GitHub 403 after an allowed CONNECT still fails through.
mohitranka
added a commit
that referenced
this pull request
Sep 11, 2026
gh prints "authentication token is invalid" / GraphQL 403 when the CONNECT proxy refuses api.github.com, because it never sees "Forge Sandbox Denied". If the proxy recorded a denied host during the command, pause for a host allow instead of handing the model a fake auth failure. A real GitHub 403 after an allowed CONNECT still fails through.
mohitranka
added a commit
that referenced
this pull request
Sep 11, 2026
gh prints "authentication token is invalid" / GraphQL 403 when the CONNECT proxy refuses api.github.com, because it never sees "Forge Sandbox Denied". If the proxy recorded a denied host during the command, pause for a host allow instead of handing the model a fake auth failure. A real GitHub 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.
Architecture
Enforcement already knew the host. The CONNECT proxy records every refused destination. The spawn used an
EgressGrantthat only had a port and a socket, so a failed command could only becomeSandboxDeniedifexplain_denialrecognised a string in stderr.Clients do not print
Forge Sandbox Denied. They print their own 403 / auth / Forbidden text. The session then recorded a normal tool failure and the model chased the wrong fix.The grant now shares the proxy control plane. After a confined spawn exits non-zero:
explain_denialmatches (FS or recognised network strings), stillSandboxDenied, with that host if we have one.SandboxDeniedfor that host.No per-app tools.
gh,curl,cargo,npmall hit the same path.Session HITL is unchanged in shape:
SandboxDeniedwithdenied_hostasks to allow the host and retries confined.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_hostcargo clippy --package forge-tools --package forge-core --all-targets -- -D warnings