Skip to content

Back to the catalog

endorlabs.comarticle

AI Code Review: How to Actually Review Code an Agent Wrote | Blog | Endor Labs

Endor Labs explainer on "AI code review" as a discipline: pairing LLM reasoning with static analysis (call graphs, data flow) to catch security-relevant PR changes that AI coding agents introduce, alongside human reviewers. It cites research showing common AI-generated flaws (missing input validation CWE-20/89/78, hardcoded secrets CWE-798, broken auth CWE-306/284, hallucinated/insecure dependencies), Endor's finding that under 9.5% of vulnerabilities are reachable/exploitable, and a comparison of AI review against SAST, SCA, and secrets scanning, plus a rollout checklist referencing NIST SP 800-218A.

TL;DR Endor Labs explainer on using AI + reachability analysis to review AI-generated PRs for CWE-mapped security flaws, positioned alongside SAST/SCA/secrets scanning.
Document

What it is

An Endor Labs explainer on reviewing AI-agent-generated code. Beyond the general premise the summary states, the concrete carry-over is a taxonomy of recurring flaws (with CWE IDs) and hard metrics quantifying how often AI code is insecure — the numbers a reader would want to justify adding a review step.

Common flaws to check for (with CWEs)

The page names five recurring flaw classes in AI-generated code:

  • Missing input validation — injection risks (CWE-20, CWE-89, CWE-78)
  • Hardcoded secrets — keys/passwords in source (CWE-798)
  • Broken authentication / access control — endpoints shipping without permission checks (CWE-306, CWE-284)
  • Hallucinated dependencies — packages that don't exist or are outdated
  • Design drift — structural changes with no obvious bug

The metrics (the reason to act)

  • Georgetown CSET tested five LLMs: ~half of code snippets contained security weaknesses.
  • Endor Labs' 2025 State of Dependency Management: only 1 in 5 AI-recommended dependency versions is safe; 34% of AI-recommended packages are hallucinated.
  • Veracode 2025 GenAI report: 45% of code samples failed security tests, introducing OWASP Top 10 vulnerabilities.
  • Faros AI telemetry: 31% more PRs merging without any review — the gap where risk enters.
  • Stack Overflow 2025 survey: 84% of respondents use or plan to use AI tools.

What to do

The page's operational suggestions, not commands:

  • Apply existing cybersecurity standards to model-written code — CSET's line is that "authorship does not change the standard."
  • Prioritize change-driven risk over CVE scanning: the riskiest issues are subtle edits (a change to who can access an endpoint) that vulnerability scanners don't flag, not renamed variables.
  • Review each change from three angles — developer (is it correct?), architect (blast radius / structural drift?), security (exploitable? impact?) — since single-pass pattern tools miss issues between these views.
  • Use reachability analysis to suppress false positives (findings that aren't actually exploitable) so reviewers keep reading results.

Caveats

This is a vendor post that concludes by pitching Endor Labs' own multi-agent review product; treat the framing as promotional. It states AI review complements rather than replaces human reviewers — a person still makes the final call. The fetched text is truncated mid-sentence in the reachability section, so that mechanism is only partially described.

Organisations named here

  • CWE-20
  • CWE-284
  • CWE-78
  • CWE-89
  • NIST SP 800-218A

Technologies named here

  • Endor Labs AI Code Review
  • GitHub
  • Endor Labs AI SAST
  • GitLab
  • SAST
  • Cursor
  • Claude Code
  • SCA
  • Secrets detection
  • Endor Labs
  • Veracode
  • Missing Authentication for Critical Functionality
  • OWASP Top 10 for LLM Applications

Techniques named here

  • AI code review
  • Static analysis / call graph construction
  • Reachability analysis
  • Multi-perspective review reasoning
  • Common flaws in AI-generated code
  • Use of Hard-coded Credentials