Which code changes are too risky to approve on autopilot?

  • A community for building, creating, and growing with AI.

    Welcome to AI Forums, a community for people using AI to build products, automate workflows, create content, and grow businesses. Discuss vibe coding, AI agents, Claude Code, Codex, automation, AI tools, product launches, marketing, and the latest developments in AI.

    Join the Community (it's FREE)!

SundayCoder

Starter account
Messages
4
I can imagine allowing an agent to auto-merge a typo fix or a small internal UI change. I can't imagine giving the same freedom to a database migration, account permissions, or billing logic.

If you were making a risk-based approval policy for an AI-heavy team, what changes would always require human sign-off? And what would you happily automate?
 
I’d define the boundary by blast radius and reversibility rather than file type. Auto-merge: docs, formatting, small internal UI changes behind flags, and patch-level dependency updates that pass the full test suite. Require human sign-off for schema migrations, auth/permissions, billing, secrets, CI/CD or infrastructure config, public API contracts, and anything that can delete or export production data. Also flag PRs that modify tests alongside the code they cover, or change lockfiles beyond patch updates. Keeping PRs small and using CODEOWNERS makes the manual list practical instead of a bottleneck.
 
I'd add infrastructure configuration to the red list, even though it rarely gets the attention that auth code does. Changing a cache setting, redirect, storage policy, or environment variable can take an otherwise healthy application offline. An agent doesn't necessarily see the production consequences of a tiny change.

For high-risk edits I'd want a proposal first, the exact files being touched, a rollback plan, and a person approving the final diff. Low-risk copy and docs can move faster. You still want guardrails, but making every PR go through the same ceremony just teaches people to click through the ceremony without thinking.
 
File size isn't a reliable risk measure. A one-line change to a shared authorization helper could affect every customer, while a hundred lines of copy updates may be almost harmless. I'd classify changes by impact: can they leak data, lose data, charge money, interrupt a critical workflow, or be hard to reverse? Those questions give you a more useful auto-merge policy than a list of safe-looking directories.
 
Blast radius and reversibility is the right axis, and I would add one more: whether the change is verifiable before it is irreversible.

A migration that adds a nullable column and backfills in a second pass is reversible in practice. A migration that drops a column and rewrites the table in one step is not, even if the diff is three lines. The risk lives in the ordering, not the size.

My red list, roughly:

Anything that changes what data can leave the system. Permissions, tokens, exports, log payloads, third party destinations. An agent will add a debug log with a full request body and nobody reads 400 lines of logs.

Anything where the test is the thing being changed. If a PR edits the assertion and the implementation in the same commit, it needs a person. Not because agents are malicious, but because "make the test pass" is a valid local objective that produces a wrong global result.

Anything with a delayed failure mode. Cache TTLs, retry counts, pool sizes, cron schedules. These pass CI and fail three hours later under real concurrency, which is the one environment the agent never sees.

Safe to automate here: docs, copy, dependency patch bumps with a green suite, test-only additions, dead code the type checker proves, and small UI changes behind a flag.

One practice that made the manual list affordable: require the agent to state the rollback step and what it would observe to know the change went wrong. When it cannot fill that in, the change was not ready regardless of who approves it.Blast radius and reversibility is the right axis, and I would add one more that gets missed: whether the change is verifiable before it is irreversible.

A migration that only adds a nullable column and backfills in a second pass is reversible in practice. A migration that drops a column and rewrites a table in one step is not, even if the diff is three lines. The risk lives in the ordering, not the size.

My red list, roughly:

Anything that changes what data can leave the system. Permissions, tokens, exports, logging payloads, third party destinations. An agent will happily add a debug log with a full request body and a reviewer will not read 400 lines of logs.

Anything where the tests are the thing being changed. If a PR edits the assertion and the implementation in the same commit, it needs a person. Not because agents are malicious, but because "make the test pass" is a valid local objective that produces a wrong global result.

Anything with a delayed failure mode. Cache TTLs, retry counts, connection pool sizes, cron schedules. These pass CI and fail three hours later under real concurrency, which is the one environment the agent never sees.

Safe to automate here: docs, copy, dependency patch bumps with a green suite, test-only additions, dead code removal that the type checker proves, and small UI changes that sit behind a flag.

One practice that made the manual list affordable: require the agent to state, in the PR body, the rollback step and what it would observe to know the change went wrong. When it cannot fill that in, the change was not ready regardless of who approves it.
 
Back
Top