Egress Gate
Egress Gate is extensible OpenShell middleware for applying an ordered pipeline of gates to outgoing HTTP requests from sandboxes. A gate can inspect a request, report findings, rewrite supported content, allow it, or deny it. Use the built-in regex gate or install trusted custom gates for application-specific checks.
Egress Gate provides one typed, configurable place for request-level controls. You can combine gates, test policies offline, and add new gate types without changing OpenShell.
OpenShell still owns interception, routing, network policy, and credential attachment. Egress Gate is not a forward proxy, TLS interceptor, response filter, or storage control.
Quickstart
From the
projects/egress-gate/
directory in a source checkout:
First, inspect the installed gates and their configuration schema:
Then validate a policy before you use it:
uv run egress-gate validate \
--policy examples/regex-redaction/egress-gate-config.yaml
Start Egress Gate in the foreground when the policy is ready:
Use the regex guide for an OpenShell policy and a regex-pattern "catalog".
Use offline policy tests to check saved request examples with
the same prepared RequestProcessor used by the service. No request goes to an
upstream provider.
How a request moves through the pipeline
- The OpenShell supervisor sends the intercepted request to Egress Gate.
- Each gate reads the current read-only
HttpRequestand can proposeRequestMutations. A gate does not modify its input in place. - The Egress Gate pipeline processor validates and applies the requested
mutations by creating a new local
HttpRequest. - The next gate receives the updated request.
- If the pipeline allows the request, the service adapter maps the accumulated
mutations to OpenShell's
HttpRequestResult. - The OpenShell supervisor applies the returned mutations to the intercepted request before it attaches credentials.
A denial returns no request mutations.
Within Egress Gate, the gRPC service adapter is the only code that imports OpenShell's generated protobuf bindings. Gates and the pipeline processor do not depend on protobuf or gRPC, so the same policy pipeline can run in offline tests.
Core rules
- A policy has one through ten named gates and a required
default_decision. - Each gate receives the current read-only request.
- Each gate returns one control result.
proceedcontinues to the next gate;allowanddenystop the pipeline. Onlyproceedcan include request mutations. Nonebody replacement means no replacement.b""is an explicit empty replacement.- When the pipeline processor reaches a safety limit, Egress Gate denies the
request. The result uses source
runtime_limitand codeegress_gate_limit_exceeded. - Pipeline default deny uses source
pipeline_defaultand codeegress_gate_default_deny. - The released Finding wire contract has only five fields. Gate source and decision provenance remain internal to the pipeline processor.