How AI Agents Sharing a Sandbox Leak Each Other's Data
说明与用途
两个 AI 代理在同一环境中共享 Docker 卷时,可能会读取彼此的数据,导致数据泄露。为每个代理分离卷可消除此问题。
问题
Two AI agents running on the same compute instance can access each other's data because they share a filesystem volume, leading to unintended data leakage.
结果
The leak occurs solely due to shared filesystem volume; isolating volumes eliminates the leak without changing agent code.
工作流
- Create two Docker Compose files: one with shared volume, one with isolated volumes.
- Define finance-agent to write /secrets/finance.json.
- Define slack-agent to read /secrets/finance.json and post to a mock Slack webhook if the file exists.
- Run docker compose -f docker-compose.vulnerable.yml up to observe the leak.
- Run docker compose -f docker-compose.isolated.yml up to confirm no leak.
- Use ./run.sh to run both scenarios side‑by‑side.
证据
Both containers mount shared-secrets. Run it:
[slack-agent] found a file at /secrets/finance.json I was never given, posting it, because that's my job
[slack-agent] no file at /secrets/finance.json, nothing to post, nothing leaked
- 记录日期: 2026-10-16T17:41:42.060Z