Control · C-038 · Security & Resilience
Review of AI-generated code
Code produced with an AI assistant passes the same human review, security scanning and dependency checks as any other code before it is merged.
- Control type
- Detective
- Family
- Risks addressed
- 4
- Audience
- Heads-of · Practitioner
- Frameworks
- Principle 9 · AML.M0016 · LLM10
- Responsible AI domain
- Lifecycle stage
- Reviewed
- 2026-11-10
What it does
It holds generated code to the standard of written code and makes sure the volume an assistant produces does not outrun the checks. It also protects the review step itself, which is the control most at risk when output rises faster than the number of reviewers. The head of engineering is accountable; reviewers and automated pipeline checks apply it to every change before merge.
How to implement it
- State in policy that the author of a change is responsible for all of it, whatever produced it.
- Require human review of every change, sized so that review is meaningful.
- Run static analysis, secret scanning and dependency scanning in the pipeline.
- Allow new dependencies only from an approved list or after review, and verify that each exists and is the intended package.
- Check generated code for licence obligations.
- Monitor review time and defect rates as assistant use grows.
Evidence it operates
Design: an engineering policy on assistant use and the pipeline configuration enforcing the checks. Operation: merge records showing a reviewer and passing scans for each change; dependency approval records; trend data on security findings.
Where it fits
Operates in the delivery pipeline at each merge. It is the primary control for insecure AI-generated code.
Limits
Reviewers tire and skim, more so when code arrives quickly and looks competent. Scanners find known patterns and miss flaws of logic. The control depends on review capacity keeping pace with output. Using a second AI tool to review generated code can help find defects and does not replace an accountable human reviewer.
Risks this mitigates
Primary mappings
- Insecure AI-generated code High
- Puts generated code through the same review, scanning and dependency checks as any other code. Code suggested by an AI assistant is accepted with vulnerabilities, invented dependencies or licence problems that review would have caught in code a person wrote.
Supporting mappings
- Improper output handling High
- Catches unsafe output handling in the integrating code. Output from a model is passed to an interpreter, a renderer or another system without validation, so that content the model was induced to produce is executed or acted on.
- Infringing AI outputs High
- Checks generated code for copied or licence-encumbered material. Generated text, code or images reproduce protected material, and the organisation publishes, sells or ships them.
- Unexpected code execution by agents Critical
- Reviews generated code that will persist. An agent generates and runs code or commands that were never reviewed, allowing injected instructions or model error to execute on the host or in connected systems.
Framework and clause references
| Framework | Clause | Title |
|---|---|---|
| Code of Practice for the Cyber Security of AI | Principle 9 | Conduct appropriate testing and evaluation Testing and evaluation. |
| MITRE ATLAS | AML.M0016 | Vulnerability Scanning Vulnerability scanning. |
| OWASP Top 10 for LLM Applications | LLM10 | Improper Output Handling Output handling. |
Related terms
How to cite
Axiom Verity (2026). Review of AI-generated code. Reference Library, C-038. https://axiom-verity.com/controls/review-of-ai-generated-code. Reviewed 2026-11-10.
Found an error or a better source? Report a correction.