← Back to library

Sandboxed agents share files through a broker

prescriptivist runs many sandboxed Claude Code agents that pass files to each other without ever holding cloud credentials or knowing where the files live. Each agent sees an invented file system with its own address prefix, reachable only through MCP tools, while an outer orchestrator performs the real reads and writes in cloud storage and logs each request.

  • OutcomeGive a fleet of sandboxed agents MCP tools for a virtual file store, so an outer orchestrator handles real storage and keys stay hidden.
  • SetupAn afternoon+
  • LevelAdvanced
  • Creditprescriptivist on Hacker News
View original
Works with
Claude Code

Published Oct 23, 2026Updated Oct 23, 2026AI dry run on sample input: passed Oct 23, 2026Source verified Oct 23, 2026

When should you use it?

  • Several agents need to share files
  • You do not want keys inside agent sandboxes
  • You need an audit trail

Not for: A single agent on your laptop; Teams without an orchestrator

What do you need, and what do you get?

You need

  • Sandboxed agent instances
  • Storage behind an orchestrator
  • MCP calls to browse, send and fetch files

You get

  • Shared files without exposed keys
  • Request logs
  • Compartmentalized agents

How does it work, step by step?

  1. Hide the storageKeep real storage keys only in the orchestrator.
  2. Define a virtual pathGive files a custom address scheme the agents use.
  3. Expose toolsOffer list, upload and download tools through MCP.
  4. Broker requestsLet the orchestrator perform the real file actions.
  5. Log everythingKeep request logs to audit what each agent did.

The prompt

Our own prompt, inspired by prescriptivist on Hacker News and written to work in Claude Code. Values in lime are placeholders.

Fill in the blanks (optional; the copied prompt uses your values)

Prompt2 variables
Design an MCP file broker for my agents. Storage: {storage}. Agents: {agents}.
Define a virtual address scheme, tools for list, upload and download, which agents may access which folders, size limits, and the log fields for each request. Keys must never be passed to agents.

Inspired by prescriptivist on Hacker News: Comment in MCP was always a bad idea?. The prompt above is written by playbooks.bot in our own words; nothing from the original is quoted.

What can go wrong?

  • The broker becomes a single point of failure; monitor it.
  • Limit which agents can see which files.
  • Watch for large uploads that drive cost.

Our take

prescriptivist's design answers a question every multi-agent builder hits: how do isolated agents collaborate without each one holding keys to the shared storage? The answer is to give them none. Agents ask for files by a made-up path, and an orchestrator outside the sandbox decides whether to fetch, write or refuse. Credentials stay in one place, and an agent that is tricked by a malicious document has nothing to leak. The broker brings a second benefit almost for free: every file request passes through it, so you get an audit trail that answers what an agent touched and when. The author notes the models adapt well to a strange file system, which matches what we would expect, since tools with clear descriptions are easy to use. If you copy this, keep the tool set small, with read, write and list only, add per-agent allowed paths in the broker, and reject anything outside them. Shell access is the opposite of this approach, so drop it from agents that only need files.

Where the time goes back: Agents collaborate on files while secrets stay out of every sandbox.

FAQ

Do agents cope with odd paths?
The developer says the model adapts well to the custom file system.
Why MCP?
It gives a controlled tool surface instead of open shell access to storage.

Source and credit

Inspired by prescriptivist on Hacker News. We describe the idea in our own words, link to the original, and wrote the prompt ourselves; nothing is quoted.

Inspired by
Comment in MCP was always a bad idea?
Creator
prescriptivist on Hacker News
Published on
Hacker News
Original date
Sep 21, 2026
License
Not openly licensed (the poster keeps all rights), so we quote nothing and link to the original
Originally for
Claude Code
AI dry run
Oct 23, 2026: passed. Dry-run tested by our AI test agent on sample input. PASS: Gates held on desk check; no live sends, bookings or purchases.
AI dry run on sample data; not run with live connected accounts. The playbooks.bot test agent filled the prompt with synthetic inputs, produced the output and checked it against the page's stated outputs and guardrails.
Verified
Oct 23, 2026: source link resolves to the original, the credited creator published it, our excerpt or prompt matches it, and the license allows our use.

Are you the creator? Claim or correct this page.

More in IT & Security

All 82 IT & Security playbooks →

Related playbooks

IT & SecurityWorkflow✓ AI dry run

Compare an agent run with a task you did by hand

Before you believe big productivity claims, time and cost one routine agent task against a similar one you did yourself, counting review and cleanup.

Credit: Chris_Newton on Hacker News

Under an hour
IT & SecuritySkill✓ AI dry run

Find repeat fixes and good habits in your team's PRs

Have Claude Code look across a chosen window of commits and pull request review comments for the same fix or review note coming up again and again, suggest turning the top ones into a project rule or skill you write in your own words, and list good practices already in the repo that other teams could copy.

Credit: anthropics

Under an hour
IT & SecurityPrompt✓ AI dry run

Recheck intent by rereading your own messages

On long projects, ask the agent to go back over every message you wrote, restate what you wanted, then measure the work against that.

Credit: visarga on Hacker News

Minutes
IT & SecurityWorkflow✓ AI dry run

Route agent decisions by how hard they are to undo

Use a read-only judge agent that lets AI settle easy-to-reverse choices and sends hard-to-reverse ones to you, with every claim labeled confirmed, guessed or unknown.

Credit: u/No_Ant6261 on r/ClaudeCode

Under an hour