Research · 28th April, 2026
Security: An Overview Of Scaling Codebases
A readable research note on where coding agents can create security risk, and how to keep their work reviewable.
Read PDF
Why orchestration changes the risk model
A coding agent is not just a text generator. It can inspect files, edit code, run terminal commands, read errors, and carry assumptions from one step into the next. That is useful, but it also changes the risk model.
If an agent treats every file as equally safe, it can move too quickly through areas that deserve caution. Auth callbacks, payment verification, organization roles, database policies, secrets, migrations, and dependency changes all have a bigger blast radius than ordinary UI copy.
The risk is not that agents are always reckless. The risk is that they can sound confident while missing one important boundary. A payment button may look fixed while the server verification path is still wrong. A dashboard may show the right state while the database policy is too open.
So the first rule is simple: before the agent edits risky code, it should explain what it believes is true. Who is logged in? Who owns the row? Which endpoint verifies the payment? Which policy denies access? Those questions make the work safer.
The mistakes are usually small
Most security problems in agentic coding do not look dramatic. They look like small missing checks, broad queries, trusted client values, weak webhook handling, or a migration that assumes every user belongs to one organization.
Those mistakes are easy to miss because the diff can look clean. The UI works. The build passes. The copy is better. But the dangerous part may be in the server route, the database policy, or the way a user ID is trusted.
That is why narrow patches matter. When the diff is small, you can review it. When the agent rewrites too much, you spend your energy understanding the rewrite instead of checking the risk.
A good agent should protect your attention. It should avoid touching unrelated files, avoid inventing production secrets, and say exactly what it could not verify locally.
Use review boundaries before you need them
You can make agentic work safer by giving boundaries early. Say `do not change auth`, `inspect only`, `do not edit migrations`, or `explain the RLS assumption before patching`. These instructions are not micromanagement. They are guardrails.
The agent should also name risky files on its own. If a task touches an API route, a payment handler, an auth callback, or an organization membership table, Nap should make that visible before editing.
This creates a healthier workflow. Low-risk changes can move quickly. High-risk changes get a plan, a small patch, and a clear verification path.
The best outcome is not maximum autonomy. It is controlled acceleration. You still make the final decision, but the agent does the heavy lifting in a way you can understand.
Terminal commands should be evidence
Terminal access is powerful because it lets an agent run builds, tests, searches, and local checks. But commands should be treated as evidence, not theater.
A useful command answers a question. Did the app build? Did TypeScript pass? Did the failing test still fail? Did the migration command produce an error? The result should shape the final answer.
Destructive commands are different. Anything that resets work, rewrites history, applies schema changes, or touches deployment state should be explicit and controlled. A coding agent should not casually run risky commands just because it can.
When a command cannot be run, Nap should say so. A clear manual checklist is better than a fake sense of certainty.
What safer orchestration looks like
A safer flow is easy to describe: inspect, plan, patch, verify, summarize. Inspect the relevant files. Explain the intended change. Make the smallest useful patch. Run the strongest local check. Then summarize what changed and what still needs human attention.
This approach does not make the agent slow. It makes the agent trustworthy. You can still move quickly, but now the work arrives in a form that a careful developer can review.
That is the direction Nap is built around: not blind automation, not fear of automation, but useful automation that stays legible. The agent should help you ship faster without making your codebase harder to reason about.