The Problems That Keep Coming Back

You have probably hit at least one of these. An AI agent that deleted a config file while cleaning up. One that overwrote the wrong version of something. One that got stuck in a loop doing the same thing repeatedly because it thought it had not succeeded yet.

These are not model problems. They are architecture problems. The model is doing exactly what it was asked to do , broadly. The issue is that "broadly" is doing too much work.


The Permission Layer That Fixes Everything

After months of debugging agent failures, one developer found the setup that stopped all of them. It is not a new framework. It is a simple set of rules applied consistently.

Read access: everything the agent needs to see. Codebases, configs, documentation, prior outputs. No restrictions on reading. Reading is free.

Write access: one output folder only. The agent writes to a designated directory. Not the project root. Not the source tree. One folder. Anything outside that folder is read-only until explicitly unlocked for a specific task.

Destructive operations require confirmation. Anything that cannot be undone , deletes, overwrites of source files, external API calls that have side effects , requires a human confirmation step before executing. The agent stops, describes what it is about to do, and waits.

All actions are logged. Every file read, every write, every API call goes into a log file the human can review. Not for debugging after something goes wrong , as a live record of what the agent is doing, available at any point.


Why This Stops the Loops

Most agent loops happen because the agent cannot tell whether its previous action succeeded. It tries again. Same result. Tries again.

When writes are scoped to an output folder, the agent has a clean verification path: did the file appear in the output folder? Yes or no. No ambiguity about whether it wrote to the right place. The loop condition disappears.

The confirmation step for destructive operations adds a second benefit beyond safety: it forces the agent to articulate what it is doing before doing it. That articulation catches a significant percentage of misunderstood instructions before they execute.


What to Build First

If you are starting from scratch, build the output folder convention before you build anything else. Make it a rule you do not break: every agent you deploy writes to one place, and that place is not your source tree.

Add logging on the second day. Add the confirmation step for destructive operations on the third. By day four you have a permission architecture that has absorbed most of the failure modes without adding significant friction to the happy path.

11,902 people have been hitting this wall. The wall is not the model. The model is fine. The wall is the assumption that an agent with broad access will use that access carefully.

It will not. Build the fence first.