Skip to content

fix(sandbox): keep egress evidence outside target mount - #326

Open
Jake Present (jakepresent) wants to merge 3 commits into
mainfrom
jake/fix-sandbox-host-owned-egress
Open

fix(sandbox): keep egress evidence outside target mount#326
Jake Present (jakepresent) wants to merge 3 commits into
mainfrom
jake/fix-sandbox-host-owned-egress

Conversation

@jakepresent

Copy link
Copy Markdown
Collaborator

Problem

The stock sandbox wrote host-proxy network evidence under the same directory mounted read/write into the evaluated target. A target could overwrite or delete egress.jsonl before ASSERT consumed it.

Fix

  • keep the proxy-generated egress ledger in a sibling host-only audit/ directory
  • continue mounting only the target's declared output/ directory
  • document the host-owned network-evidence boundary
  • add unit and real-Docker regressions proving a forged /sandbox/output/egress.jsonl cannot alter the host ledger

This PR fixes network-ledger mutability only. Moving tool-action capture out of the evaluated process is a separate architectural change.

Verification

  • Regression test was added first and failed against the previous path (out/egress.jsonl instead of host-only audit/egress.jsonl).
  • 74 passed across focused sandbox runtime/example/hostile-input tests.
  • 1370 passed, 24 skipped, 840 subtests passed across tests/ after installing the viewer's locked dependencies.
  • Live Docker probe: the target successfully created a forged lookalike under /sandbox/output, while the host ledger remained unchanged and its directory was absent from target mounts.
  • The probe left no new sandbox containers or networks.

Risk

Low and scoped to the stock container runtime's temporary-directory layout. Both directories remain owned by the same per-case temporary session and are removed together during session cleanup.

The host-only property was asserted two ways, and neither covered the
general case on the ungated path:

  - the unit test pinned the audit path to one hardcoded tmp_path layout,
    so it proves the current caller's arrangement but not the invariant;
  - the general mount check lives in test_sandbox_runtime_docker.py, which
    is ASSERT_RUN_DOCKER_TESTS-gated and skipped in normal CI.

Parse the real -v arguments and assert the ledger is not inside any of
them. Verified this catches a leak the existing assertions miss: adding a
mount of output_dir.parent leaves the audit path unchanged (so the
equality assert still passes) while placing the ledger inside a target
mount, and only this check fails.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant