Prompt rules are not a security boundary for background coding agents
An interactive coding assistant can pause before every shell command and wait for you to inspect it. A background coding agent working through an issue backlog cannot. To diagnose a real bug or repair a failing build, a background agent has to ingest text written outside your repository: issue desc

Posted on Dec 3 • Originally published at mergehand.com
An interactive coding assistant can pause before every shell command and wait for you to inspect it. A background coding agent working through an issue backlog cannot.
To diagnose a real bug or repair a failing build, a background agent has to ingest text written outside your repository: issue descriptions, pull request comments, bug-reporter attachments, test fixtures, dependency output, and failed CI logs.
Once a model reads untrusted text while holding shell and file tools, prompt instructions alone stop being a security boundary.
To a language model, external input arrives as plain text in the same context window as its system instructions. A pasted stack trace, a comment from an external reporter, or a string embedded in a test fixture can contain misleading or adversarial instructions that push the agent toward running an unintended command, reading environment variables, or calling an external endpoint.
Writing "do not push" or "do not call external APIs" in a system prompt is good developer hygiene — it keeps normal runs predictable and reduces accidental mistakes. It is not an enforcement boundary.
A real security boundary lives outside the model's context window and still holds if the process ignores its instructions completely.
When running background coding agents on your own machine or dedicated virtual machine, practical defense-in-depth comes down to four architectural controls:
Before trusting any background agent workflow on a production repository, four questions tell you almost everything:
Prompts describe how a careful developer should behave. Containers, network limits, read-only tokens, and agent-free pushes enforce what the process can actually do.
How is your team isolating background coding agents from write credentials and untrusted ticket/CI input today?
Originally published on the Mergehand blog.