What
A fail-closed contract test asserting every autonomous runtime spawns with a scrubbed env + confined cwd.
Why
Prevents capability/enforcement drift (the prior perActionApproval divergence is the cautionary tale). Must fail if a new executesUntrustedTools runtime spawns without going through the seam.
Design
- Enumerate the runtime registry dynamically (not a hardcoded list); for each
executesUntrustedTools === true, stub the spawn/SDK seam and assert the captured env has zero denylisted vars and a confined cwd was used.
Affected files
- new
electron/agent/runtime/__tests__/confinement-contract.test.ts; possibly a spawn/SDK stub in test-utils/runtime-stubs.ts.
Acceptance criteria
- Test enumerates runtimes dynamically (future runtime auto-covered).
- Fails when a flagged runtime spawns with an unscrubbed env or unconfined cwd.
Effort: S · Deps: #6, #7, #8
Part of #66
What
A fail-closed contract test asserting every autonomous runtime spawns with a scrubbed env + confined cwd.
Why
Prevents capability/enforcement drift (the prior
perActionApprovaldivergence is the cautionary tale). Must fail if a newexecutesUntrustedToolsruntime spawns without going through the seam.Design
executesUntrustedTools === true, stub the spawn/SDK seam and assert the captured env has zero denylisted vars and a confined cwd was used.Affected files
electron/agent/runtime/__tests__/confinement-contract.test.ts; possibly a spawn/SDK stub intest-utils/runtime-stubs.ts.Acceptance criteria
Effort: S · Deps: #6, #7, #8
Part of #66