By NHI Mgmt Group Editorial TeamBased on LEGIT Security: “The Risks of AI-Generated Software Development” (October 2, 2025)

TL;DR: AI is accelerating code volume, supply chain exposure, and secret leakage faster than human review capacity can scale, according to LEGIT Security, while Gartner warns that prompt injection and vibe coding are already creating measurable appsec exposure. The practical issue is not AI novelty but governable control loss across code generation, model inputs, and third-party dependencies.


At a glance

What this is: AI-generated code is widening application security exposure by accelerating code production, weakening review coverage, and introducing AI-specific risks such as prompt injection, model poisoning, and supply-chain uncertainty.

Why it matters: For IAM, PAM, NHI and AI security teams, this matters because AI-assisted development can introduce ungoverned credentials, third-party code paths, and autonomous workflows that bypass the controls built for human-paced change.

By the numbers:

  • Through 2029, over 50% of successful cybersecurity attacks against AI agents will exploit access control issues, using direct or indirect prompt injection as an attack vector.

Context

AI-generated code creates a governance problem before it creates a code-quality problem. When software volume rises faster than review capacity, security teams lose the ability to validate provenance, inspect dependencies, and catch risky logic before it reaches production. In AI-assisted development, the control gap is not only in the application layer. It also extends into the identity and trust relationships around models, assistants, and third-party services.

The article points to a familiar pattern with a different scale: shadow technology moves faster than central review, and the blast radius grows because code generation now happens alongside model interaction, autonomous actions, and external tool use. For identity and access programmes, that means code creation is increasingly tied to machine identities, API keys, service accounts, and delegated access paths that need explicit governance.


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 does prompt injection create risk in AI tools that inspect source code or malware samples?

A: Prompt injection is risky because the model may follow attacker-written instructions inside the sample instead of analysing the sample as untrusted data. That can hide malicious behaviour, suppress alerts, or cause the tool to recommend unsafe actions. In security workflows, the model becomes part of the trust boundary, so untrusted content must never control execution or analysis decisions.

Q: What do teams get wrong about securing AI coding assistants?

A: Teams often focus on code output and ignore the agent boundary, where file reads, tool outputs, and external content shape the next action. That misses the real control point. The right question is whether untrusted input can influence privileged behaviour before the code is even written or committed.

Q: Should organisations allow AI-generated code into production without extra controls?

A: No. Production use should depend on sandboxing, dependency validation, secret scanning, and execution boundaries that are specific to AI-assisted workflows. Without those controls, AI-generated code can amplify supply-chain exposure and introduce vulnerabilities faster than human review can reliably catch them.


Technical breakdown

Why AI-generated code outpaces manual application security review

AI systems can produce large volumes of code in seconds, but human review capacity does not scale linearly with output. That creates a control mismatch: static review, peer review, and traditional AppSec gating assume developers can inspect changes at roughly the same pace they are introduced. AI-generated code also inherits patterns from public training data, which can include insecure snippets, outdated libraries, and risky implementation habits. The result is not just more code, but more code that requires validation of provenance, dependencies, and security intent.

Practical implication: Treat code generation as an intake problem and add automated policy checks before review bottlenecks form.

How prompt injection and poisoned inputs change the threat model

Prompt injection and data poisoning work because AI systems process untrusted inputs as if they were instruction-bearing context. In practice, an attacker can manipulate prompts, attached content, or retrieved data so the model produces unsafe actions or unsafe code suggestions. That is a different failure mode from conventional application injection because the system may obey hidden instructions embedded in what appears to be normal content. When assistants can also call tools, write files, or execute commands, input manipulation can become a pathway to code change, data exposure, or broader system compromise.

Practical implication: Separate untrusted inputs from privileged execution paths and constrain what AI tools can do with externally sourced context.

Why coding assistants and LLM agents introduce identity and privilege risk

Coding assistants are not just content generators. They increasingly operate as delegated actors that can read repositories, suggest changes, fetch packages, or run commands. That makes their identity and privilege model central to security. If an assistant can access source code, tokens, or build pipelines without strict boundaries, the tool itself becomes a high-value control point. The issue is especially sharp when AI agents chain actions across multiple systems, because each step can inherit trust from the last and expand the attack surface beyond what a human reviewer can realistically observe.

Practical implication: Define machine identities, tool permissions, and approval boundaries for coding assistants the same way you would for other privileged automation.


Threat narrative

Attacker objective: The attacker wants to turn AI-assisted development into a path for code theft, unsafe code insertion, or privileged execution inside the software supply chain.

  1. Entry begins when attackers supply malicious prompts, poisoned data, or manipulated content to an AI coding workflow or assistant.
  2. Credential access or execution escalates when the assistant is allowed to fetch packages, run commands, or access repositories and tokens under delegated trust.
  3. Impact follows when unsafe code, stolen source material, or malicious dependency changes are introduced into production software or private development environments.

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

AI-generated code is now an application governance problem, not only a developer productivity problem. The central issue is that code creation is outpacing the review, validation, and dependency controls built for human-paced change. That creates a control gap across SDLC, AppSec, and identity governance, because code production is now intertwined with delegated machine activity. Practitioners should treat AI-assisted development as a governed software supply chain, not as a pure tooling choice.

Shadow AI in software development is a governance failure with identity consequences. When teams integrate assistants, agents, and APIs outside centralized oversight, they create untracked trust relationships that often include tokens, service accounts, and build permissions. That is where NHI governance becomes materially relevant: the assistant is frequently operating through machine identities that were never designed for autonomous or semi-autonomous use. Practitioners should inventory those identities before they become invisible control points.

Prompt injection has become a control-plane issue for coding workflows. The attack is effective because models are increasingly allowed to act on content before that content has been reliably trusted. In practice, the problem is not just malicious text, but the combination of untrusted context and privileged tool use. Practitioners should align AI coding controls with the same least-privilege and verification discipline they apply to other privileged automation.

Delegated code authority: this is the failure mode where an AI system is allowed to create, modify, or execute code with more trust than its inputs deserve. The dangerous assumption is that generated output can be reviewed after the fact, when the real risk is introduced at generation and action time. Practitioners should move governance upstream to issuance, permissioning, and execution boundaries.

From our research library:

What this signals

AI-generated code is turning software supply chain governance into an identity problem as much as a code-quality problem. When assistants can write files, call tools, and use delegated credentials, the relevant control is no longer just code review. It is the combination of machine identity scope, approval boundaries, and provenance validation that determines whether generated code is safe to trust.

92% of organisations expose NHIs to third parties, raising concerns about supply chain security, according to the Ultimate Guide to NHIs. That figure matters here because AI coding assistants and related services often depend on the same external access patterns, which means third-party exposure can quickly become development-path exposure.

Delegated code authority becomes the useful framing for practitioners. The question is not whether AI can write code, but which identities, tools, and execution rights it is allowed to exercise while doing so. Teams that cannot answer that governance question clearly should assume their AppSec posture is already behind the implementation reality.


For practitioners

  • Constrain AI code generation to controlled environments Keep AI-assisted coding inside sandboxes or non-production pipelines until you can verify outputs, dependencies, and execution boundaries. Prohibit direct production changes from tools that can create code, run commands, or call external services without policy enforcement.
  • Inventory the identities used by coding assistants Map every token, service account, API key, and delegated credential used by assistants and coding agents. Record who owns each identity, what repositories or build systems it can reach, and how it is revoked when the workflow changes.
  • Block untrusted context from privileged actions Separate prompt ingestion, retrieval sources, and execution permissions so an assistant cannot turn attacker-controlled content into tool use. Apply approval gates before package installation, file writes, command execution, or source-code exfiltration.
  • Add policy checks before code review Run automated checks for dependency provenance, secret leakage, unsafe functions, and model-generated code patterns before human reviewers see the change set. That reduces the chance that review becomes a rubber stamp for already-unsafe output.

Key takeaways

  • AI-generated code is widening application security exposure because review capacity, provenance checks, and dependency validation do not scale at the same speed as code generation.
  • Prompt injection and poisoned inputs matter because they can steer privileged assistants into unsafe actions, not just produce bad text.
  • The most relevant control shift is from post-hoc review to upfront governance of machine identities, execution rights, and trusted context.

Key terms

  • AI-generated code: Software produced wholly or partly by an AI model or agent rather than a human developer. The security concern is not authorship alone, but whether the resulting logic, access control, and dependency choices have been independently verified before release.
  • Prompt Injection (Agentic): An attack where malicious instructions are embedded in content that an AI agent reads, causing the agent to execute unintended actions using its own legitimate credentials. A primary vector for agent goal hijacking and identity abuse.
  • Coding Assistant: A coding assistant is an AI-powered software tool that helps developers read, edit, and generate code. In governance terms, it may also act as a non-human identity when it can invoke tools, reach data sources, and perform actions inside trusted workflows.
  • Delegated Machine Identity: A non-human identity that acts on behalf of an organisation or another system with defined authority. In agentic environments, this identity may chain actions across tools and services, so lifecycle, approval, and revocation need to reflect the delegation path as well as the technical account itself.

Deepen your knowledge

NHI Mgmt Group covers identity security, NHI governance, and agentic AI through independent research, practitioner guides, and the NHI Foundation Level course, the industry's only accredited NHI security programme. It is designed for practitioners who need to govern machine identities, delegated access, and AI-driven workflows.
NHIMG Editorial Note
Published by the NHIMG editorial team on August 19, 2026.
Updated on October 12, 2026.
NHI Mgmt Group, the independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org