stablyai/orca#42960 (Neil, dev) was authored by orca-cloud-dev[bot]. Neil had connected GitHub; member
identities only reached git: gh ran on the workspace placeholder (the App's installation token), and
the Worker's member route on api.github.com allowed only REST under the repo while gh pr create is
GraphQL.
- VM: a gh wrapper runs gh with the attested sender's own placeholder (orcad attests, as for git);
plain gh otherwise. Behind GH_AS_MEMBER=on (dev on).
- Worker, api.github.com with a member placeholder: the member's own token only for REST under the
workspace repo and for allowlisted authorship mutations whose every target resolves to it
(repositoryId equals its node id; other ids looked up with the installation token, cached per repo,
failures not cached). graphql-js parse; variable defaults, owner-level projectIds, duplicate
top-level keys and anything unexpected are not member requests. Everything else goes out on the
installation token as before; an out-of-repo pinned mutation is refused with a GraphQL error.
- Shared workspaces never approve or merge as a member (GraphQL and REST): those go out on the
installation token, so branch protection still applies.
- Identity rule: the only person who can use a workspace always acts; in a shared one the latest
sender acts until another member sends, for at most MEMBER_GIT_SHARED_MAX_MINUTES (default 480).
- A GitHub connect or disconnect mid-session reaches the running VM's identities now.
- Tokens never enter the VM.
Puts the token-free compile on a probe account's LIVE session, so the probe can see whether a
header-matched respond rule answers at all (separating 'respond not enforced' from 'resume restored
something else').
egress-docs' A4 run: after resume-raw the echo to the custom base-URL host answered 200 where the
token-free record should answer the placeholder 403. The Worker's token-free compile is right (the
host keeps its respond rules: checked in the harness), so the probe needs to see what Vercel holds
per host and what status came back:
- the audit adds domains: {host: {injection, forward, response}} (hostnames only);
- echo-probe returns the HTTP status again. The echoed body stays in a shell variable, never a file.
A Cloud Run cold start cost Codex's first chatgpt.com call ~10.8 s on dev (seen twice on
2026-11-15, each right after an idle period). min_instance_count 0 -> 1 on staging (applied).
egress-docs' review of #805: the echoed request goes straight into grep -c (a swapped value never
touches the VM's disk), and both routes refuse any row outside the throwaway probe accounts
(account_id dev:egress-…).
scrubStoppedRecord re-reads the row right before the PATCH and only scrubs one that is still
suspended or archived with no session; if the row resumed while the PATCH was in flight, the live
policy is re-applied at once (reason scrub_race). Failed rows are left out of the sweep on purpose:
failAndRelease destroys their provider sandbox.
egress-docs' probe 2 re-run through #803 found transformRuleCount always 0: Vercel's redacted shapes
name header swaps injectionRules (session) next to forwardRules and responseRules. The audit now
reports each kind separately (count + header names), so a scrubbed policy is checkable: 0 injection
rules, response rules only.
Two more dev-only operator routes so the probe needs no personal Vercel login:
- POST …/resume-raw: resume the provider session from its stored record with no policy write of
ours (the row is left as it was; dev throwaways only).
- POST …/echo-probe?marker=orcaprobebogus…: one fixed request from inside the VM to httpbin.org
or postman-echo.com carrying a placeholder header (placeholders only, validated); the answer
is whether the echo contained the marker. No body comes back or is logged.
A wake resumes from the scrubbed record, so until its policy write lands the firewall answers the
placeholders itself (the keys-withheld or signed-out errors agents print). The write now retries
(250 ms, 1 s, 3 s); if it never lands, the wake still completes (fail closed, never a hang), logs
policy_apply_failed {reason: boot} by code, and marks policy_stale_at for reconcile's next tick.
Archive and delete stop the VM but nothing it started elsewhere (a preview
database branch keeps billing). The control plane now runs scripts.archive
on the still-running VM: bash with set -e, as the user, with the session's
env and secrets, 2 min for all checkouts, output per checkout and in
~/.orca-sandbox/archive-hook/archive.log.
- POST/GET /v1/sandboxes/:id/archive-hook; migration 0062 remembers whether
the repo has a hook (learned at each sleep) so an asleep archive/delete can
offer a wake for it, and never wakes one without a hook.
- Desktop archive runs it before the Sleep; a failure shows the output with
Archive anyway / Keep it. Asleep: the Undo toast says it wakes first and
offers Skip hook.
- Asleep/unreachable delete runs it through the control plane; a failure
refuses with the usual Delete anyway waiver.
- Unattended archives (public API, team list) run it on a running VM and
archive even if it fails (logged).
- Docs: orca.yaml scripts.archive for Orca Cloud workspaces.
Probe 2 (egress-docs): a session's last network policy survives a stop or a timeout on the
persistent record and is re-applied on resume, so firewall-mode values would sit at rest in Vercel
while a workspace sleeps.
- After every voluntary stop (sleep, rollover, restart, archive) and when reconcile finds the
provider stopped a session (timeout), the record is PATCHed with the token-free compile (same
routes, every firewall value answered by the firewall, no App token). A failed PATCH sets
policy_scrub_pending.
- Reconcile scrubs stopped rows that are pending, or whose last policy carried a firewall class and
was written after their last scrub (timeouts, crashes, and a one-time sweep on deploy).
- A wake PATCHes the record with the full policy right before resuming (no gap); the post-resume
apply stays as the backstop.
- Boots stamp policy_config_hash (and a generation one below now), so create and wake writes are
covered like applies. Proxy-only policies hold no values: nothing to scrub, no record writes.
- Migration 0067 (0064 and 0066 are held by #783 and #792): policy_scrubbed_at,
policy_scrub_pending.
For egress-docs' probe 2, re-run on the Worker's own Vercel token (dev only; elsewhere these routes
don't exist; operator token):
- GET /v1/internal/sandboxes/:id/provider-policy-audit?marker=orcaprobebogus…: the raw record and
session read from Vercel, answered as redacted facts only (state, session status, whether a
network policy is present, transform rule count, header names, markerFound by substring test).
No value or body is returned or logged.
- POST /v1/internal/sandboxes/:id/provider-policy-scrub-test: A4's primitive, scrubRecordPolicy,
which PATCHes the persistent record with the token-free compile (every firewall value answered by
the firewall, no App token; proxy routes hold no values anyway).
compileSandboxPolicy gains { tokenFree }; the provider gains updateRecordNetworkPolicy and a
dev-audit raw read.
Follow-up to #801: the rest of the Workers' shared in-flight promises.
- Auth (sandbox-control desktop, staging and dev keys; billing) and the egress proxy's OIDC keys used
jose's createRemoteJWKSet, which shares one in-flight JWKS fetch across every caller: a request
cancelled mid-fetch hung every token check behind it, and jose refetches after ten minutes. That
fits the 'Start sandbox' creates stuck before any log 10–15 min after a deploy and cleared by a
redeploy. settledRemoteJWKSet keeps the key set as a value; a request that needs a fresh one
fetches it for itself (refetch every 10 min, an unknown kid at most every 30 s).
- applySandboxPolicy no longer chains writes per sandbox in the isolate (a chained promise from a
cancelled request would hang every later write for that sandbox); the D1 generation orders them.
- The KMS keyring cache keeps the loaded keyring and the last failure as values; no in-flight load
is stored at all.
- Guard (both Workers): a unit test fails on createRemoteJWKSet, or a module-level Map, variable
or object holding a Promise, unless the line says why it is safe ('xreq-ok:', e.g. a WebCrypto
import).
Egress proxy secret routes (custom-base-URL keys, OPENAI_BASE_URL) hung until the client gave up
(dev, proxy mode, 2026-11-15). The Worker was invoked (tail: `canceled`, wall 65 s, CPU 3 ms, no log
line) and was waiting, never reaching its upstream fetch. GitHub routes on the same sandbox answered.
An isolate serves many requests, and a promise one request starts is bound to that request's I/O. If
that request is cancelled while the promise waits on D1, KMS or fetch, the promise never settles, and
every later request awaiting the same cached promise hangs. Several module-level caches shared
in-flight promises: the KMS keyring (forever, per isolate), decrypted provider keys and account
credentials (per minute), the relay's ID token mint, the App's pending-request owners, create timing
and share-link lookups.
They now cache settled values only (settled-cache.ts and the same pattern inline). A request that
misses loads for itself; a cold isolate may run a few duplicate loads.
Workstream C of the egress migration. `scripts/egress-probe.ts --mode proxy|firewall|both` flips the
same two dev workspaces with the operator egress-mode route and runs every check in each mode. Each
request is a Node fetch (undici, like the agents) with a 30 s limit, so the transform body hang shows
up as a named failure. New coverage:
- a chunked stream, a 1 MB upload and a WebSocket upgrade through the swap;
- a placeholder sent to an unrelated host must arrive unswapped;
- the WebSocket host fails closed;
- the LFS batch API, git fetch, push and delete;
- the App-repo clone through the desktop's create.
Latency is reported per class (median/p90). The terminal wait is now 15 min, and a project whose
clone failed is registered as a folder, so the checks still run.
On dev at 2cc12610 (A2+A3), firewall mode passes 22/22. Proxy-mode findings went to gh-access.
Security review of A1/A2 (egress-docs):
- F1: the Copilot PAT never reaches the firewall. Eligibility is decided per secret
(firewallEligibleSecret): no credential the proxy narrows on any host (response filtering,
paths, per-host paths). Before, its Copilot API host entries had no paths and compiled to
transforms, putting a user's GitHub PAT in the policy store.
- F2: claims are ordered but landed writes weren't. After a write, if a newer generation was
claimed meanwhile, the write is redone from current state, so a stale compile (say from before a
share) is never the last to land.
- F3: a config-hash change fails closed only when it removes access or custody (firewall to proxy,
a firewall class removed, an account provider turned off, open to limited). Anything else retries
via policy_stale_at, so a deploy during a provider blip can't sleep every workspace. The stamp now
carries the deciding inputs; a pre-F3 bare-hash stamp is retried.