Skip to content

chore: add Docker Sandboxes (sbx) setup for Claude Code - #724

Open
KManolov3 wants to merge 5 commits into
developfrom
feature/sbx-sandbox
Open

KManolov3 wants to merge 5 commits into
developfrom
feature/sbx-sandbox

Conversation

@KManolov3

@KManolov3 KManolov3 commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Resolves

(Should create jira issue)

Proposed Changes

Developers can run Claude Code on this repository inside a Docker Sandboxes (sbx) microVM: the agent works on its own clone, reaches only allowed hosts, and never sees the developer's credentials. Package code, builds and CI are unchanged.

  • sbxenv.yaml defines the sandbox: this repository's workload kit, Docker's Claude Code mixin and a shared base-toolkit mixin, with the scratch-gui dev server published on port 8601.
  • config/sbx/scratch-editor/ holds the workload image (Node from .nvmrc, the browser dependencies for the Selenium and Playwright tests, the libraries canvas builds against) and the hosts it may reach, each commented with the file that needs it.
  • config/sbx/bin/sbx-up checks the developer's machine and starts the sandbox; acceptance.sh checks its isolation, credentials and network policy from the host.
  • config/sbx/README.md is the developer guide: one-time setup, daily use, getting the agent's commits back, and known limits.
  • .gitignore ignores local.sbxenv.yaml, which sbx-up --direct writes.
  • .claude/skills/create-pr/ adds a Claude Code skill that writes pull request descriptions in this repository's template.

Reason for Changes

An agent running directly on a developer's machine has their files, credentials and network. The sandbox lets developers use Claude Code on this repository with access limited to a clone, an allowlist of hosts and a GitHub token scoped to this repository.

Test Coverage

Checked by hand on sbx 0.48.0 on an Apple-silicon Mac:

  • In a fresh sandbox, npm ci and npm run build succeed with no blocked hosts, and the dev server opens from the host on port 8601.
  • All package tests pass in the sandbox except those the guide lists under "Known limits" (three scratch-gui Firefox drag-over tests, which pass in CI).
  • acceptance.sh passes 39 checks; its clone check fails only because this repository's commitlint hook rejects the check's test commit, which the guide notes.

Adds an sbx sandbox for this repository: a Node 24 workload kit with the browser
dependencies the test suites need, Docker's Claude Code mixin, and the company
base-toolkit mixin, plus the sbx-up wrapper, acceptance checks and developer guide.
Name the scratch-gui Firefox drag-over and scratch-svg-renderer visual-fidelity
tests and where they pass, move the acceptance clone-check note to "Checking the
sandbox", and drop the maintainers line.
@KManolov3
KManolov3 requested a review from a team as a code owner October 21, 2026 13:59
@adzhindzhi
adzhindzhi requested a balanced review from Copilot October 28, 2026 10:43

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Unresolved launcher-trust, Git configuration verification, and restart-enforcement flaws can permit sandbox-written code to execute on the host or expose the developer’s SSH agent to the sandbox.

No open issues 🎉

What changed in this PR

Adds a Docker Sandboxes environment for running Claude Code against Scratch Editor in an isolated clone, without changing package code, builds, or CI.

Changes:

  • Defines the sandbox workload, development tools, network allowlists, and published development-server port.
  • Adds host setup, launch, and acceptance scripts, plus direct-mode safeguards and developer documentation.
  • Adds shared Claude settings and a skill for preparing pull requests.
File Description
sbxenv.yaml Defines sandbox kits, clone mode, and port publishing.
config/​sbx/​scratch-editor/​scratch-editor.yaml Declares workload capabilities and allowed hosts.
config/​sbx/​scratch-editor/​scratch-editor.dockerfile Installs Node, browser dependencies, and Docker Engine.
config/​sbx/​sbx-up.conf Defines project preflight requirements.
config/​sbx/​README.md Documents setup, daily use, protections, and limitations.
config/​sbx/​bin/​sbx-up Launches sandboxes with preflight checks and direct-mode guards.
config/​sbx/​bin/​sbx-lib.sh Shares sandbox lookup and utility functions.
config/​sbx/​bin/​bootstrap.sh Configures and checks the host baseline.
config/​sbx/​bin/​acceptance.sh Checks isolation, credentials, networking, and development tools.
config/​sbx/​base-toolkit/​files/​usr/​local/​bin/​sandbox-chrome-devtools-mcp Launches the in-sandbox browser tool.
config/​sbx/​base-toolkit/​files/​etc/​gitignore Excludes local settings and sensitive files from Git.
config/​sbx/​base-toolkit/​files/​etc/​gitconfig Rewrites GitHub SSH URLs to HTTPS.
config/​sbx/​base-toolkit/​files/​etc/​claude-code/​managed-settings.json Configures Claude permissions, updates, and allowed tool servers.
config/​sbx/​base-toolkit/​base-toolkit.yaml Defines shared credentials, networking, and startup hooks.
config/​sbx/​base-toolkit/​base-toolkit.dockerfile Packages shared tools and managed configuration.
config/​sbx/​base-toolkit/​base-toolkit-context.md Provides sandbox-specific agent guidance.
.gitignore Ignores the generated direct-mode environment file.
.claude/​skills/​create-pr/​SKILL.md Adds guidance for preparing PR titles and descriptions.

Review effort: Balanced

Update the copied sbx bundle to the current ai-enablement version:

- config/sbx/README.md is now a short guide (start, getting work out);
  the rest moves to config/sbx/REFERENCE.md, which sbx-up prints from.
- REFERENCE.md gains an "MCP servers" section, and the workload installs
  this project's MCP allowlist as a managed-settings.d drop-in (empty).
- The base-toolkit layer is called "global" rather than "company".
- acceptance.sh skips commit hooks for its probe commit, so the clone
  check no longer trips commitlint; drop the note about it.
Update the sbx bundle copy: .git/info and package-manager rc files are
read-only in direct mode, skip-worktree and assume-unchanged marks are
guarded, and --direct is refused in a linked worktree.

This branch has not been deployed

No deployments
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.

3 participants