Running Local AI Coding Agents: How to Sandbox Against Prompt Injections and Accidents

aj_kt · reddit · 2026-08-13

Running AI agents with direct file system and shell access locally raises significant security concerns. The author notes that without restrictions, agents are just one malicious prompt injection or accident away from leaking or deleting sensitive files.

To isolate risks, the author experimented with sandboxing: using Docker Sandbox on Windows and Claude Code's built-in Seatbelt-based sandbox on Mac. However, they found that sandbox constraints frequently break tool integrations, Git workflows, and package installations, making troubleshooting a nightmare. Eventually, the author resorted to running Claude mostly un-sandboxed for friction reduction, which feels incredibly unsafe for unmonitored workflows.

The author asks the community whether strict physical or system-level isolation is necessary for local agents and how to balance security with development efficiency.

Related event: Docker Sandboxes Reshape Permission Models for AI Coding Agents(3 posts)→

Original post →

More from coding & agent

coding & agent channel →