127.0.0.1 via standard HTTP_PROXY/HTTPS_PROXY environment variables.
ProxyConfig
Example
RouteConfig
http://127.0.0.1:<port>/<prefix>/..., the proxy forwards it to upstream with real credentials injected.
InjectMode
Credential injection method:ProxyHandle
Returned bystart_proxy(). Not user-constructable.
Properties
Methods
env_vars() -> dict[str, str]
Environment variables to inject into the sandboxed child: HTTP_PROXY, HTTPS_PROXY, NO_PROXY, NONO_PROXY_TOKEN, and lowercase variants.
credential_env_vars() -> dict[str, str]
Per-route base URL overrides and phantom tokens (e.g., OPENAI_BASE_URL, OPENAI_API_KEY). Only includes routes where credentials were loaded from the keyring.
sandbox_env() -> list[tuple[str, str]]
Convenience method combining env_vars() and credential_env_vars() into a single list of (key, value) tuples, ready to pass directly to sandboxed_exec(env=...).
drain_audit_events() -> list[dict]
Drain and return collected network audit events. Each dict contains:
shutdown() -> None
Signal the proxy to shut down gracefully.
Example
ExternalProxyConfig
Enterprise proxy passthrough for environments behind a corporate proxy.Security Properties
- Cloud metadata deny list:
169.254.169.254and equivalents are always blocked - DNS rebinding protection: Resolved IPs are validated against link-local ranges
- Credential isolation: Real API keys never reach the sandboxed process
- Constant-time token comparison: Prevents timing side-channel attacks
- Audit logging: Every request logged, sensitive data excluded
Related
- Module Functions -
start_proxy()function - SnapshotManager - Filesystem rollback