mirror of
https://github.com/stablyai/orca.git
synced 2026-11-17 19:34:29 +00:00
Egress firewall migration, workstream A2 (design §1, §3, §4, §7 of
.context/cloud/reports/egress-firewall-migration.md). Behind EGRESS_SWAP_MODE=firewall (per sandbox:
sandboxes.egress_swap_mode); proxy mode is unchanged.
- Firewall mode compiles the real values into the sandbox policy: model keys (every header form the
client sends, mapped to the same form of the key), the Claude sign-in, and the GitHub App token
(git Basic on github.com, Bearer/token on api.github.com). The 403 rule still ends every
credential host.
- Fail closed: a key no longer usable, or an account that no longer applies (signed out, revoked,
owner changed, shared, provider off), is answered by the firewall itself (provider-shaped
signed-out body, or the keys-withheld body), never forwarded with its placeholder.
- Stays on the egress proxy: Cursor's key exchange (W1: the reply is filtered), the Copilot PAT on
api.github.com (W2: a prefix scope can't be pinned at the firewall), member identities (W3).
- EGRESS_FIREWALL_CLASSES narrows the classes (model_key, claude, codex, github_app); a removed
class goes back to the proxy.
- policy_config_hash: each apply stamps a hash of the operator inputs; reconcile re-applies a
running sandbox whose hash differs (a kill switch reaches every live policy within one tick) or
whose last write failed (policy_stale_at).
- In firewall mode an env refresh always applies the policy (a key edited in place, a share).
- POST /v1/internal/sandboxes/:id/egress-mode {mode: proxy|firewall|null}: one sandbox's mode,
applied at once (leaving the firewall fails closed).