Skip to content

feat(egress-gateway): allowlisting egress proxy + RFC-AI-0003 §4.4 - #429

Merged
potiuk merged 1 commit into
apache:mainfrom
potiuk:egress-gateway-proxy
Jun 1, 2026
Merged

potiuk merged 1 commit into
apache:mainfrom
potiuk:egress-gateway-proxy

Conversation

@potiuk

@potiuk potiuk commented Jun 1, 2026

Copy link
Copy Markdown
Member

Summary

Adds tools/egress-gateway/ — a local host-allowlisting HTTP(S) forward proxy (a proxy.py plugin) 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 gap docs/setup/secure-agent-setup.md flags for Bash(curl *) egress. The gateway closes it at the network layer: default-deny host allowlist, 403 before a socket opens. Layered under the two mechanisms, never a replacement.

What's here

  • tools/egress-gateway/ — proxy.py plugin (EgressAllowlistPlugin) + CLI launcher + tool.md/README.md. Default allowlist mirrors sandbox.network.allowedDomains (ASF infra, GitHub, Google APIs, PyPI), suffix-matched; loopback always allowed; adopters extend via EGRESS_ALLOW_EXTRA.
  • host_allowed() is a pure function with 28 unit tests (IPv6, port/dot normalisation, suffix-spoof rejection, env-extra parsing).
  • RFC-AI-0003 — abstract note + §4.4 (Mechanism 3) + §6.4 (implementation) + §10.6 (wiring follow-ups) + references.
  • Registered in docs/labels-and-capabilities.md (capability:setup) and the uv workspace.

Notes

  • Host-level only (HTTPS via CONNECT, no TLS interception/payload inspection) — egress control without MITM.
  • 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.
  • Optional & provisional: ships as a documented, tested tool but is not yet wired into a setup skill or privacy-llm-check; §10.6 tracks that.

Test plan

  • prek run green (ruff, mypy, pytest, doctoc, workspace-members, capability validator)
  • 28/28 unit tests pass
  • Manually verified end-to-end locally: allowed host -> 200, off-list host -> 403 CONNECT-rejected

Generated-by: Claude Code (Claude Opus 4.8)

…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
potiuk force-pushed the egress-gateway-proxy branch from 81b8503 to 7764743 Compare June 1, 2026 14:27
@potiuk
potiuk merged commit e7c77bb into apache:main Jun 1, 2026
26 checks passed
@potiuk potiuk added the substrate:sandbox Tool substrate: agent isolation, egress control, settings audit label Sep 25, 2026
@potiuk potiuk added family:ci .github workflows, prek, validators family:docs Docs, MISSION.md, READMEs family:tools tools/* labels Nov 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

family:ci .github workflows, prek, validators family:docs Docs, MISSION.md, READMEs family:tools tools/* substrate:sandbox Tool substrate: agent isolation, egress control, settings audit

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant