By NHI Mgmt Group Editorial TeamDomain: Cyber SecuritySource: VeracodePublished June 17, 2026

TL;DR: AI-generated code carries the same vulnerability classes as human-written code, while security teams still need automated scanning, policy gates, and rapid remediation to keep pace with code velocity, according to Veracode. The real control problem is not restricting one model, but building an AppSec control plane that measures risk fixed and shipped.


At a glance

What this is: This is Veracode’s analysis of why restricting AI code security tools misses the bigger AppSec problem: AI-accelerated code creation needs an automated control plane, not a narrower model policy.

Why it matters: It matters because IAM, PAM, and NHI teams increasingly depend on application pipelines that generate secrets, credentials, and access paths faster than manual review can govern.

By the numbers:

  • Only 44% of developers are reported to follow security best practices for secrets management, exposing a significant developer behaviour gap.

👉 Read Veracode's analysis of why AI code security needs an automated control plane


Context

AI-assisted software delivery is compressing the time between code creation and exposure, which makes downstream review-only security models weaker by design. In AppSec, the issue is not whether a model is allowed to discuss security, but whether the organisation can detect flaws, secrets, and misconfiguration before they become production risk.

That creates a governance problem for identity security as well. AI-generated code often carries secrets, service connections, and deployment permissions into the pipeline, which means IAM, PAM, and NHI controls have to operate at machine speed instead of waiting for a human review cycle. This is now a control-plane question, not just a tooling question.


Key questions

Q: What breaks when AI-generated code is reviewed without security gates?

A: What breaks is the assumption that a clean-looking diff is a safe diff. AI-generated code can hide unsafe defaults, dependency issues, and weak validation that basic review misses. Without CI-enforced tests and security checks, the merge process becomes a distribution channel for defects rather than a control point.

Q: Why do development pipelines create identity governance risk?

A: Pipelines often create, store, and use service accounts, tokens, certificates, and API keys outside normal identity lifecycle controls. If those credentials are shared, duplicated, or never rotated, they become standing access paths that security teams may not fully see. That makes delivery systems part of NHI governance, not separate from it.

Q: What do security teams get wrong about AI access risk?

A: Many teams focus on the model while ignoring the identity path that reaches it. If a service account or token can invoke AI infrastructure, then that credential becomes the real control point. The mistake is treating AI risk as a model problem instead of an access governance problem.

Q: How do teams know whether AI-assisted AppSec is actually helping?

A: Look for findings that can be traced back to named components, repeated across assessments, and mapped to concrete remediation actions. If the system produces faster output but reviewers still cannot understand why a requirement exists, the programme has improved throughput without improving governance.


Technical breakdown

Why AI-generated code changes the AppSec control model

Large language models can accelerate code production without changing the underlying classes of software risk. Injection flaws, insecure deserialisation, broken authentication, hardcoded secrets, and dependency exposure still emerge from the code itself. The difference is volume and speed: AI can multiply both safe and unsafe output, so the security program must shift from post-hoc review to inline detection, validation, and policy enforcement. That is why a single gated model is not a security architecture. Practical implication: treat AI code generation as an input stream that must be inspected continuously, not as a source that can be trusted by default.

Practical implication: move AppSec controls into the development pipeline before merge, not after release.

What an AppSec control plane does that a model cannot

An AppSec control plane combines complementary layers: SAST for source analysis, SCA for dependency risk, secrets scanning for credential exposure, IaC scanning for cloud misconfigurations, container scanning for image flaws, and DAST for runtime testing. Each layer covers a different failure mode, and none of them depends on a frontier model agreeing to answer a security question. That matters because restrictive model behaviour can reduce utility exactly where defenders need context most. Practical implication: build layered automated inspection that keeps working even when model access, pricing, or safety filters change.

Practical implication: do not rely on any single AI model for security analysis when the full toolchain can work independently.

Why risk fixed and shipped is the right success metric

Findings volume is not the same as security improvement. A programme can create thousands of alerts and still leave risk untouched if there is no enforcement gate, no remediation loop, and no evidence that defects are actually being removed from production code. The better measure is how quickly the programme reduces exposure while preserving delivery velocity. That is especially true when developers generate code at scale and security must prove it can keep up. Practical implication: measure remediation throughput, policy pass rates, and production escape rate instead of counting findings alone.

Practical implication: report AppSec effectiveness using risk reduction and shipped fixes, not tool output volume.


Threat narrative

Attacker objective: The attacker’s objective is to turn routine code generation and weak review into exploitable application and identity exposure at scale.

  1. Entry occurs when AI-generated or developer-written code introduces vulnerabilities, secrets, or unsafe dependencies into the delivery pipeline.
  2. Escalation happens when those weaknesses are not caught by layered controls and move forward into branches, build artefacts, or deployed services.
  3. Impact follows when exposed secrets, broken auth, or insecure code paths create operational compromise, data exposure, or privileged access abuse.

NHI Mgmt Group analysis

AppSec has become a control-plane problem, not a tooling problem. When code can be generated continuously, security has to sit inline with delivery and make enforcement decisions before merge. That changes the design centre of AppSec from review to governance. For identity programmes, the same logic applies to secrets, service accounts, and deployment credentials that enter pipelines through code. Practitioners should treat pipeline controls as part of identity governance, not as a separate DevSecOps concern.

Secret exposure is the most visible identity bridge in AI-assisted development. AI-generated code can introduce API keys, tokens, certificates, and cloud credentials faster than teams can review them manually. That is a non-human identity issue as much as a coding issue because those credentials often unlock infrastructure and data paths. A named concept here is AI code secret drift: the tendency for secrets to appear, persist, and spread faster than security review can remove them. The practical conclusion is that NHI lifecycle control must extend into development tooling.

Restriction without remediation infrastructure simply shifts the burden to defenders. Limiting a model’s security capabilities does not reduce the underlying code risk if the organisation lacks automated scanning, evidence capture, and enforcement gates. Security programmes need repeatable controls that remain stable across model changes, pricing changes, and policy changes. That means the governance conversation should move from access to models toward assurance over what ships. Practitioners should judge tools by whether they reduce residual risk, not by whether they are easier to approve.

AI speed exposes the weakness of backlog-based security reporting. A findings queue can grow quickly while actual exposure stays unchanged if remediation is slow or non-binding. That is especially dangerous in environments where code generation, secrets creation, and deployment happen in the same workflow. The practical takeaway is that AppSec and identity teams need shared reporting on exposure reduction, not separate dashboards that each tell part of the story.

Identity controls must now extend to machine-produced software paths. The article shows that AI-assisted development is not just a software engineering shift. It is a governance shift in how credentials, permissions, and deployment trust are created and consumed. IAM and PAM teams should treat generated code as part of the identity attack surface, because it can create the very access paths that attackers later abuse. The control conclusion is to govern the pipeline as a privileged environment.

What this signals

AI-assisted development is pushing security programmes toward continuous governance, where identity controls have to operate inside the delivery lifecycle rather than around it. That means secrets, service accounts, and deployment permissions should be measured as part of pipeline assurance, not only as standalone IAM assets.

AI code secret drift: as code generation accelerates, secrets and credentials can appear in more places than teams can review manually, which increases the importance of automated discovery and rotation. This is where the lifecycle discipline in NHI governance intersects with AppSec, and why identity teams should watch for unmanaged machine credentials entering CI/CD paths.

The practical signal for security leaders is whether the programme can reduce exposure faster than code is created. If remediation, evidence collection, and policy decisions lag behind engineering throughput, the organisation is not controlling AI-assisted risk, only observing it.


For practitioners

  • Move AppSec enforcement into the pipeline Insert automated checks before merge so generated and human-written code face the same controls for vulnerability detection, dependency risk, secrets scanning, and infrastructure misconfiguration. The key is to stop treating security as a downstream review queue and make it a merge-time decision point.
  • Extend NHI controls into build and deployment workflows Inventory API keys, tokens, certificates, and service credentials that appear in repositories, CI jobs, and deployment manifests. Apply ownership, expiry, rotation, and revocation rules to those machine identities so code generation does not create unmanaged access paths.
  • Separate model assistance from security enforcement Use advanced AI models selectively for complex analysis, but keep scanning, policy gates, and evidence production independent of any single model’s willingness to handle security queries. That reduces operational risk when a model changes behaviour or access policy.
  • Measure risk reduction, not alert volume Track remediation throughput, time to close findings, and the percentage of risky changes blocked before release. Those measures show whether the programme is actually lowering exposure instead of just producing more findings.

Key takeaways

  • AI code generation changes the AppSec problem from periodic review to continuous control.
  • Secrets and machine credentials now enter the pipeline at machine speed, which creates an identity governance issue as well as a code quality issue.
  • Security teams should measure risk removed and shipped, because findings volume alone does not prove that AI-assisted development is under control.

Standards & Framework Alignment

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

MITRE ATT&CK address the attack and risk surface, while NIST CSF 2.0, NIST SP 800-53 Rev 5 and CIS Controls v8 set the governance and control requirements practitioners need to meet.

FrameworkControl / ReferenceRelevance
NIST CSF 2.0PR.AC-4Identity and access control is central where generated code creates machine credentials.
NIST SP 800-53 Rev 5IA-5IA-5 fits the article's focus on secrets, tokens, and credential governance.
CIS Controls v8CIS-5 , Account ManagementMachine identities in pipelines need lifecycle control, ownership, and removal discipline.
MITRE ATT&CKTA0006 , Credential Access; TA0010 , ExfiltrationSecret exposure and downstream use map directly to credential access and exfiltration tactics.

Track exposed secrets and credential misuse against TA0006 and TA0010 to prioritise blocking and rotation.


Key terms

  • AppSec control plane: An AppSec control plane is the set of automated controls that inspect, gate, and evidence software risk as code moves through development and release. It combines detection, policy enforcement, and remediation so security decisions happen in flow rather than after exposure.
  • AI code secret drift: AI code secret drift is the tendency for secrets, tokens, and credentials to appear in generated or assisted code faster than teams can discover and remove them. It turns secret exposure into a lifecycle problem that spans repositories, pipelines, build artefacts, and deployment paths.
  • Machine identity lifecycle: Machine identity lifecycle is the full governance process for a non-human identity from creation to retirement. It includes provisioning, access scoping, rotation, renewal, offboarding, and auditability, and it fails when any one of those steps is handled manually or inconsistently.
  • Policy As Gate: Policy as gate means authorization is checked before an agent acts, not after it generates an output. The control evaluates identity, scope, tenant context, exception state, and action type before execution. That is a stronger security posture than post-hoc filtering because it can prevent risky tool calls from ever starting.

What's in the full article

Veracode's full analysis covers the operational detail this post intentionally leaves for the source:

  • How the control plane maps across SAST, SCA, secrets scanning, IaC scanning, container scanning, DAST, and fuzzing.
  • How Veracode Fix generates developer-ready remediation and what evidence teams need to support merge decisions.
  • How the AI-assisted workflow changes the cost and timing trade-offs between selective model use and automated scanning.
  • How policy gates and remediation loops are meant to work together in the vendor's operational model.

👉 Veracode's full post covers the AppSec control model, remediation loop, and policy gate design in more detail.

Deepen your knowledge

The NHI Foundation Level course, the industry's only accredited NHI security programme, covers NHI governance, workload identity, secrets management, and agentic AI identity. It helps security practitioners connect identity controls to the systems that generate, move, and enforce access decisions.
NHIMG Editorial Note
Published by the NHIMG editorial team on August 2, 2026.
NHI Mgmt Group — the independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org