2026 OpenClaw MCP filesystem allowlists, POSIX sandbox roots, and blast-radius control on a ProxyMac Mac mini
OpenClaw agents orchestrating builds on rented Mac mini M4 hosts in Hong Kong, Japan, Korea, Singapore, or the United States frequently enable the upstream MCP filesystem server so models can diff repos or harvest logs. That convenience becomes catastrophic when the server’s argv roots include your entire home directory—because MCP inherits POSIX permissions of the Unix user running the gateway, not the ideals written in your policy memo. This playbook delivers (1) a blunt threat model for filesystem tools, (2) a three-tier directory contract separating read, write, and scratch volumes, (3) a permission matrix mapping automation accounts to directories, (4) a seven-step hardening runbook, and (5) incident steps when someone accidentally grants chmod -R 777 during a midnight demo. Runtime monitoring should include per-minute counts of open(2) failures: sustained ENFILE or EMFILE spikes often mean an agent is thrashing disallowed trees instead of stopping gracefully. Pair fundamentals with MCP server setup, secrets + Keychain, and macOS TCC permissions so defence stays layered rather than theatrical.
Schedule quarterly tabletop exercises where engineers deliberately widen argv roots in staging, observe JSONL alerts, then tighten scopes again inside 30 minutes—muscle memory beats improvisation during production escalations.
Why filesystem MCP servers dwarf browser automation risk on macOS gateways
Unlike headless Chromium limits, filesystem MCP can traverse any path readable by the daemon UID—including SSH private keys in ~/.ssh if your roster misconfigured home directories. Prompt injection does not need remote code execution; it simply asks the model politely to cat ~/.aws/credentials. Defenders therefore scope directories with the same rigour they apply to IAM roles: deny-by-default, justify each inclusion with ticket IDs, and assume prompts may go rogue weekly.
- Numeric gut check: teams logging MCP JSONL often observe 120–400 filesystem operations per long-running agent session—each one a chance to leak metadata via path names alone.
- Apple Silicon angle: APFS clones mean “duplicate repo” shortcuts can accidentally share inode snapshots across environments—never rely on Finder copy semantics for isolation.
- Audit hook: ship hashed paths to JSONL diagnostics so SOC can replay spikes without storing raw customer filenames.
Three-tier allowlist model: read roots, write roots, scratch roots
| Tier | Purpose | Typical APFS path | Allowed MCP verbs |
|---|---|---|---|
| Read-only corpus | Vendor SDKs, approved docs | /srv/oc-mcp/read/sdk-cache | List + read bytes |
| Write corpora | Generated artifacts, compiled bundles | /srv/oc-mcp/write/build-out | Create/append within subtree |
| Scratch | Ephemeral diff chunks | /srv/oc-mcp/scratch/$JOB_ID | Anything but symlink escapes |
Never symlink scratch into write roots—macOS permits traversal if ACL inheritance drifts. Apply explicit chmod -h audits after upgrades.
Bind mounts from external SSDs deserve separate scrutiny: unplugging a drive mid-task can surface stale inode handles inside MCP caches—restart gateways after hardware swaps and invalidate scratch folders younger than 24 hours automatically.
POSIX matrix: mapping LaunchDaemon users to filesystem scopes
| Unix account | Primary group | umask | Directories owned |
|---|---|---|---|
automation | staff | 027 | /srv/oc-mcp/* only |
builder (interactive) | developer | 022 | Homebrew trees, not MCP roots |
root | wheel | n/a | Never run MCP servers—drop privileges before exec |
sudo chown -R automation:staff /srv/oc-mcp once, then forbid sudo inside LaunchAgents—operators escalate via break-glass scripts stored in git with checksum tags.
Seven-step hardening runbook before enabling filesystem MCP in prod
- Freeze inventory: document every MCP argv root in configuration management—no shadow copies under Downloads.
- Create APFS volumes or folders with sticky bits where appropriate; separate scratch per job ID using dated prefixes.
- Trim environment: LaunchAgents must set
HOME=/srv/oc-mcp svcwhen feasible so tilde expansion cannot wander. - Secrets firewall: store tokens outside readable roots or rely on Keychain entries per secrets guide.
- Prompt lint: block instructions referencing absolute paths outside allowlists using gateway middleware hooks.
- Canary task: attempt
../../etc/passwdreads from staging—expect deterministic denials logged. - Review quarterly: diff
find /srv/oc-mcp -perm +020output against policy baselines—anything wider triggers rollback.
Incident response when an agent reads beyond the contract
Assume compromise if JSONL shows unexpected path prefixes or sudden spikes in file descriptors. Immediate playbook: (1) launchctl bootout the MCP plist, (2) snapshot APFS with tmutil compare if Time Machine covers the volume, (3) rotate cloud PATs that lived anywhere near readable dirs, (4) notify customers if outputs touched regulated data, (5) patch prompts with guardrail regex until middleware ships.
Capture timestamps with ±5 minute precision—finance teams want correlation when incident bridges overlap billing cycles.
After containment, run an internal blameless review asking five questions: which argv roots were wider than policy, which engineer approved the expansion, which automation test failed to flag it, how long JSONL retained evidence, and whether environment isolation would have limited blast radius. Document answers with links to pull requests so compliance teams can trace fixes.
FAQ
Does macOS sandbox profiles help? Only if you wrap MCP binaries—most teams rely on directory allowlists because upstream servers ship unsigned.
Can I mount remote NFS? Avoid for latency-sensitive agents; if unavoidable, treat mount roots as read-only and monitor TCP stalls.
What about case-insensitive APFS layouts? Duplicate paths differing only by case can confuse diff tooling—normalize before exposing to MCP.
How do we test symlink escapes? Create deliberate ln -s ../../etc/hosts inside scratch and assert MCP reports permission errors while JSONL records the attempt—repeat after every Node.js minor upgrade because module resolution can change realpath behaviour.
Why ProxyMac Mac mini still fits a tightly scoped MCP posture
Single-tenant Mac mini M4 hosts give deterministic paths—no neighbour containers quietly bind-mounting your /srv tree—while Apple Silicon keeps throughput predictable when agents bulk-read frameworks across HK / JP / KR / SG / US. Compare footprints via the pricing page, operationalise remote workflows through the help center, and keep VNC guidance handy when you must visually verify chmod drift someone promised “was only temporary.”
Scope MCP roots like prod IAM
OpenClaw · Apple Silicon M4 · HK / JP / KR / SG / US