TL;DR: AI coding assistants can produce syntax-correct code at over 95% accuracy while security pass rates remain around 55%, and roughly 45% of AI-generated samples introduce an OWASP Top 10 weakness directly into repositories, according to OXSecurity and CSA research. The practical shift is from catching isolated bugs to governing prompt-to-runtime failure paths before flawed defaults replicate across services.
Editorial analysis by NHI Mgmt Group, based on content published by OXSecurity: “OWASP Top 10 2025: How Classic Risks Change When AI Writes the Code”.
By the numbers:
- roughly 45% of AI-generated code samples introduce an OWASP Top 10 weakness directly into the repository.
- syntax errors in AI-generated code have fallen 76% as model output becomes more fluent.
- security pass rates for LLM-generated code have remained virtually flat at about 55%.
Key questions
Q: What breaks when AI-generated code is only checked after commit?
A: Post-commit controls miss the moment when risky code is created, so secrets, insecure patterns, and policy violations can enter the repository before security ever sees them.
Q: Why do AI coding assistants create access control risk in applications?
A: Because they often generate code that assumes the caller is trusted or that sensitive fields are safe to expose.
A: Common warning signs include repeated injection issues, dependencies that are rarely updated, inconsistent validation logic, and fixes that take longer than new defects are introduced.
Practitioner guidance
- Enforce generation-time policy controls Block insecure prompts, unsafe templates, and prohibited patterns before code is synthesized so the model cannot repeatedly emit the same weaknesses.
- Review delegated access in generated services Check service accounts, API keys, and token scopes created or referenced by AI-assisted code, especially where the code touches internal APIs or automation.
- Shift security testing left of commit Add pre-commit analysis, reachability checks, and secure scaffolding validation so obvious defects do not wait for SAST to find them after the repository is polluted.
Bottom line: AI-generated code changes application risk by replicating insecure defaults at scale, not by inventing new bug classes.
Explore further
View Full Forum → | NHI Foundation Course → | Our Services → | Read the full analysis →
Systemic assembly failure is the right lens for AI-generated code: the central risk is no longer a single defect class but the repeated manufacture of insecure defaults across the SDLC. Security teams that still treat AI output as ordinary developer productivity will miss how quickly flaws propagate through APIs, infrastructure, and generated dependencies. The practitioner conclusion is to govern the assembly process, not just the finished code.
A few things that frame the scale:
- Claude Code-assisted commits leaked secrets at a rate of 3.2%, more than double the human-only baseline of 1.5%, with peaks reaching 31 secrets per 1,000 commits in August 2025, according to the State of Secrets Sprawl 2026.
- 73% of vaults are misconfigured, leading to unauthorised access and exposure of sensitive data, according to the Ultimate Guide to NHIs.
A question worth separating out:
Q: How should teams govern AI-assisted development across the SDLC?
A: Treat AI as part of the delivery control plane, not as a point tool. Set explicit human approval boundaries for planning, architecture, code review, testing, deployment, and exception handling, then require traceability for every AI-generated handoff so accountability survives the workflow.
👉 Read our full editorial: AI-generated code shifts OWASP risk from bugs to systemic assembly