AI-Assisted Secure Coding (Appendix C) · AI-Assisted Secure-Coding Workflow
Measure AI code against a human baseline
Verify that metrics are collected on AI-produced and AI-mediated code, and that the results are compared against a human-only baseline. Vulnerability density, mean-time-to-detect, AI-attributable defect rate, prompt-injection detection rate, and fork-PR rejection rate are all useful.
OWASP AISVS v1.01, requirement AC.1.4
In plain English
Measure the security quality of AI-produced code and compare it with code written without AI. Without figures, arguments about whether AI code is safe enough are matters of opinion. This is a Level 3 control.
What good looks like
- AI-produced and AI-mediated changes can be identified in version control.
- Metrics are collected for both groups, such as vulnerability density, time to detect, defects traced to AI, prompt-injection detection rate and fork-PR rejection rate.
- The comparison with the human-only baseline is reported on a schedule.
- Results lead to changes in the workflow.
How teams usually do it
- Commit trailers or pull request labels that record AI involvement, joined with scanner findings and incident data.
- A quarterly report to engineering and security leads.
- Care with small samples and with differences in the kind of work AI is used for.
Suggested evidence
- A recent metrics report with the baseline comparison.
- A workflow change made because of it.
Common mistakes
- Collecting metrics nobody looks at.
- Relying on developers to self-report AI use when the tools can add the attribution automatically.
- Comparing AI-written boilerplate with human-written cryptography and drawing conclusions.
Not sure which requirements apply to your system? Take the assessment, or browse every guide in this chapter.
Requirement text from the OWASP AI Security Verification Standard, licensed under CC BY-SA 4.0. This guidance is shared under the same licence.