Repository navigation
fix(agent-isolation): hint on container-gateway policy refusals - #1810
Merged
Merged
Conversation
1 task done
shahar1
marked this pull request as ready for review
October 25, 2026 20:23
shahar1
force-pushed
the
docs/gateway-policy-refusal-hint
branch
from
October 25, 2026 20:46
2ed65bb to
893093a
Compare
A tool that drives the docker CLI (e.g. Airflow's breeze) hides the gateway's 403 body, or gets only "unable to upgrade to h2c, received 403" from an HTTP-upgrade endpoint, so the agent never saw why it was refused and routed around the gateway. Add a hint-hook branch for both signatures and document the refusals (BuildKit, socket bind-mount, untyped docker inspect) and the expected behaviour: report, don't bypass. Generated-by: Claude Code (Opus 5.5, Sonnet 5.5)
CodeQL flagged the implicit string concatenation in the gateway-refusal case list as a possible missing comma. Wrap the two-part literal in parentheses so the concatenation is explicit. Generated-by: Claude Code (Opus 5.5)
shahar1
force-pushed
the
docs/gateway-policy-refusal-hint
branch
from
October 26, 2026 05:47
893093a to
392c9e1
Compare
Re-stamp the isolated-setup fingerprint over the merged tree, and count the hint table's seven failure classes in secure-agent-setup.md. Generated-by: Claude Opus 5
potiuk
approved these changes
Oct 26, 2026
potiuk
left a comment
Member
There was a problem hiding this comment.
Approving. The hint pattern matches the body the gateway actually sends (policy_shape.py builds it as container-gateway: <reason>; see <catalog anchor>), the 502 case stays silent, and the troubleshooting entry reads well. Today's volume-driver refusal reaches the agent through the same 403 body, so it gets the hint too.
I pushed one merge commit to your branch (479de3a):
- merged
main, which had moved the stamped files, and re-stampedFRAMEWORK_FINGERPRINTinisolated_fingerprint.pywith the hook — that was the only conflict; docs/setup/secure-agent-setup.md: the lead-in to the hint table now says seven classes of failure (it said five, with six rows before your new one).
This review was drafted by an AI-assisted tool and
confirmed by an Apache Magpie maintainer. The maintainer
approving this PR has read the findings and signed off. If
something feels off, please reply on the PR and a maintainer
will follow up.More on how Apache Magpie handles maintainer review:
Contributing guide.
potiuk
enabled auto-merge (squash)
October 26, 2026 22:51
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.
Summary
breeze. The container gateway correctly refused BuildKitPOST /grpcand label-checked an untypeddocker inspectof the CI image, but the agent never saw why: breeze capturesdocker inspectoutput, and buildx prints onlyunable to upgrade to h2c, received 403. It then routed around the gateway by building a host virtualenv, which the project forbids.sandbox-error-hint.shgains a branch for gateway policy refusals: the gateway's 403 body (container-gateway: …; see docs/setup/sandbox-troubleshooting.md…) and the bareunable to upgrade to h2c, received 403. The hint says the request was refused by policy, points at thedenylines incontainer-gateway.log, and tells the agent to report to the user instead of routing around it. Gateway 502 backend errors don't match.docker inspect, with breeze as the example. It also says thatexcludedCommandsdoesn't get past the gateway and what the agent should do.Type of change
.claude/skills/<name>/) — eval fixtures updated belowtools/<system>/*.md)tools/*/withpyproject.toml)docs/,README.md,CONTRIBUTING.md)projects/_template/)prek, workflows, validators)Test plan
prek run --from-ref upstream/main --to-ref HEADpasses, including markdownlint, lychee,isolated-setup-fingerprint(re-stamped by the hook) and workspace pytest.prek run lychee --all-filespasses too.tools/agent-isolation/tests/test_sandbox_error_hint.py: 23 passed. Both new positive cases exit 0 under the pre-change hook and 1 with it. The 502 negative case stays silent.bash -nOK), thesandbox-lintCLI, and anything against a live gateway or Docker daemon.test_gpg_touch_overlay.py::test_signing_in_flight_matches_the_whole_process_namefailed under-n autoand passes alone. It looks like a system-widepgrepracing a parallelssh-keygen.RFC-AI-0004 compliance
Linked issues
Refs apache/airflow#75599 (the Airflow-side AGENTS.md change: stop and report when breeze can't run).
Notes for reviewers (optional)
Considered and left out:
relay.pyand still not unblock breeze.Known stale counts not touched here: "Five classes of failure" in
secure-agent-setup.md, the hook header comment, andtools/agent-isolation/README.md"four known … signatures".Generated-by: Claude Code (Opus 5.5, Sonnet 5.5)