By NHI Mgmt Group Editorial TeamBased on Checkmarx: “Why an AI Code Generator Can’t Secure Its Own Code. And Why Checkmarx Assist Can.” (September 22, 2025)

TL;DR: AI-assisted development is accelerating code output, but IDC and BaxBench findings cited by Checkmarx show limited scrutiny, with up to 70% of AI-generated code evaluating as insecure or flawed against secure coding baselines. The governance problem is that code generation and code review are being conflated, creating a separation-of-duties failure inside the software delivery pipeline.


At a glance

What this is: This is an analysis of how vibe coding is changing software delivery, with Checkmarx arguing that AI-assisted code creation is outpacing independent security review.

Why it matters: It matters because IAM, PAM, and AppSec teams all depend on separation of duties, and AI-generated code that bypasses review can introduce insecure logic, malicious dependencies, and secrets exposure into production paths.

By the numbers:

  • Developers using GenAI tools achieve a 35% productivity boost, often matching the output of 3 to 5 engineers.
  • Up to 70% of AI-generated code was found to be insecure or flawed when evaluated using secure coding baselines.
  • By 2028, 90% of enterprise engineers are projected to use GenAI tools.

Context

Vibe coding is the pattern in which developers accept AI-generated code with limited scrutiny, often to move faster through the delivery pipeline. The security problem is not generation itself, but the loss of independent validation between suggestion, acceptance, and merge, which weakens software supply chain governance and can also expose secrets, access logic, and insecure dependencies.

That matters for identity security because code review, policy enforcement, and privileged change control are all part of the same governance boundary. When the same workflow both creates and validates code, separation of duties breaks down, and organisations lose a reliable control point for AppSec, secrets management, and policy-backed release decisions.


Key questions

Q: What breaks when AI-generated code is treated like normal developer output?

A: Teams can miss insecure patterns, risky dependencies, and hidden assumptions because the review process assumes human authorship. That creates a governance gap where plausible-looking code moves forward with too little scrutiny. The fix is to treat generated code as untrusted until it passes automated testing, dependency review, and explicit human approval.

Q: Why do AI-generated code changes increase application security risk?

A: AI-generated code can increase risk because it accelerates output faster than review, testing, and secret hygiene can keep up. The issue is not only flawed logic. It is also the possibility that tokens, credentials, unsafe dependencies, or insecure defaults are reproduced at scale across the delivery pipeline.

Q: How should security teams secure AI-assisted development without overwhelming AppSec workflows?

A: Start with continuous discovery, then connect findings to exposure, criticality, and data sensitivity before remediation begins. AI-assisted development increases the pace of change, so the control problem becomes deciding what matters fast enough to act on it. Teams that keep relying on scan volume alone will stay busy without reducing real risk.

Q: Should organisations let the same workflow generate code and sign off on it?

A: No. Code generation and code approval should remain separate because the first task creates the change and the second task verifies it. When those duties collapse into one workflow, the organisation loses the independence needed to catch insecure code before it reaches shared systems or production.


Technical breakdown

Why AI code generation is not code validation

Generative coding tools are optimized for speed, not for assurance. They can produce syntactically valid output, but they do not inherently verify secure design, dependency reputation, licensing obligations, or organisational policy. In practice, this means the output can look ready for merge while still carrying hidden flaws, unsafe assumptions, or insecure patterns. Secure review requires context about application risk, approved libraries, and change governance. A code assistant has no native obligation to reject a weak pattern unless a separate control is enforcing that decision.

Practical implication: Treat AI-generated code as untrusted draft material until a separate validation control reviews it.

How separation of duties breaks in vibe coding workflows

Separation of duties is a governance control, not just a process preference. In a traditional workflow, code creation, security review, and approval are distinct checkpoints. Vibe coding compresses those roles because the developer can generate, accept, and move code forward in one flow, often before anyone else sees it. That creates a review gap in which insecure code can enter repositories with the appearance of normality. Once that happens, downstream checks are doing remediation, not prevention, which raises cost and risk.

Practical implication: Preserve an independent review step before merge so authors do not become their own security approvers.

Where AI-assisted code most often leaks risk

The risk is not limited to insecure logic. AI-assisted code can also introduce vulnerable packages, secrets, licensing problems, and context-free fixes that break adjacent functionality. That is why secure coding baselines matter: they test whether the generated output can survive the same scrutiny applied to human-written code. Where organisations rely on speed metrics alone, they can miss that defect density is rising even as throughput improves. The article’s central warning is that productivity gains are real, but they are not a security control.

Practical implication: Measure AI code quality with secure coding checks, dependency inspection, and secret scanning before release.


Threat narrative

Attacker objective: The objective is to get unsafe code into trusted delivery pipelines so it is reviewed too late, if at all, and becomes part of production software.

  1. Entry occurs when a developer accepts AI-generated code with limited scrutiny and inserts it into the delivery pipeline.
  2. Credential or secret exposure can follow when the generated code includes embedded secrets, insecure access handling, or unsafe dependencies.
  3. Escalation happens when insecure code reaches the repository, CI/CD, or production path without an independent security gate.
  4. Impact is insecure, noncompliant, or dangerous software moving into environments where it can create outages, exposure, or later compromise.

Read and download The State of NHI & AI Agent Breach Report 2026, covering 200+ breaches impacting Non-Human Identities including AI Agents.


NHI Mgmt Group analysis

Vibe coding creates a governance gap, not just a coding-style shift. The core problem is that code generation and code approval are being merged into one accelerated workflow, which weakens separation of duties. That matters because security review is supposed to be independent of the person or tool producing the change. Practitioners should treat the review gap as a control design failure, not a developer productivity issue.

AppSec now has to validate the generator’s output, not trust its intent. AI assistants can accelerate boilerplate and exploration, but they cannot own secure context, policy enforcement, or risk acceptance. The article makes clear that speed without validation is a false gain when insecure code, vulnerable packages, or secrets slip through. The right question is not whether the tool is helpful, but whether a separate control can prove the output is safe enough to merge.

Secrets and dependency risk are becoming part of the same AI-assisted code problem. Once developers accept AI output with limited scrutiny, the chance of leaking credentials, inheriting unsafe dependencies, or shipping noncompliant code rises together. That is why the governance issue spans more than AppSec. It touches identity and access boundaries, software supply chain integrity, and the control over what reaches production. Practitioners should align code review, secrets scanning, and dependency validation as a single policy surface.

Machine-speed development is forcing a rethink of where trust begins. The old assumption was that a human reviewer could catch what automation missed before merge. In vibe coding workflows, that assumption is no longer reliable because the first reviewer may be the same workflow that wrote the code. Security programmes should move trust boundaries earlier, at generation and acceptance time, instead of hoping post-commit checks will compensate.

From our research library:

What this signals

AI-assisted coding is turning AppSec into a pre-merge governance problem. Organisations need to move review earlier, because post-commit scanners can only react to code that has already entered the pipeline. That changes the control design question from "how fast can we ship?" to "how do we prove the code was independently validated before merge?"

Vibe coding creates a validation trust gap: the organisation assumes the same workflow that produced the code can also judge whether it is safe. That assumption is now the weak point. Practitioners should watch for AI-generated changes that bypass normal review depth, because the control failure is not the model, it is the absence of a distinct approval boundary.

The developer-behaviour signal matters too. Only 44% of developers are reported to follow security best practices for secrets management, which means many teams are already operating with a thin behavioural margin before GenAI accelerates output. Security programmes should treat AI-assisted code as a governance multiplier, not a productivity neutral.


For practitioners

  • Define an independent pre-merge security gate Require a separate approval path for AI-assisted changes so the code author and the security approver are not the same control point.
  • Scan AI-generated changes for secrets and unsafe dependencies Run automated checks before merge for embedded credentials, suspicious packages, and license issues because AI output often enters the repo unchecked.
  • Measure AI-assisted code quality against secure baselines Track insecure findings, remediation rework, and flaw rates on AI-produced code separately from human-authored code so the risk profile is visible.
  • Keep developers from approving their own high-risk changes Use policy and workflow controls to preserve separation of duties for code that touches authentication, secrets, or sensitive business logic.

Key takeaways

  • AI-assisted coding is creating a review gap because code generation and code validation are being conflated inside the same workflow.
  • The evidence points to a real control problem, with productivity gains outpacing the security scrutiny needed to keep insecure output out of repositories.
  • Teams need an independent approval boundary, plus automated secret and dependency checks, before AI-generated code is allowed to merge.

Standards & Framework Alignment

This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.

OWASP Agentic AI Top 10, OWASP API Security Top 10 and MITRE ATT&CK address the attack and risk surface, while NIST CSF 2.0 sets the governance and control requirements practitioners need to meet.

FrameworkControl / ReferenceRelevance
OWASP Agentic AI Top 10ASI02 — Tool MisuseAI coding assistants can be used outside their safe trust boundary when code is accepted as if it were reviewed.
Recommendation — Constrain agent tool output with separate validation and approval before code reaches merge.
OWASP API Security Top 10API10 — Unsafe Consumption of APIsGenerated code can embed unsafe dependency and integration patterns that behave like unsafe API consumption.
Recommendation — Review generated integrations for unsafe assumptions and reject code that consumes APIs without validation.
NIST CSF 2.0PR.AA-05 — Access Permissions, Entitlements and AuthorizationsAppSec review gates are authorisation controls over who can move risky code into production paths.
Recommendation — Apply approval and entitlement checks before code changes are authorised for merge.
MITRE ATT&CKTA0006;TA0010 — Credential Access; ExfiltrationSecrets exposure inside AI-generated code can enable credential theft and downstream exfiltration.
Recommendation — Map exposed secrets to credential-access and exfiltration paths and prioritise scanning where generated code lands.

Key terms

  • Vibe Coding: A software development approach where natural-language prompts drive much of the implementation and AI produces the code. In practice, the term covers a wide range of control levels, from no-review prototyping to structured engineering with tests, review, and architecture held by humans.
  • Segregation of Duties: Segregation of Duties is a control principle that prevents one person or role from combining incompatible permissions that could create fraud, error, or undetected change. In ERP environments, it must account for roles, transactions, approvals, and compensating controls across business processes.
  • 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.
  • Secrets Management: The discipline of securely storing, distributing, rotating, and auditing secrets across an organisation's systems and pipelines, typically implemented via a centralised secrets vault such as HashiCorp Vault, AWS Secrets Manager, or Akeyless.

Deepen your knowledge

The NHI Foundation Level course, the industry's only accredited NHI security programme, covers NHI governance, agentic AI identity, IAM, and secrets management. It helps security and identity practitioners build the control thinking needed for machine-speed workflows and governed access.
NHIMG Editorial Note
Published by the NHIMG editorial team on August 2, 2026.
Updated on October 12, 2026.
NHI Mgmt Group, the independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org