fix(sandbox): honor explicit docker env#82763
Conversation
|
Codex review: needs maintainer review before merge. Summary Reproducibility: yes. The linked issue gives concrete Docker steps, and current source shows configured Docker env is filtered by sensitive-name patterns before Docker Real behavior proof Next step before merge Security Review detailsBest possible solution: Land this PR after maintainer policy signoff and green CI if the intended contract is that explicit Docker sandbox env is persisted as container Do we have a high-confidence way to reproduce the issue? Yes. The linked issue gives concrete Docker steps, and current source shows configured Docker env is filtered by sensitive-name patterns before Docker Is this the best way to solve the issue? Yes. The PR makes the smallest maintainable split I see: explicit sandbox config env bypasses inherited-host sensitive-name filtering, inherited/process env sanitization remains in place, and affected containers are invalidated by a targeted hash epoch. Acceptance criteria:
What I checked:
Likely related people:
Remaining risk / open question:
Codex review notes: model gpt-5.5, reasoning high; reviewed against 81a578fd6bff. |
Summary
agents.defaults.sandbox.docker.envas explicit Docker sandbox configuration so credential-looking configured keys are passed to container creation.Verification
node scripts/run-vitest.mjs src/agents/sandbox-create-args.test.ts src/agents/sandbox/sanitize-env-vars.test.ts src/agents/sandbox/docker.config-hash-recreate.test.ts src/agents/sandbox/config-hash.test.ts src/agents/sandbox/browser.create.test.tsgit diff --checkpnpm format:docs:checkcodex review --uncommittedBehavior addressed: Explicit configured Docker sandbox env vars with secret-looking names are no longer filtered out during container creation.
Real environment tested: Direct AWS Crabbox and Blacksmith Testbox-through-Crabbox with real Docker sandbox containers and dummy env values only.
Exact steps or command run after this patch: Testbox targeted-synced this branch patch, ran focused sandbox Vitest files, pulled
debian:bookworm-slim, created a Docker sandbox viaensureSandboxContainer, inspected.Config.Env, and removed the container.Evidence after fix: AWS Crabbox
cbx_469a6efa4d95printedISSUE_82695_FIXED=1; Blacksmith Testboxtbx_01krse65vpk7hzr95e3ej34r9jprintedISSUE_82695_FIXED_TESTBOX=1.Observed result after fix: All configured keys from the issue repro were present,
missingConfiguredwas[], andOPENCLAW_CLI=1was present.What was not tested: Real third-party service credentials were not used; all values were dummy strings.
Fixes #82695