OWASP, NIST, and Human Approval for AI-Generated Code

A practical approach to auditing AI-generated code across security, business logic, and agile delivery using OWASP and NIST frameworks.

Aycan Altınöz · 2026-10-27 · Updated: 2026-10-27

Bringing OWASP and NIST Standards into the Agile Process

Auditing AI-generated code does not require inventing rules from scratch. OWASP provides a strong foundation for security, while NIST frameworks support governance and risk management. Our task is to place these frameworks into the team’s sprint rhythm, Definition of Done, and CI/CD pipeline.

OWASP Top 10 for LLM Applications (2026)

OWASP lists the ten most critical security risks for applications that include large language models. Because coding assistants and coding agents are LLM applications, these risks directly affect software teams. The most common examples in AI-assisted development include:

OWASP riskHow it appears in a software teamProcess control
LLM10 — Mishandling of outputsGenerated code or commands enter a shell, query, or template without validationStatic analysis and parameterized-query rule in the DoD
LLM04 — Supply chainA package suggested by the assistant does not exist or comes from an untrusted sourceSCA and approval step for new dependencies
LLM02 — Sensitive information disclosureAn API key or customer data enters a prompt or codeSecret scanning and data-use policy
LLM03 — Excessive agencyA coding agent has unnecessary access to the repository, pipeline, or productionLeast privilege and human approval for irreversible actions
LLM07 — Systemic misinformationAn agent reports a nonexistent defect or produces code that only appears to workVerification before action and mandatory tests

If your team uses autonomous coding agents, review OWASP’s separate Top 10 list for agentic applications as well.

NIST AI Risk Management Framework and SSDF

NIST’s AI Risk Management Framework is built around four functions: Govern, Map, Measure, and Manage. NIST has also published the AI 600-1 profile for generative AI risks and prepared SP 800-218A to extend secure software development practices for generative AI.

We make these frameworks concrete in an agile team as follows:

NIST functionAgile-team equivalent
GovernWritten AI-use policy, approved tool list, and clear responsibilities
MapIdentify where AI is used in the codebase and classify the risk of those areas
MeasureRegularly track change failure rate, security findings, and reverted changes
ManageReview findings in retrospectives and update DoD and pipeline rules

Security Auditing and Business-Logic Auditing

Two different questions must be asked of AI-generated code: Is the code secure, and does it do the right business job? Tools are highly useful for the first question; human judgment remains decisive for the second.

DimensionSecurity auditBusiness-logic audit
QuestionDoes the code contain a vulnerability, leak, or risky dependency?Does the code correctly implement acceptance criteria and business rules?
ReferenceOWASP, NIST SSDF, and the organization’s security policyUser story, acceptance criteria, and domain knowledge
Automation levelHigh: SAST, SCA, and secret scanningLow; tests help, but the decision belongs to people
OwnerDeveloper and security teamDeveloper and product owner
If missedSecurity incident and compliance riskIncorrect feature behavior, user loss, and business loss

Manual Review, AI-Assisted Auditing, and Automated Scanning

DimensionManual reviewAI-assisted auditAutomated security scan
Strong atBusiness logic, architectural fit, and contextFast first review, explanation, and improvement suggestionsKnown vulnerability patterns, dependencies, and secrets
Weak atSlow and vulnerable to fatigue-related omissionsCan also be wrong and may lack contextDoes not see business logic or new types of risk
Scales with volume?NoYesYes
Best useFinal decision in high-risk areasFirst filter on every PRMandatory gate on every commit

These three are not alternatives; they are layers. Automated scanning is the mandatory gate, AI-assisted auditing is the first filter, and human review is the final decision.

Human-in-the-Loop Audit Protocol

  1. Mark it: The developer states in the PR description that the code was generated or assisted by AI.
  2. Pass automated gates: Review starts only after static analysis, dependency scanning, and secret scanning are clean.
  3. Set the risk level: Changes touching authentication, payments, personal data, or infrastructure privileges are high risk.
  4. Use AI pre-review: AI review directs the reviewer’s attention as a first filter; it does not replace approval.
  5. Obtain human approval: Standard review is enough for low risk; senior developer and security approval are mandatory for high risk.
  6. Approve agent actions in their raw form: If an agent proposes an irreversible action such as delete, merge, or deploy, inspect the action itself rather than relying on the agent’s summary.
  7. Measure and feed back: Review production defects and security findings in retrospectives, then update the DoD and pipeline rules.

Frequently asked questions

Must every line of AI-generated code be reviewed by a person?

Yes, especially changes involving security, payments, authentication, personal data, or infrastructure privileges. AI review can be a first filter, but it cannot replace final human approval.

How can OWASP and NIST frameworks fit agile teams?

Connect the risks to sprint planning, Definition of Done criteria, and CI/CD quality gates. This puts security and governance inside the development flow rather than leaving them as a final check.

Does AI-assisted code review replace automated scanning?

No. Automated scanning detects known patterns and dependency risks; AI-assisted review explains and prioritizes; human review is needed for business logic and context.

How is a high-risk code change identified?

Changes involving authentication, payments, personal data, encryption, infrastructure privileges, or irreversible agent actions should be treated as high risk. Senior developer and security review should be required.

How should the audit process improve over time?

Measure production defects, security findings, and reverted changes after release. Feed retrospective findings back into the Definition of Done and pipeline rules.