Safeguard
AI Security•

How do you review large AI-generated changes for security?

DORA links AI adoption to higher delivery instability and says small batches counter it. How to review big AI-generated diffs without rubber-stamping.

Safeguard Security Team
3 min read

Do not review a large AI-generated change as one block. Ask for it to be split into small, independently deployable pieces, run automated checks on each, and spend human attention on the parts that touch authentication, data and dependencies. DORA's research points to small batches as the countermeasure.

What DORA says

DORA's small batches page says AI adoption often leads to increased software delivery instability, and that working in small batches acts as a critical countermeasure so that faster generation turns into value rather than chaos. It also says AI is good at generating large blocks of code quickly, but large changes are difficult to review, test and integrate safely. It recommends focusing the developer on decomposition and verification rather than raw generation.

For security, the risk is that a big diff gets approved because it looks plausible.

A review plan

  1. Split first. If a pull request is large, send it back with a request to split it by behavior. A good split lets each part deploy alone.
  2. Run machine checks before human review. Dependency checks, static analysis and tests should be green before anyone reads the diff.
  3. List new dependencies. AI tools sometimes add packages. Check each new one: does it exist, is it maintained, is it the one intended?
  4. Read the risky paths. Identify files touching login, permissions, payments, data export, file handling and external calls, and review those line by line.
  5. Check the tests. Generated tests may only assert what the generated code does. Ask whether any test would fail if the security behavior were removed.
  6. Look for removed checks. Compare what validation or authorization existed before.

What to look for

PatternWhy it matters
New package you did not requestSupply chain risk
Broad exception handling that swallows errorsHides failed security checks
Disabled certificate or signature checksOften added to make tests pass
Hardcoded test credentialsMay reach production
Wider permissions than neededCommon shortcut

Set a size policy

Pick a pull request size above which human reviewers may decline to review until it is split. Make the rule team-wide, so nobody feels they are being difficult. Track median size and the share of oversize pull requests.

What to measure

DORA's metrics help here. Watch change fail rate and deployment rework rate after AI use rises. If instability climbs, batches are probably getting bigger. See our related post on DORA metrics for teams using AI assistants.

Quick check

Is AI generated code less secure by default?

This post does not claim that. The point is that large changes are harder to review, whoever writes them.

Can an AI tool review its own output?

It can help find issues, but it should not be the only reviewer. Keep a human on security-sensitive paths.

Try it yourself

Click through it at your own pace, or open it full screen.

See how code findings are reported with location and detail, the kind of automated pass to run before human review.

How Safeguard fits

Safeguard offers dependency scanning, policy gates and an MCP Guardrail for agent tool use, which help check what AI-assisted changes bring in. Try a free scan at gold.safeguard.sh/scan.

Sources

Last reviewed: 19 October 2026.

Never miss an update

Weekly insights on software supply chain security, delivered to your inbox.

Self-healing security runs on Safeguard.

Your first fix PR is minutes away.

No sales call required, even your agent can complete the purchase over MCP.