When Not to Use It
The loop of this book has a fixed cost and a condition. The cost is writing the task, reading the diff and running the tests, every time. The condition is that someone must be able to judge the result. Where the cost is larger than the work, or the condition fails, the loop is the wrong tool, however good the agent is.
Chapter 5 made that call for a single change. This page makes it for whole areas of a codebase and for situations a team meets again and again, which is where Cragmoor's month of numbers from the previous topics ends: with a written list of where the agent is the default, and where it is not.
Code You Cannot Review
If nobody on the team can judge whether a piece of code is correct, generating it moves the risk to the one place nobody checks. Review is the condition of the whole loop, and for this code the condition is simply not available. Cryptography, authentication flows and signature verification are the usual cases, because their mistakes are invisible in normal operation: wrong code and right code both pass the happy-path test.
At Cragmoor the case is the webhook that tells the booking service a payment succeeded. Its signature check uses the payment provider's own library, called exactly as the provider documents, and every change to it is reviewed by the one engineer who has read that library. No generated code goes into it. Chapter 12 showed why: the agent reproduces the patterns of public code, including the ones that skip verification.
Code You Must Understand Deeply
Some code the team must be able to trace at three in the morning: the code you are on call for, and the code that encodes the business. After the month of counting, Cragmoor moved the offer and hold logic in waitlist, the code behind the double offer of Chapter 10, into this category. People write it. The agent reviews it, suggests tests, and explains unfamiliar corners, but it is not the author.
The cost is some speed in one module, and the month's numbers put a size on it: that module was the one place where the agent had made the team slower anyway. The return is a team that understands the code that wakes it up. That is a trade worth making deliberately, in a small number of places, and writing down.
Writing it down happens in three places, because three different readers need it. The team policy of Chapter 13 gets a line naming the module, for people. The project instructions file tells the agent that in this module it proposes tests and review comments and does not edit. And the permission settings deny the agent's edits under that directory, because an instruction is read and a denial is enforced, as Chapter 3 put it.
Problems Smaller Than the Prompt
When a change is faster to type than to describe, the loop's fixed cost is the whole cost. A one-line fix whose location you already know. A rename the editor's own refactoring tools do exactly and instantly, which is how Chapter 11 handled renames. A configuration value. Writing the task, waiting for the diff and reading it takes longer than the change, and adds a step where something can go wrong.
The test is simple and worth applying honestly: if writing the task properly would take longer than making the change, make the change. At Cragmoor a properly written task takes about ten minutes, and reading the resulting diff another two or three. A one-line change to a value whose location you know takes under a minute by hand, and nothing about it gets better for passing through the loop. The smaller the task, the more of its total cost is the overhead of the loop.
When the Loop Cannot Close
The loop closes when the agent can run something and observe the result, as Chapter 3 required. Some work offers nothing to observe. A module with no tests and no quick way to write them. Behaviour that only appears in production, under load or with real traffic. A system the agent cannot run at all from where it sits. An agent without feedback is guessing, fluently and confidently, and its guesses look exactly like answers.
Do the groundwork first. For untested code, pin its behaviour with tests as Chapter 11 did for pricing. For production-only behaviour, build a local reproduction. If neither is possible, the change is made by hand by someone who can observe the system, and the agent's role is to help read the code around it.
When the Data Cannot Go
Sometimes the question is not the tool but the context. The team policy of Chapter 13 says no to code a client owns under a contract that forbids sending it to a provider, to incident work that needs production data, and to anything containing real members' personal data. No setting on the agent changes that, because the problem happens when the data enters the session, before any setting applies.
For incidents this matters most, because pressure pushes people towards pasting what they have. Cragmoor's rule is to work the first hour of an incident without the agent and with real data, then bring the agent in with synthetic data once the shape of the problem is known.
When You Are Learning
The first feature in a new language, library or domain is where the skills of the previous topic are built. Using the agent as an author there gets the feature done and skips the learning, which is the result the January 2026 study measured. Use it as a tutor instead: ask for explanations, ask it to quiz you, ask it to review your version.
This boundary is temporary by design. Once you can judge the code in that library, the ordinary loop applies again, and the agent goes back to being an author whose work you can check.
Cragmoor's list, after the month of counting, is short. The agent is the default for tests, fixtures, small fixes with a known location, mechanical changes and first drafts of features outside waitlist. It is a reviewer, not an author, for the offer and hold logic and for the payment signature check. It is not used at all for the first hour of an incident, for client code under the one contract that forbids it, or for a change faster to type than to describe. The list has a review date, like the rest of the policy, because the month's numbers will move.
- "Using it everywhere is how you get good at it." Getting good at it includes knowing where its fixed cost and its review condition fail. A team that uses it everywhere is not calibrated, just busy.
- "Not using it somewhere is falling behind." The 2025 and 2026 evidence shows no automatic gain for experts in code they know deeply. The boundary is a measured choice, not a refusal.
- "The agent knows the standard patterns, so security code is a good fit." It reproduces the patterns of public code, including the insecure ones, and security code is where an unreviewed mistake costs the most.
- "Small tasks are where it is most efficient." Small tasks are where its fixed overhead is largest relative to the work.
- "If I review carefully, anything is safe to generate." Careful review requires being able to judge the code. For code nobody on the team can judge, care is not available.
- Mark the areas where the agent is a reviewer, not an author, in the team policy. The boundary is a team decision, not a mood.
- Use established libraries and an expert reviewer for cryptography, authentication and signature checks. Generated security code is the costliest kind of unreviewed code.
- Make a change by hand when describing it takes longer than doing it. The loop's fixed cost is real.
- Build tests or a reproduction before using the agent where it cannot observe its result. An agent without feedback is guessing.
Knowledge Check
A team wants the agent to write a new token-signing routine. Nobody on the team has implemented signing before. Which condition of the loop fails?
- Cost: the change is too small to be worth describing to the agent
- Reviewability: nobody on the team can judge whether it is correct
- Feedback: the agent has no way at all to run code that signs tokens
- Data: signing keys are personal data that may never enter a session
What is the main risk of generating code in an area nobody on the team can review?
- It costs more tokens, because the agent needs more rounds to finish
- The agent will refuse the task, because it detects the missing expertise
- Its mistakes go unnoticed, because the only check left is production
- The generated code is more likely to carry someone else's licence
Kai asks the agent to change a failing feature that only misbehaves under production load. The repository has no load test. What should he expect?
- A correct fix, since the agent can infer load behaviour from reading code
- A plausible fix that is a guess, since it cannot observe the failure
- A refusal, since agents will not change code they cannot run themselves
- A new load test written and run automatically before the agent edits
How does this page's decision differ from the one Chapter 5 made about writing a change yourself?
- Chapter 5 judged cost, while this page judges only security risk
- This page reverses Chapter 5 and recommends the agent everywhere
- Chapter 5 left the call to the agent, while this page leaves it to people
- Chapter 5 decided one change; this page decides whole areas and situations
Which situation is best handled by making the change by hand?
- A new feature with clear acceptance examples and a fast test suite
- Characterization tests for a module that has none, reviewed by sample
- A one-line change to a value whose location and new value you already know
- Handlers for four new endpoints that follow a pattern already in the code
You got correct