TL;DR: AI-assisted teams are shipping 3 to 4 times more commits but also 10 times more security findings, according to Apiiro, as AI-generated code accelerates AppSec risk faster than human review can keep up. Prevention at the prompt level is becoming the decisive control point, because detection-heavy workflows cannot reliably stop issues before they are written into code.
At a glance
What this is: This analysis argues that AI-generated code is pushing application security from post-code detection toward prevention at the prompt level.
Why it matters: It matters to IAM practitioners because faster code generation expands the number of access paths, secrets, and integration points that identity, NHI, and policy controls must govern before deployment.
By the numbers:
- Those same teams also ship 10 times more security findings, according to Apiiro's analysis.
- More than 25% of new code at Google was AI-generated in Q3 2024, rising to roughly 50% by Q4 2025, according to Apiiro.
👉 Read Apiiro's analysis of how AI-generated code is changing AppSec
Context
AI-generated code changes the security problem from reviewing finished artefacts to governing what gets created in the first place. When software production speeds up faster than assurance processes, traditional AppSec models miss the point at which risk is introduced. That is why the primary issue here is not AI productivity itself, but the governance gap between generation speed and security control speed.
The article also has a clear identity angle because faster code generation expands the surface area for secrets, service credentials, deployment tokens, and policy-bearing access paths. In practice, that means NHI governance, secrets management, and architecture-aware authorisation need to be enforced earlier in the development workflow, not only after code is merged.
The starting position described in the article is increasingly typical for enterprise software teams, not an edge case. The organisations that still rely mainly on after-the-fact scanning are already operating behind the pace of machine-generated change.
Key questions
Q: How should security teams govern AI-generated code in production environments?
A: Security teams should treat AI-generated code as normal production code with extra provenance risk. Require architectural review, test coverage, static analysis, and approval before merge. Then bind the agent and the build pipeline to least privilege, short-lived credentials, and complete audit logging so implementation speed does not outrun control.
Q: Why do AI coding assistants increase AppSec governance risk?
A: They increase risk because they optimise for speed and plausible output, not for context-aware security validation. In practice, that means developers can accept more code with less scrutiny, which raises the chance of vulnerable functions, exposed secrets, and compliance failures entering the repository and CI/CD pipeline.
Q: How can AppSec teams tell whether their controls are keeping pace with AI delivery?
A: Look for signals such as shrinking triage backlog, faster validation cycles, and a complete inventory of AI-enabled features, endpoints, and data flows. If the team can explain the security impact of a new release before it reaches production, the control plane is keeping pace. If not, the programme is already behind.
Q: Should organisations prioritise prompt-level security over traditional code scanning?
A: They should prioritise prompt-level prevention for high-risk patterns while keeping scanning in the toolchain. Scanning still matters, but it cannot be the primary defense when code is generated too quickly for manual review to keep pace. The best model combines upstream policy with downstream verification.
Technical breakdown
Why AI code generation breaks post-code AppSec
Traditional AppSec assumes code is written first and analysed later. That assumption holds when humans create code in relatively slow cycles, because there is time for review, static analysis, dependency checks, and manual triage. AI coding assistants compress that cycle. When generation, review, merge, and deployment can happen in quick succession, security findings arrive after the risky design choice has already propagated into the software supply chain.
Practical implication: move control points earlier than merge time and treat generation-time policy as part of AppSec.
Prompt-level security controls and architecture-aware guidance
Prompt-level security control means influencing the code that an AI assistant produces before the code exists. That can include threat context, approved patterns, policy constraints, and system-specific architecture signals. The architectural point is important because generic linting or SAST does not know which services, identities, data paths, and runtime assumptions are valid in a given environment. The article's model is therefore less about code review and more about governed generation.
Practical implication: inject architecture context and policy into coding assistants so insecure patterns are prevented at generation time.
Why AI-generated code creates a governance problem for identity
AI-generated code often introduces more integrations, more machine-to-machine calls, and more opportunities to embed secrets or overbroad access. That makes identity control part of the development pipeline, not just the runtime environment. For IAM and NHI teams, the technical challenge is that every generated service, token reference, or API path can become a durable access object if it is not governed before release.
Practical implication: tie secrets, service account use, and authorisation policy to the development workflow instead of relying only on runtime clean-up.
Threat narrative
Attacker objective: The attacker objective is to turn accelerated code generation into a larger, faster-moving attack surface that is easier to exploit before controls catch up.
- Entry occurs when AI coding tools generate application logic faster than human review can intercept insecure design patterns or embedded secrets.
- Escalation follows when those generated pathways create additional APIs, credentials, and integration points that expand the reachable attack surface.
- Impact is realised when vulnerable or over-privileged code is merged and deployed before security teams can prevent the exposed access path from entering production.
NHI Mgmt Group analysis
AI-generated code turns AppSec into a prevention problem, not a detection problem. The old model assumed that security could inspect code after a human had time to create and review it. That assumption weakens when code generation becomes machine-speed and vulnerabilities are introduced before a manual gate can intervene. The governance implication is that prevention must move into the generation workflow itself, or security will always trail production output.
Generation-speed drift: This is the specific control gap the article exposes. Development velocity can now outpace the rate at which static analysis, scanning, and manual review produce useful decisions. In identity terms, that means secrets, machine credentials, and authorisation logic can be created faster than teams can classify and govern them. Practitioners should treat generation-speed drift as a control design failure, not just an operational inconvenience.
Identity and NHI governance must now extend into the coding workflow. AI-generated features often spawn service accounts, API tokens, and access paths that never existed in human-authored design. That creates a lifecycle problem for NHI owners, because ownership, rotation, revocation, and scope control have to start before the code is merged. The practical conclusion is simple: if identity policy is absent at generation time, it arrives too late to shape the access model.
Architecture-aware security is becoming the differentiator in AppSec. Generic scanners can tell teams that code is risky, but they cannot reliably tell teams whether a particular pattern fits the real service topology, data paths, or trust boundaries. The article's point is that security context must be embedded in the AI workflow, not bolted on afterward. For security leaders, that means shifting from broad detection coverage to policy-aware prevention that understands how the environment is actually built.
AppSec is converging with platform governance and identity control. Once AI writes a meaningful share of enterprise code, the boundary between application security, secret governance, and access policy becomes less useful. The organisation needs one coherent view of what the software can call, what it can authenticate as, and what it is allowed to expose. That convergence is now a programme design issue, not a future aspiration.
What this signals
Generation-speed drift: teams should expect the gap between AI-assisted delivery and security governance to widen unless policy is moved into the generation workflow. The operational question is no longer whether teams can scan more code, but whether they can prevent unsafe patterns from being created in the first place. For identity programmes, that means secrets, service accounts, and access scope must be managed as part of software creation, not only after release.
The most practical response is to align application security with identity governance and architecture ownership. That includes linking coding assistants to approved patterns, validating generated code against real service topology, and reviewing where machine credentials enter the software lifecycle. The organisations that do this well will reduce remediation churn and limit the number of access-bearing artefacts that escape into production.
For teams formalising this work, NIST Cybersecurity Framework 2.0 and NIST SP 800-53 Rev 5 Security and Privacy Controls provide a useful governance backstop for policy, access control, and secure development expectations. The wider signal is that AI code generation is becoming a control design issue across AppSec, IAM, and NHI programmes, not a tooling problem alone.
For practitioners
- Embed policy at generation time Configure AI coding workflows so security rules, approved patterns, and architecture context influence output before code is generated, not after it is merged.
- Extend NHI governance into development Track service accounts, API keys, and tokens created or referenced in AI-generated code as governed identities with ownership, scope, and rotation requirements.
- Prioritise prevention over post-code detection Keep SAST and SCA in place, but move higher-confidence controls upstream so insecure patterns are blocked before review queues and deployment pipelines.
- Map generated code to real architecture Use system topology, trust boundaries, and data flow context to validate whether an AI-generated pattern is consistent with the environment that will run it.
Key takeaways
- AI-generated code is forcing AppSec to shift from after-the-fact detection toward prevention at the moment of generation.
- Apiiro cites 3 to 4 times more commits and 10 times more security findings in AI-assisted teams, showing that velocity and risk now rise together.
- Security leaders should move policy, architecture context, and identity governance into the coding workflow before insecure code and secrets are created.
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 address the attack and risk surface, while NIST AI RMF, NIST CSF 2.0 and NIST SP 800-53 Rev 5 set the governance and control requirements practitioners need to meet.
| Framework | Control / Reference | Relevance |
|---|---|---|
| NIST AI RMF | GOVERN — AI Governance and Accountability | AI-generated code needs governance and accountability around policy enforcement. |
| Recommendation — Establish governance for AI code generation so security policy is enforced before software is produced. | ||
| NIST CSF 2.0 | PR.AC-4 — Access Permissions and Authorisations | Generated code can expand access paths that must be authorised consistently. |
| Recommendation — Apply PR.AC-4 to every access path introduced by AI-generated code before release. | ||
| NIST SP 800-53 Rev 5 | AC-6 — Least Privilege | Generated services and machine credentials should operate with minimal scope. |
| Recommendation — Use AC-6 to restrict AI-created services and secrets to least privilege. | ||
| OWASP Non-Human Identity Top 10 | NHI-01 — Inventory and Ownership | AI-generated code often introduces service identities and secrets that need ownership. |
| Recommendation — Inventory machine identities created by AI-assisted development and assign explicit owners. | ||
Key terms
- Prompt-Level Control: Prompt-level control is guidance embedded in instructions given to an AI system. It can shape behaviour, but it does not provide real enforcement. If the model has access to powerful tools or sensitive systems, prompt text alone is too weak to prevent harmful actions.
- Generation-speed drift: Generation-speed drift is the widening gap between the rate at which AI can produce software and the rate at which security teams can review it. When this gap grows, after-the-fact scanning becomes less effective because risky design choices already exist in the codebase.
- Architecture-aware security: Architecture-aware security uses real system topology, trust boundaries, and data flow context to judge whether code is safe in a specific environment. It goes beyond generic code scanning by evaluating whether the generated pattern fits the actual application and runtime design.
- Non-Human Identity Governance: Non-human identity governance is the practice of managing, controlling, and auditing every machine identity across its full lifecycle. It covers service accounts, API keys, tokens, certificates, and AI agent credentials — ensuring each has a defined owner, scoped privilege, rotation schedule, and revocation path. Without governance, NHIs accumulate silently and become the primary attack surface in cloud and automated environments.
What's in the full article
Apiiro's full research covers the operational detail this post intentionally leaves for the source:
- How Guardian Agent rewrites prompts with security guidelines, threat context, and architecture signals before generation
- The software graph and deep code analysis inputs the vendor uses to tailor guidance to real application and infrastructure context
- How the prompt-level workflow fits into existing developer environments without changing the broader delivery process
- Examples of the architecture-aware security context the vendor says it applies inside AI coding workflows
Deepen your knowledge
NHI Foundation Level course, the industry's only accredited NHI security programme, covers NHI governance, machine identity security, and secrets management. It helps practitioners connect identity controls to broader security engineering decisions across modern delivery pipelines.
Published by the NHIMG editorial team on September 14, 2026.
NHI Mgmt Group — the independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org