TL;DR: AI-assisted development is now mainstream, with GitHub reporting that 92% of developers use AI coding tools and many organisations generating 40% or more of new code with AI, according to LEGIT Security. Traditional AppSec controls were built for post-commit review, but AI code generation at the developer endpoint creates traceability, enforcement, and audit gaps that require pre-commit governance.
At a glance
What this is: This is an analysis of why AI-generated code creates audit and governance gaps for AppSec, especially when security controls only trigger after code is committed.
Why it matters: It matters to IAM practitioners because AI-assisted development introduces endpoint-based policy enforcement, evidence capture, and accountability problems that intersect with identity, access, and governance controls across human and machine actors.
By the numbers:
- 92% of developers now use AI coding tools, according to GitHub.
- AI-generated code contributes to 40% or more of new code in many organisations, according to LEGIT Security.
- 68% of developers use unapproved AI tools for work tasks, according to a recent survey cited by LEGIT Security.
👉 Read LEGIT Security's brief on AI-generated code audit questions and governance gaps
Context
AI-generated code changes the security problem because the point of creation has moved from the repository to the developer endpoint. Traditional AppSec programmes assume code can be reviewed, scanned, and audited after commit, but AI assistance introduces hidden authorship, weaker traceability, and policy enforcement problems before conventional controls ever see the code. For identity and governance teams, the relevant question is not only who can access tools, but how AI-assisted actions are authenticated, authorised, and evidenced.
The governance gap is not that AI cannot be controlled. It is that many controls were designed for a human-written SDLC and now sit too far downstream to prove enforcement. That creates a mismatch for auditability, compliance, and accountability, especially where developers use AI systems through their own identities and where machine-generated output enters the codebase with incomplete provenance.
Key questions
Q: What breaks when AI-generated code is only checked after commit?
A: Post-commit controls miss the moment when risky code is created, so secrets, insecure patterns, and policy violations can enter the repository before security ever sees them. That makes audit evidence incomplete and weakens defensibility. The practical failure is timing, because detection after commit cannot prove that policy was enforced at generation time.
Q: Why do AI coding agents create different governance risks from normal developer tools?
A: AI coding agents combine code execution, context persistence, external tool access, and memory across sessions. That makes them governed identity actors with a wider blast radius than a standard editor or plugin. The risk is not just what they generate, but what they can read, retain, and trigger on behalf of the developer.
Q: How do security teams know if AI governance is working?
A: Look for evidence that access decisions are reviewable, permissions are revocable, and exceptions are not becoming permanent. If the team cannot explain who owns an AI workflow, what it can reach, and when its access was last reviewed, governance is incomplete. Control maturity shows up in traceability, not adoption volume.
Q: Who is accountable when AI output causes a compliance or legal issue?
A: Accountability sits with the organisation that deploys and governs the AI use case, not only with the vendor that hosts the model. If an employee or agent uses AI in a business context, the enterprise must be able to show policy, monitoring, and evidence of control. That is now a governance obligation, not optional hygiene.
Technical breakdown
Why post-commit AppSec controls miss AI-generated code
Traditional application security assumes a linear path from human authorship to repository commit, then to CI, scanning, and runtime enforcement. AI-assisted development breaks that sequence by generating code in the IDE or browser before code review ever begins. If hardcoded secrets, vulnerable patterns, or licensing issues are introduced at generation time, post-commit controls can only detect them after exposure has already occurred. The architectural issue is timing, not tool coverage. Security telemetry that arrives after commit cannot reconstruct prompt context, policy checks, or the model interaction that created the code.
Practical implication: Shift control points left to the developer endpoint so policy checks happen before code enters the repository.
How audit evidence changes when code has mixed human and AI authorship
Auditability depends on being able to show what happened, who approved it, and which policy applied. With AI-assisted code, commit history no longer tells the whole story because the developer may not have written the relevant logic and may not fully understand the generated context. That creates provenance gaps between intent, generation, and approval. In practice, security teams need evidence at the moment of generation, including prompt context, policy evaluation, and user action, so the record is defensible during SOC 2, internal audit, or regulatory review.
Practical implication: Collect generation-time evidence that ties code creation to a specific user, policy decision, and audit trail.
What pre-commit governance means in an AI-assisted SDLC
Pre-commit governance is a control model that evaluates AI-generated output before it becomes part of the codebase. It combines endpoint visibility, inline policy enforcement, and automatic evidence capture into a single workflow. That means the system can flag restricted patterns, block disallowed output, and preserve the record needed for later assurance. This is especially relevant where developer identities are the enforcement boundary, because governance has to follow the human session and the AI interaction rather than relying on repository-based controls alone.
Practical implication: Define enforceable policies for AI coding tools and verify they operate at the developer endpoint, not only in CI.
NHI Mgmt Group analysis
AI-generated code creates an auditability gap, not just a code-quality problem. The central failure is the assumption that commit history is enough to prove governance. Once AI can generate code at the endpoint, the evidence trail splits between the developer identity, the model interaction, and the repository artifact. Security teams should treat AI-assisted development as a provenance problem that affects assurance, not just a productivity feature.
Pre-commit governance is the right control boundary for AI-assisted development. Post-commit scanning still matters, but it no longer satisfies the need to prove enforcement before risky material enters the codebase. That shifts the control conversation toward runtime policy decisions at the IDE or browser, where identity, intent, and output can be linked in one event. Practitioners should align this with NIST CSF 2.0 and, where privileged development workflows are involved, identity and access controls that can evidence who authorised the action.
Shadow AI in development is now an access-governance issue. The article's 68% unapproved-use figure shows that tool sprawl is already happening outside formal approval paths. That creates an identity bridge problem because developers can use sanctioned accounts to drive unsanctioned AI interactions, leaving governance blind to the actual system of record. Teams should expect audit questions about tool approval, authorisation scope, and evidence of policy enforcement.
AI-assisted development needs a named control concept: generation-time provenance. This is the point where code, prompt context, policy evaluation, and user action are bound together before commit. Without generation-time provenance, organisations can neither prove policy enforcement nor reliably reconstruct the origin of a defect. Practitioners should treat this as a core governance requirement for modern software assurance.
Compliance pressure will move AppSec earlier in the SDLC. Once auditors start asking for evidence of AI governance, teams that rely only on repository scanning will be forced into reactive explanations. The likely trajectory is broader demand for endpoint controls, automated evidence capture, and measurable policy adherence. Practitioners should prepare for assurance models that expect real-time governance rather than after-the-fact inspection.
What this signals
Generation-time provenance will become a baseline expectation for organisations that let AI write code. Once auditors ask for evidence of policy enforcement, teams will need controls that tie the developer identity, the AI interaction, and the resulting artefact together in one record. That is an identity and governance problem as much as an AppSec problem, because the control boundary now sits at the endpoint where the human and machine interactions converge.
The governance signal is clear: scanning alone is no longer enough for AI-assisted development. Teams that can prove authorised tools, policy enforcement at generation time, and complete evidence trails will be better positioned for audit and internal assurance. Those that cannot should expect more manual exceptions, more audit friction, and greater pressure to adopt endpoint-level control models such as those aligned with NIST Cybersecurity Framework 2.0.
For practitioners
- Implement pre-commit AI governance at the developer endpoint Enforce policy checks where AI code is generated, not only in repositories or CI, so risky output can be blocked before commit. Pair that with endpoint telemetry that records which user and which tool produced the event.
- Create an auditable inventory of AI coding tools Maintain an approved-tool register and detect unauthorised assistants used in IDEs, browsers, and local workflows so shadow AI does not bypass governance.
- Capture generation-time evidence for every AI-assisted change Log prompt context, policy evaluation, user action, and generated output together so internal audit and external assurance can reconstruct the decision path.
- Measure compliance at the point of generation Track the percentage of AI-generated code auto-approved under policy, the time to policy compliance, and the rate of blocked violations to show whether controls are actually working.
Key takeaways
- AI-assisted development exposes a control gap because security teams cannot prove governance if enforcement starts only after code is committed.
- The evidence problem is as important as the code problem, because auditors now want proof of who used AI, what policy applied, and what was blocked.
- Pre-commit governance at the developer endpoint is the practical response, because it creates the only defensible audit trail for AI-generated code.
Standards & Framework Alignment
This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.
NIST CSF 2.0, NIST SP 800-53 Rev 5 and CIS Controls v8 set the technical controls, while ISO/IEC 27001:2022 define the regulatory obligations.
| Framework | Control / Reference | Relevance |
|---|---|---|
| NIST CSF 2.0 | PR.AC-4 | AI-assisted development changes how access and enforcement are proven in the SDLC. |
| NIST SP 800-53 Rev 5 | AU-2 | Auditability depends on complete records for AI-assisted code generation. |
| CIS Controls v8 | CIS-5 , Account Management | Authorised developer access to AI tools must be governed, not assumed. |
| ISO/IEC 27001:2022 | A.5.15 | Policy enforcement for AI-assisted development maps to access control governance. |
Capture generation-time events under AU-2 so AI-assisted development leaves a defensible audit trail.
Key terms
- Pre-commit Governance: A control model that evaluates code, prompts, and policy decisions before software changes are committed to a repository. It shifts security from after-the-fact scanning to generation-time enforcement, which is essential when AI can produce code outside traditional review points.
- Generation-time Provenance: The evidence that shows how AI-assisted output was created, what context was provided, and which policy checks were applied at the moment of generation. It gives auditors and security teams a defensible record when code authorship is mixed between humans and AI systems.
- Shadow AI: AI agents, copilots, or connected tools operating without full visibility or governance from security teams. Shadow AI becomes an identity problem when those systems authenticate with unmanaged tokens, service accounts, or OAuth apps that can reach production resources.
- AI-assisted development: A development workflow where an AI system helps generate, refactor, test, or execute code inside the software delivery process. The security issue is not the assistance itself, but that the tool may operate in trusted contexts that also contain credentials, infrastructure access, and other sensitive assets.
What's in the full article
LEGIT Security's full brief covers the operational detail this post intentionally leaves for the source:
- Representative audit question sets for AI-generated code, including visibility, policy enforcement, and traceability checks
- The pre-commit governance workflow and the evidence elements captured at the developer endpoint
- Practical examples of how leading teams measure AI-generated code compliance over time
- The vendor's technical architecture guide for integrating endpoint governance into SDLC workflows
Deepen your knowledge
The NHI Foundation Level course, the industry's only accredited NHI security programme, covers NHI governance, secrets management, and identity lifecycle controls that underpin modern access assurance. It helps practitioners build the governance foundation needed to manage human and machine identities across evolving security programmes.
Published by the NHIMG editorial team on August 18, 2026.
NHI Mgmt Group — the independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org