What a security review of an AI-built app covers
A security review of AI-generated code: ten checks in order, the report you should get, what it cannot tell you, and how it differs from a penetration test.
Asghar Ali · Chief Technology Officer, Kakushin.io LTD
A security review of an app built largely with AI assistants is a source-led check of the whole codebase against a published standard, run in a fixed order: map the app, then secrets, authentication, authorisation, input handling, dependencies, configuration, the AI features, logging, and finally the build loop that produced the code. The deliverable is not a list of scary findings. It is a report that states the scope and the standard level it was measured against, shows every check with pass, fail or not applicable, gives each failure a location and a fix, and ends with a fix list in your tracker and a retest.
This is for the founder who needs one before launch, and for the buyer or customer who asks for one before signing. It covers what to hand the reviewer, the ten checks and why they run in that order, what the report must contain, what it cannot tell you, and how it differs from a penetration test. The holes themselves are in the security risks nobody checks in vibe-coded apps; this is the engagement around them.
What is a security review of an AI-built app?
It is what the OWASP Secure Code Review Cheat Sheet calls a baseline review: one that examines "the entire codebase comprehensively", as opposed to a diff-based review of one pull request. NIST's Secure Software Development Framework, SP 800-218 (version 1.1, February 2022; a version 1.2 draft from 17 December 2025 is still a draft as of 20 November 2026), separates the two halves in practice PW.7: code review, where "a person looks directly at the code", and code analysis, where tools do some of the looking.
The yardstick should be the OWASP Application Security Verification Standard (ASVS 5.0.0, published 30 May 2025, the latest stable release as of 20 November 2026). It gives every check an identifier, so a finding reads "v5.0.0-8.2.2" rather than "auth looks weak", and you can hand the same list to the next reviewer.
Why AI-built apps need one at all: generated code passes functional tests and still fails security ones. In Veracode's October 2026 edition of its GenAI code security study (published 29 October 2026), 18 models were tested in four languages, and 38% of their coding tasks still produced vulnerable code. Check the sample before you quote it: four weakness types only (SQL injection, weak cryptography, cross-site scripting and log injection), a fixed set of benchmark tasks rather than real apps, and nothing about authorisation. A whole-app review looks hardest at exactly what that study cannot measure.
For the general shape of an audit engagement (access, finding format, severity scale, choosing a provider), see what a source code audit covers. What follows is what changes when a model wrote most of the code.
What do you need to give the reviewer?
- Read-only access to every repository, including infrastructure and mobile, at a fixed commit.
- A staging copy with test data, and two test accounts per role in two different organisations or tenants.
- The AI tooling files: rules and instruction files such as
CLAUDE.md,AGENTS.mdor.cursorrules, and the agent's permission settings. - The names of environment variables, never their values, plus a list of every outside service the app calls.
- The questions the review must answer, for example "can we sell to a clinic group?" or "is it safe to take card payments?".
You should not need to share production credentials or customer data. If a reviewer asks for them, ask why.
Which ten checks does the review run, and in what order?
| # | Check | What gets read | ASVS 5.0 chapter |
|---|---|---|---|
| 1 | Map the app | Entry points, trust boundaries, every outside service, which parts the AI wrote | Scoping, V15 |
| 2 | Secrets | Git history, the built client bundle, mobile binaries, CI logs | V13 |
| 3 | Authentication | Sign-in, reset, sessions, admin sign-in, the auth provider's settings | V6, V7 |
| 4 | Authorisation | Every route that takes an ID, every admin function, where the check lives | V8 |
| 5 | Input and data flow | Sources to sinks: queries, file paths, HTML output, outbound URLs | V1, V2, V5 |
| 6 | Dependencies | Does each package exist, how old it is, known vulnerabilities, lockfiles, runtimes | V15 |
| 7 | Configuration | Debug modes, database and storage access rules, CORS, headers, exposed docs | V13, V3 |
| 8 | AI features | Prompt injection, tool permissions, data leakage, spend limits | OWASP LLM Top 10 |
| 9 | Logging and errors | What is logged, what never should be, error messages, admin audit trail | V16 |
| 10 | The build loop | Rules files, agent permissions, CI secrets, tests the agent wrote, who approves merges | OWASP AI coding guidance |
Why this order. Mapping comes first because a route nobody listed is a route nobody checks. Secrets come next because a leaked key needs no login at all: it is rotated the same day and moved behind the server. On the customer apps of a European national electricity utility I introduced a relay proxy that removed every client API key from the shipped binaries. Authorisation sits at four because that is where the serious findings tend to be: in the OWASP Top 10:2025, "100% of the applications tested were found to have some form of broken access control" (read on 20 November 2026). The method is in BOLA and IDOR testing with two accounts.
What is different for AI-built code. Three checks carry more weight than they would in a hand-written app. In check 6, OWASP's Secure Coding with AI Cheat Sheet warns that assistants "frequently suggest package names that do not exist on public registries", so every dependency is checked for existence and age, not only for known vulnerabilities; old runtimes are part of the same check, and the PHP2Shell checker shows the kind of version question involved. In check 8, the product's own AI features get the tests in the OWASP Top 10 for LLM applications. And check 10 reads the files that steer the agent: the same cheat sheet treats rules files as persistent instructions and asks you to review changes to them like changes to CI.
The tests matter too. The cheat sheet's warning is blunt: "A passing test suite generated by the same agent that produced the code provides no independent assurance." So the review reads the tests for deleted cases, weakened assertions and mocks of the very thing under test.
What should the report contain?
ASVS draws the line clearly. Traditional penetration test reports list issues "by exception", only the failures; an ASVS verification report should include "scope, a summary of all requirements checked, the requirements where exceptions were noted, and guidance on resolving issues". That is the difference between "we found six things" and "we checked these 70 things, six failed, nine do not apply".
- Scope: repositories, the commit hash, environments, the ASVS level targeted, and which chapters were left out and why (no GraphQL, no WebRTC).
- Method: what was read by hand, which tools ran, which accounts were used on which environment, and the time spent.
- Coverage: every check with pass, fail or not applicable.
- Findings: each with its ASVS identifier, location, evidence, impact, fix and effort. The format and severity scale are in the code audit essay.
- A fix list in your tracker, not only in a PDF. SSDF task PW.7.2 asks teams to record and triage every issue "in the development team's workflow or issue tracking system".
- A regression test per finding. SSDF PW.8.2 suggests adding tests for previously reported vulnerabilities so "errors are not reintroduced".
- AI-specific notes: rules files to change, packages to remove, tests to rewrite by hand.
- The retest: which findings were confirmed fixed, on which commit.
Driving third-party penetration-test remediation that gated production acceptance on that utility's customer apps taught me where reports go wrong: a finding counts as closed when the retest says so, not when a developer does.
How is it different from a penetration test?
| Security review (source-led) | Penetration test | |
|---|---|---|
| Looks at | Source, configuration, build, and staging with test accounts | The running system, mostly from outside |
| Best at | Missing checks, business logic, secrets, dependencies, the build loop | Deployment, configuration and chained issues in the real environment |
| Misses | Production settings it was not shown | Code paths it cannot reach; flaws that look normal from outside |
| Report | Every check, pass, fail or not applicable | Usually by exception: failures only |
| When | Before launch or a sale, after a large AI-written change, before a pen test | High-risk systems, or when a customer or contract asks for one |
They are not rivals. ASVS says it is "strongly encouraged to perform documentation or source code-led (hybrid) penetration testing" rather than testing blind, and SSDF lists penetration testing as an option for high-risk scenarios "if resources are available". The usual order is review, fix, then test.
A worked example (illustrative)
An invented case, not a client: a booking app for clinics, built by two founders mostly with an AI coding agent. A clinic group asks for a review before signing. Scope: ASVS Level 1 in full, plus Level 2 for authorisation (V8) and configuration (V13); WebRTC and GraphQL marked not applicable; the mobile app left for a second phase.
Check 2 finds a database key with full rights in the client bundle. Check 4 finds a bookings route that trusts the clinic ID in the query string. Check 6 finds two packages nothing imports, added by the agent. Check 8 finds that the reminder assistant can message any phone number. Check 10 finds a rules file that tells the agent to skip failing tests, and three tests that assert nothing.
The report shows each check with its result, five findings with fixes, and a fix list of tickets with a regression test each. The retest two weeks later confirms four fixed and one accepted as a known risk with a date, which is the version the clinic group reads.
What this cannot tell you
- It is not a certificate. OWASP "does not certify any vendors, verifiers, or software". A review report is evidence for a buyer, not a trust mark.
- It describes one commit. The next agent session can undo a fix. Diff-based review on every pull request keeps it.
- It sees only what you show it. Production settings, cloud accounts and third-party services are out unless they are in scope.
- It does not prove absence. It lowers risk on the paths it read.
- It does not cover people. Phishing, laptops and who holds admin on the cloud account are a separate engagement.
Frequently asked questions
Can an AI tool review AI-generated code?
As a first pass, yes, the same way a static analyser is a first pass. ASVS warns that automated tools cannot fully verify requirements about "business logic and access control". A person still has to confirm each finding and look for what is missing.
Which ASVS level should I ask for?
ASVS 5.0 says most applications should aim for Level 2, and gives the example of an early-stage startup with limited sensitive data starting at Level 1. If you handle health, money or other people's data, say Level 2 for authorisation and data protection at least, and write the level into the contract.
Do I still need a penetration test?
Often, yes: a customer, insurer or contract may require one, and it tests the real deployment. Do the review first. It finds the logic flaws a tester might miss and makes the test cheaper, because the obvious findings are already fixed.
How often should the review be repeated?
Run a baseline review before launch and after any large AI-written change, and a diff-based review on every pull request in between. Re-run the regression tests on every release.
If you want this checked
I review web, mobile and AI-built apps in this order: the map, secrets, two-account authorisation tests, dependencies, the AI features and the build loop, against the ASVS level we agree up front. You get a coverage report, a written fix list with regression tests, and a retest. The scope is on my hire page.