Repository navigation
feat(egress-gateway): allowlisting egress proxy + RFC-AI-0003 §4.4 - #429
Merged
Merged
Conversation
…0003 Adds tools/egress-gateway/ — a local host-allowlisting HTTP(S) forward proxy (a proxy.py plugin) that constrains where framework tools may send data. It is the network-layer egress-control chokepoint: tools point HTTPS_PROXY at it, and any CONNECT/request to a host not on the allowlist is rejected with 403 before a socket is opened. Why: RFC-AI-0003's two mechanisms (PII redactor + approved-LLM gate) act at the application layer — they bound what a skill deliberately sends to an LLM. Neither stops an unintended outbound flow (a buggy tool, or a prompt-injection payload coaxing the agent into curling private data out) — the gap docs/setup/secure-agent-setup.md flags for Bash(curl *) egress. The gateway closes it at the network layer as defence-in-depth, layered under the two mechanisms, never a replacement. Design: - Default-deny allowlist mirrors sandbox.network.allowedDomains (ASF infra, GitHub, Google APIs, PyPI), suffix-matched; loopback always allowed; adopters extend via EGRESS_ALLOW_EXTRA without editing code. - Host-level only (HTTPS via CONNECT, no TLS interception / payload inspection) — the right model for egress control without MITM. - host_allowed() is a pure function with 28 unit tests (IPv6, port/dot normalisation, suffix-spoof rejection, env-extra parsing). proxy.py integration is not exercised in CI (needs to bind a port). - Separate tool (not a privacy-llm sub-tool) because it carries a third-party runtime dep (proxy.py); the privacy-llm sub-tools are stdlib-only by contract. RFC-AI-0003 updated: abstract note + §4.4 (Mechanism 3, defence-in-depth) + §6.4 (implementation) + §10.6 (wiring follow-ups) + references. Tool registered in docs/labels-and-capabilities.md (capability:setup) and the uv workspace. The mechanism is optional and provisional: it ships as a documented, tested tool but is not yet wired into a setup skill or privacy-llm-check; §10.6 tracks that follow-up. Generated-by: Claude Code (Claude Opus 4.8)
potiuk
force-pushed
the
egress-gateway-proxy
branch
from
June 1, 2026 14:27
81b8503 to
7764743
Compare
4 tasks
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
Adds
tools/egress-gateway/— a local host-allowlisting HTTP(S) forward proxy (aproxy.pyplugin) that constrains where framework tools may send data, and documents it in RFC-AI-0003 as Mechanism 3 (defence-in-depth).RFC-AI-0003's two mechanisms (PII redactor + approved-LLM gate) act at the application layer — they bound what a skill deliberately sends to an LLM. Neither stops an unintended outbound flow (a buggy tool, or a prompt-injection payload coaxing the agent into
curl-ing private data out) — the gapdocs/setup/secure-agent-setup.mdflags forBash(curl *)egress. The gateway closes it at the network layer: default-deny host allowlist,403before a socket opens. Layered under the two mechanisms, never a replacement.What's here
tools/egress-gateway/—proxy.pyplugin (EgressAllowlistPlugin) + CLI launcher +tool.md/README.md. Default allowlist mirrorssandbox.network.allowedDomains(ASF infra, GitHub, Google APIs, PyPI), suffix-matched; loopback always allowed; adopters extend viaEGRESS_ALLOW_EXTRA.host_allowed()is a pure function with 28 unit tests (IPv6, port/dot normalisation, suffix-spoof rejection, env-extra parsing).docs/labels-and-capabilities.md(capability:setup) and the uv workspace.Notes
privacy-llmsub-tool) because it carries a third-party runtime dep (proxy.py); the privacy-llm sub-tools are stdlib-only by contract.privacy-llm-check; §10.6 tracks that.Test plan
prek rungreen (ruff, mypy, pytest, doctoc, workspace-members, capability validator)Generated-by: Claude Code (Claude Opus 4.8)