TL;DR: AI code generation can produce working code 83% to 95% of the time, but only 24% to 36% of outputs are both functional and secure, according to Checkmarx-initiated research. Adding a post-generation security review lifts the secure-and-functional rate to 47% to 56%, showing that application security now has to verify what models produce, not just whether it runs.
At a glance
What this is: The article argues that AI-generated code has created an AppSec trust gap, where working output no longer implies secure output and independent verification becomes essential.
Why it matters: For IAM, NHI, and broader security teams, this matters because AI-assisted development increases the volume and speed of risky changes, while conventional review signals can miss insecure logic, access control flaws, and secret exposure.
By the numbers:
- On real-world repository tasks, frontier models produced working code 83% to 95% of the time.
- Only 24% to 36% of those solutions were both functional and secure.
- A post-generation security review improved the secure-and-functional rate to 47% to 56%.
👉 Read Checkmarx's analysis of AI-generated code and AppSec trust signals
Context
AI-generated code changes the AppSec baseline because traditional trust signals, such as compilation success and passing tests, do not prove that the code is secure. The primary issue is not whether models can write code, but whether security teams can still verify intent, context, and hidden failure modes at the speed development now operates.
This matters for identity and access governance because modern applications increasingly contain permissions, APIs, MCP servers, secrets, and automated decision paths that are created or modified by software systems rather than individual developers. When code is generated faster than it can be independently reviewed, the organisation inherits a governance problem as much as a coding problem.
The article is typical of current agentic AppSec conversations: the technology is maturing faster than the operating model that is meant to control it.
Key questions
Q: How should security teams govern AI-generated code in production pipelines?
A: Security teams should treat AI-generated code as a controlled identity event, not just a development artifact. Require human approval, traceable authorship, scoped workload identities, and evidence of intent before production promotion. The goal is to preserve provenance and limit blast radius when generated logic behaves unexpectedly.
Q: Why do traditional AppSec signals fail with AI-generated code?
A: Traditional signals such as passing tests, successful builds, and confident model explanations only prove that the code behaves as requested. They do not prove the output is secure, because they miss hidden access-control failures, unsafe dependencies, and logic flaws that appear only in context. Teams need controls that validate security properties separately from functional correctness.
Q: What do teams get wrong about AI-generated documentation and code review?
A: They often assume documentation or review output is proof of oversight. In practice, if AI generates the work and another AI validates it, the process can become a closed loop unless a separate human applies challenge, context, and responsibility for the final decision.
Q: How can organisations reduce risk without stopping AI-assisted development?
A: Organisations should keep AI assistance but make the secure path the easiest path. That means secure prompt guidance, mandatory scanning, dependency allowlists, and extra review for security-critical code paths. The aim is not to ban speed, but to make sure productivity gains do not bypass the controls that protect production systems.
Technical breakdown
Why AI-generated code breaks traditional AppSec trust signals
AI-generated code often looks correct because it compiles, satisfies the prompt, and may even pass a functional test, but those signals only show that the requested behaviour occurred. They do not reveal insecure assumptions, unreviewed access paths, secret handling mistakes, or dangerous edge cases. In AppSec terms, the problem is verification depth: model output can be syntactically valid while still being semantically risky. That is why independent validation matters more as AI increases development throughput. Security teams need to inspect both the code path and the security consequence, not just the success of the build.
Practical implication: treat build success as a baseline signal, not as evidence that the code is safe to release.
Why agentic development creates a governance problem, not just a tooling problem
Once AI systems can write files, install packages, call tools, and alter repositories, the risk moves beyond code quality into governance. The security question becomes who approved the change, what the model could access, which policies constrained it, and whether the output was checked by an independent control. This is especially important when models are also asked to review their own output, because that removes the separation between generation and verification. In practice, AppSec has to govern the full software activity chain, including the agents, dependencies, and permissions involved in producing code.
Practical implication: define independent review points for AI-assisted changes rather than letting the same system generate and validate its own output.
How context becomes the control layer for secure AI-assisted software delivery
The article points to a broader shift in which context, not raw model output, becomes the decisive control layer. Security decisions improve when code is analysed alongside ownership, exposure, runtime reachability, dependency relationships, policy, and prior remediation history. Without that context, AI tools can return fluent but inconsistent conclusions, especially on access-control failures, injection paths, and logic flaws. This is where security engineering and identity governance meet: if the software creates or governs access, then the review process must understand both the code and the access model it implements.
Practical implication: connect AppSec findings to ownership, reachability, and policy before using them to prioritise remediation.
Threat narrative
Attacker objective: The attacker seeks to exploit insecure software generated or approved through weak verification so they can access systems, data, or privileged workflows.
- Entry occurs when insecure AI-generated code introduces vulnerable logic, unsafe dependencies, or exposed secrets into the development lifecycle.
- Escalation follows when those flaws are merged, reused, or propagated across applications, giving attackers more opportunities to exploit access-control and injection weaknesses.
- Impact is realised when the insecure code reaches production and creates abuse paths for data access, privilege misuse, or downstream compromise.
NHI Mgmt Group analysis
AI-generated code has created an AppSec trust gap: code that works is no longer a reliable proxy for code that is safe. The article shows that functional success and security success are now diverging, which means verification has to become a separate control, not a side effect of testing. This is a governance problem for every programme that relies on AI-assisted development, because the organisation is effectively accepting software from a system that can produce plausible but insecure output. Practitioners should treat independent verification as a required control, not a discretionary quality step.
Context is the new control surface for secure development: AppSec tools that see only the file being changed will miss the broader risk picture. The article correctly elevates ownership, reachability, policy, dependency state, and prior remediation history as decision inputs, because those are the signals that separate theoretical defects from attackable ones. This aligns with modern security governance: the issue is not finding more alerts, but making better decisions about which code is actually exploitable. Practitioners should prioritise controls that enrich findings with context before triage starts.
AI review loops are not independent when the same model grades its own work: that is the central failure mode the article exposes. The named concept here is model self-verification bias: when generation and validation use the same class of reasoning, weak code can receive overconfident approval. That pattern undermines assurance in the same way poor segregation of duties undermines financial controls. Practitioners should separate generation, validation, and approval into different trust boundaries.
Agentic AppSec is becoming an identity problem as much as a code problem: AI systems now act through permissions, tools, repositories, and MCP servers, which means the security boundary is no longer just the source file. When software can modify other software, the question becomes which identity exercised that capability and whether the action was policy-bound. This is where NHI governance intersects with AppSec: the runtime identity of the agent or automation matters. Practitioners should bring machine identity, access scope, and tool permission review into the AppSec operating model.
The market is moving from detection toward governed prevention: the article signals a shift away from post hoc scanning as the primary control. Security teams need controls that stop unsafe changes at creation time, then enrich remediation and triage after the fact. That direction is consistent with broader identity security trends: the more autonomous the system, the more the enterprise needs enforceable context, scope, and accountability. Practitioners should prepare for AppSec programmes that look more like governed execution systems than static scanning pipelines.
What this signals
Model self-verification bias is the practical risk to watch as AI-generated code becomes normalised in delivery pipelines. If the same class of system can generate and review changes, confidence will often rise faster than actual assurance, so leaders need an independent control boundary between code creation and security approval.
The governance signal is clear: AppSec programmes will be judged less by scan volume and more by how well they can prove which findings are attackable, which decisions were contextual, and which changes were blocked before merge. That shifts investment toward policy enforcement, reachability analysis, and identity-aware controls over coding agents.
The broader programme implication is that AI-assisted development will force tighter links between application security, machine identity, and secrets governance. As coding agents gain more operational reach, teams will need to know not just what code changed, but which non-human identities were allowed to change it and under what policy.
For practitioners
- Separate generation from verification Require an independent security control to review AI-generated code before merge, especially for access control logic, dependency changes, and secret handling. Do not let the same model produce and approve the final decision.
- Prioritise context-enriched triage Score findings using reachability, exploitability, ownership, runtime exposure, and business criticality so teams focus on attackable risk rather than raw alert volume.
- Treat AI agents as governed actors Inventory repositories, MCP servers, packages, and permissions used by coding agents, then map each one to an accountable owner and an explicit policy boundary.
- Move prevention into the development workflow Place scanning and policy checks inside IDE and commit workflows so unsafe file writes, package installations, and code refactors are intercepted before they propagate.
Key takeaways
- AI-generated code now creates a verification gap, because code can work without being secure.
- The scale of the problem is visible in the data, with functional output far outpacing secure output and remediation lagging behind confidence.
- Independent review, contextual triage, and governed agent permissions are the controls that turn AI-assisted development into manageable risk.
Standards & Framework Alignment
This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.
OWASP Non-Human Identity Top 10 and MITRE ATT&CK address the attack and risk surface, while NIST CSF 2.0, NIST SP 800-53 Rev 5 and NIST AI RMF set the governance and control requirements practitioners need to meet.
| Framework | Control / Reference | Relevance |
|---|---|---|
| OWASP Non-Human Identity Top 10 | NHI-01 | AI coding agents and secrets exposure create NHI governance issues across tools and repositories. |
| NIST CSF 2.0 | PR.AC-4 | The article centres on access governance for AI-assisted software creation and review. |
| NIST SP 800-53 Rev 5 | IA-5 | Secrets handling and authenticator management are directly implicated by AI-generated code risk. |
| MITRE ATT&CK | TA0006 , Credential Access; TA0040 , Impact | Secret leakage and insecure code creation can enable credential theft and downstream compromise. |
| NIST AI RMF | GOVERN | AI-assisted code generation needs governance, accountability, and independent oversight. |
Track AI-assisted code risks to credential access and impact tactics so remediation targets the highest-risk paths.
Key terms
- AI-Generated Code Risk: AI-generated code risk is the possibility that model-produced output introduces insecure credential handling, hidden secrets, or repeated patterns that weaken control design. The risk is operational, because the output can be merged quickly and at scale before humans catch the problem.
- Model Self-Verification Bias: A failure mode where a model evaluates its own output and can overstate confidence in results that are incomplete or insecure. The risk is amplified in AppSec because fluent reasoning can appear authoritative even when the underlying control evidence is weak.
- Attackable Risk: A finding that is not only present but also reachable, exploitable, and relevant in the current environment. Security teams use this concept to separate theoretical defects from issues that can realistically be used to compromise systems or data.
- Contextual Triage: Contextual triage is the process of evaluating alerts using business, asset, and identity information before deciding whether they need analyst attention. It improves the quality of investigation by distinguishing routine activity from behaviour that is unusual in the organisation’s own operating environment.
What's in the full article
Checkmarx's full article covers the operational detail this post intentionally leaves for the source:
- The underlying research setup and how the AI-generated code tasks were evaluated across real repository scenarios.
- The specific workflow design behind the post-generation security review and how it changed secure output rates.
- Operational details on Checkmarx Fusion, AI Inventory, Triage Assist, and Developer Assist in practice.
- The article's full explanation of how context, policy, and remediation are applied across the software lifecycle.
Deepen your knowledge
The NHI Foundation Level course, the industry's only accredited NHI security programme, covers NHI governance, machine identity security, and secrets management. It is designed for practitioners who need to connect identity control with modern application and automation risk.
Published by the NHIMG editorial team on August 19, 2026.
NHI Mgmt Group — the independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org