Skip to content

chore(sandbox): allow the docker CLI and Flutter write paths (OD-49) - #77

Merged
HussienALfajer merged 2 commits into
mainfrom
claude/shifa-env-cloud-sessions-omcisl
Nov 17, 2026
Merged

HussienALfajer merged 2 commits into
mainfrom
claude/shifa-env-cloud-sessions-omcisl

Conversation

@HussienALfajer

Copy link
Copy Markdown
Owner

Summary

Owner decision OD-49 (recorded in docs/open-decisions.md), widening the Claude Code Bash sandbox:

  • .claude/settings.json: sandbox.excludedCommands: ["docker *"] and sandbox.filesystem.allowWrite: ["//opt/flutter/bin/cache", "~/.dart-tool"].
  • scripts/test/sandbox-policy.test.mjs / sandbox-settings.test.mjs: excludedCommands moves from forbidden to pinned; both new lists must match exactly, so a later PR still cannot widen them silently.
  • docs/process/cloud-sessions.md and docs/process/wsl2-setup.md updated to what was measured.

Accepted risk: a command Claude types that starts with docker runs unsandboxed, with the Docker daemon's root access.

Measured in a cloud session (the settings reload live):

  • "docker" alone did not match docker info; "docker *" does (docker info → 29.9.2).
  • Docker started from Node is not covered: pnpm env:check, Testcontainers, obs:*, backup:* still hit the sandbox and stay CI-only.
  • The Flutter paths are now writable by the sandbox policy, but /opt/flutter is owned by nobody (from the archive) and root has no override inside the sandbox, so Flutter still gets Permission denied. That needs chown -R root:root /opt/flutter and mkdir -p /root/.dart-tool in the cloud environment's setup script (owner's environment settings, not this repository).

Test plan

  • node --test scripts/test/sandbox-policy.test.mjs scripts/test/sandbox-settings.test.mjs: 12 pass, 0 fail
  • docker info in a cloud session after the change: works
  • pnpm verify (fast): format, instructions, lint-root, scripts-test, file-length, drift pass; pub-get fails on /opt/flutter ownership (documented above), so typecheck+lint+test was skipped. CI verify (full) is the gate.

Generated by Claude Code

HussienALfajer and others added 2 commits November 17, 2026 13:24
Owner decision OD-49: sandbox.excludedCommands ["docker *"] and
sandbox.filesystem.allowWrite ["//opt/flutter/bin/cache", "~/.dart-tool"].
The sandbox policy tests pin both lists exactly instead of forbidding
excludedCommands.

Measured in a cloud session: "docker" alone did not match "docker info"
("docker *" does); Docker started from Node (env:check, Testcontainers,
obs/backup) stays sandboxed; the Flutter paths still fail until the
environment's setup script makes /opt/flutter owned by root and creates
~/.dart-tool. Recorded in open-decisions, cloud-sessions and the WSL2
guide.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ay8hotFSny4hpGJSHNrpQP
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ay8hotFSny4hpGJSHNrpQP
@HussienALfajer
HussienALfajer enabled auto-merge (squash) November 17, 2026 10:26
@HussienALfajer
HussienALfajer merged commit a98637a into main Nov 17, 2026
11 checks passed
@HussienALfajer
HussienALfajer deleted the claude/shifa-env-cloud-sessions-omcisl branch November 17, 2026 10:30
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