sprawl mount

Sandboxed Context

Configures allowed directory mounts for sandboxed MCP server access.

sprawl mount — Walkthrough Walkthrough

📌 1. The Target Problem

1. The Target Problem

"How do I stop my AI assistant from reading files outside my workspace while still granting it secure access to specific shared folders?"

AI agents run with full host filesystem permissions and can exfiltrate SSH keys or database secrets. Blocking filesystem access entirely prevents models from reading legitimate shared dependencies, APIs, or documentation templates on disk.


⚙️ 2. Usage & Options

sprawl mount <add|remove|list>

Options & Flags

  • add <path> --alias NAME: Mounts a path to the given alias prefix.
  • remove <alias>: Deregisters a path mount.
  • list: Displays all configured directory mounts.

🔍 3. How it Works (Under the Hood)

  1. Registers directory paths and keys under allowed_mounts in .agents/sprawl-config.json.
  2. Automatically synchronizes workspace boundary permissions into AGENTS.md and passes --mount <alias>=<path> arguments to sprawl-workspace-fs in mcp_config.json.
  3. Validates agent read/write/list queries at the MCP server level, enabling safe @<alias>/ access while blocking out-of-bounds traversal with JSON-RPC error codes.

🩺 4. Troubleshooting

  • Agent fails to find files in mount directory
  • Resolution: Ensure the agent is instructed to use the @<alias>/ path syntax (e.g. @shared-lib/utils.py) to access mounted files.

🔗 Related Resources & Tutorials