sandbox: injected egress credentials + sandbox-jcp cross-workspace fix (re-land of #33) #36
Loading…
Reference in a new issue
No description provided.
Delete branch "sandbox/cred-injection-2"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Re-land of #33. Its merge produced commit
9708f203but main's ref never advanced to it — a concurrent ref-update race on an actively-merged branch — so the work was never on main while the PR still reportsmerged=true. Confirmed against the forge API, not a fetch. Same two commits, cherry-picked clean onto current main (88b9d91a, post-#34) and re-verified there.(This is the documented main-clobber behaviour: a MERGED PR is not proof the work is on main. Verify the content, not the status.)
1. Injected egress credentials — the secret never enters the unit
Ingested from the pattern where a hosted agent runtime injects credentials at the network boundary so the sandboxed unit never holds them.
NetworkGrantgainscredentials: Vec<EgressCredential>, each binding an endpoint to asecret_refhandle — a name the boundary resolves in its own keystore, never key material.A compromised or hallucinating agent makes authenticated calls without ever holding the key, so it cannot read, log, or exfiltrate what it was never given. The grant — and any receipt over it — carries no secret.
Two invariants, both enforced and tested:
credential_for()gates onmay_egress()first, so even a malformed grant (a credential for a non-allowlisted endpoint) cannot cause an out-of-policy injection.injection_within_egress()catches it at mint time too — defence in depth, tested from both directions.commitment()content-addresses the(endpoint, secret_ref, mode)decision so an attestation can record which credential was injected — auditable secret usage without exposing the secret.Backward compatible: empty
credentialsisskip_serializing_if-omitted, so grants encode byte-identically and the committed capability vectors are untouched (test asserts the exact JSON).The TX wedge: the incumbent has this isolation without an energy meter or attestation. Here it composes with S5 + RAPL + a signed joule receipt — isolation and accounting.
2.
sandbox-jcp: a latent cross-workspace break, repairedsandbox-jcppath-depends onjcp-schemabut lives in a different cargo workspace, so whenbudget_funds(dual ceilings) andcaveats(§4.9) became requiredGrantfields, its literal broke — and neither jcp-workspace CI nor a cached local build caught it. A clean checkout would not compile. Found only because this branch forced a cold build.36 suites green, clippy clean, full sandbox workspace compiles on current main.