Skip to content

feat: add sandboxed PC Twin for issue #747 - #940

Merged
AmitoVrito merged 6 commits into
SynapseKit:mainfrom
DhruvGarg111:feat/issue-747-pc-sandbox-clean
Sep 3, 2026
Merged

AmitoVrito merged 6 commits into
SynapseKit:mainfrom
DhruvGarg111:feat/issue-747-pc-sandbox-clean

Conversation

@DhruvGarg111

Copy link
Copy Markdown
Collaborator

Summary

  • implement the sandboxed PC Twin core with deterministic overlays, secure diff bundles, evaluation receipts, transactional apply/rollback, and audit export
  • integrate Docker/OrbStack, fake, Lima, and Firecracker backend selection plus sandbox CLI commands and computer-use/marketplace execution
  • add focused sandbox coverage and operator documentation

Validation

  • tests/sandbox tests/computer_use tests/audit/test_cli.py tests/marketplace/test_bundle.py tests/cli/test_agent_marketplace_cli.py tests/cli/test_agent_cli.py: 76 passed, 1 skipped
  • python -m ruff check src tests: passed
  • python -m ruff format --check src tests: passed (979 files already formatted)
  • targeted mypy, async-blocking, compileall, and the broader agent test suite passed locally before branch isolation
  • Docker integration was not exercised because the local Docker Desktop Linux engine was unavailable

The replacement branch is based directly on current upstream main and contains exactly the three issue #747 commits; unrelated archaeology commits from the earlier branch are excluded.

Closes #747

AmitoVrito and others added 3 commits September 3, 2026 18:53
Locks the sandbox's core guarantees against regression, covering the paths
that were correct-by-inspection but previously unit-untested:

- normalize_relative_path / DiffBundle construction reject ../, absolute,
  ./, empty, and NUL-byte paths
- apply-side _safe_target rejects a symlink-parent escape (a path with no
  traversal tokens whose parent is a symlink pointing outside the root),
  and verifies nothing is written outside
- DiffBundle rejects duplicate paths and a digest-tampered bundle on read
- apply refuses a passing receipt bound to a different diff digest
- CallableEvalGate still gates an explicit passed=True behind the score
  threshold
- ComputerUseAgent audit events record text_length only, never the typed
  text or on-screen contents (no keystroke/secret logging)

Co-authored-by: Dhruv Garg <[email protected]>
@AmitoVrito
AmitoVrito merged commit 7996a4b into SynapseKit:main Sep 3, 2026
15 checks passed
@AmitoVrito

Copy link
Copy Markdown
Collaborator

Merged, thanks Dhruv. Really clean work on this one. The overlay/diff/apply split is solid and the Docker hardening is exactly right. Reviewed the whole thing for sandbox escape and path traversal and it holds up well.

Added a few negative tests before merge to lock the security contract (traversal, duplicate paths, digest tamper, symlink escape, and the no-keystroke-logging audit property) so those paths can't regress. Also opened #1016 (bound the exec output cap like we did in #929) and #1017 (signed receipt at apply time) as follow-ups when you get a chance.

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.

v2.1: Sandboxed PC Twin — safe playground for destructive agent work

2 participants