By NHI Mgmt Group Editorial TeamDomain: AI SecuritySource: Symbiotic SecurityPublished June 3, 2026

TL;DR: 31.4% of AI-generated submissions in a coding tournament still contained vulnerabilities even when security-focused participants were trying to win, according to Symbiotic Security research, with path traversal making up 56.5% of flaws and zero-vulnerability code sometimes losing on functionality. The data shows why secure generation needs scanning in the loop, not just better prompting.


At a glance

What this is: This is Symbiotic Security’s analysis of a secure coding tournament showing that AI-generated code still frequently contains vulnerabilities, even when participants are trying to produce secure output.

Why it matters: It matters to IAM and security practitioners because AI coding systems are now part of the software supply chain, and insecure generated code can introduce access, secrets, and privilege issues before review ever begins.

By the numbers:

👉 Read Symbiotic Security’s analysis of secure AI code generation and tournament findings


Context

AI code generation creates a governance gap when speed outpaces security review. The immediate risk is not that every generated snippet is malicious, but that insecure patterns can be normalised into production code before the organisation has a chance to validate them. In this article, the primary keyword is secure AI code generation, and the core issue is how to keep generated output inside acceptable security boundaries.

That gap matters to identity practitioners because insecure code often touches authentication, authorisation, secrets handling, and service-to-service trust. When coding agents generate application logic, the resulting defects can weaken IAM controls, expose credentials, or create privilege pathways that were never intended by the engineering team.

The tournament conditions were unusually controlled, with security-conscious participants, explicit scoring penalties, and automatic scanning. That makes the result more a ceiling test than a normal deployment sample. In ordinary development workflows, the absence of those guardrails is what makes the risk more concerning, not less.


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 still produce insecure code?

A: They learn patterns from large code corpora that contain both secure and insecure examples, and they do not reliably reason about all dataflow or trust-boundary issues. Where a task requires context-sensitive security judgment, the model can produce plausible code that still mishandles input, encoding, or privilege. Better reasoning helps, but it does not replace analysis.

Q: What do organisations get wrong about secure prompting for coding agents?

A: They often assume better prompts are enough. In practice, prompts can reduce risk, but they do not replace control design, static analysis, or security thresholds. If the workflow still accepts vulnerable output, the organisation has not actually governed the generator.

Q: Should teams block AI-generated code that is secure but incomplete?

A: Yes, when incomplete output would silently fail a business requirement or create operational gaps. Security and correctness both matter. A secure endpoint that never executes its required function can be just as disruptive as an insecure one, because teams may discover the flaw only after deployment.


Technical breakdown

Why secure code generation still produces vulnerable patterns

LLM-based coding systems do not reason about security the way a reviewer or static analysis engine does. They predict likely code completions from training patterns, which means they can reproduce familiar insecure constructs such as path traversal, command injection, and weak input validation. When prompts ask for functionality under time pressure, the model tends to satisfy the task with syntactically plausible code, not necessarily safe code. That creates a mismatch between developer intent and generated implementation, especially when the prompt does not explicitly constrain trust boundaries, input handling, or dangerous operations.

Practical implication: treat generated code as untrusted until it has passed automated security checks and targeted review.

Why relative scoring hides absolute risk in AI coding workflows

A head-to-head judging model measures one submission against another, not against a security threshold. That means a submission with vulnerabilities can still win if the other submission is worse or less complete. In operational terms, this mirrors engineering environments where delivery pressure rewards the best available option, even when none of the options are secure enough to ship. The result is a governance blind spot: quality metrics can improve while security defects remain acceptable to the workflow.

Practical implication: define an absolute security acceptance bar for AI-generated code, not just a comparative performance score.

Why static analysis has to run inside the generation loop

Static application security testing works best when it is close to code creation, because the earlier a flaw is detected, the easier it is to correct the model’s output before it spreads into review, CI, and release artefacts. In this tournament, the scanner caught issues at generation time, which is materially different from finding them after commit. For identity and access teams, that timing matters because insecure code can embed weak authentication flows, insecure secret handling, or broken authorisation logic that later becomes an access-control problem.

Practical implication: move SAST and policy checks into the AI coding workflow itself, not only into downstream pipelines.


Threat narrative

Attacker objective: The attacker objective is to get insecure generated code into the software supply chain so it can be exploited later as a durable application weakness.

  1. Entry occurs through a coding agent or prompt workflow that generates application code without security-aware constraints.
  2. Escalation happens when insecure patterns such as command injection, path traversal, CSRF, or XSS are accepted into working code.
  3. Impact appears when vulnerable generated code reaches production and creates exploitable paths for data exposure, privilege misuse, or service compromise.

NHI Mgmt Group analysis

Secure AI code generation is now a governance problem, not just a developer productivity issue. If AI tools can generate vulnerable code even in a security-conscious tournament, then enterprise teams cannot rely on prompt quality alone to protect application integrity. The risk extends into IAM, secrets handling, and service trust, because insecure code often becomes the control plane for identity decisions. Practitioners should govern generated code as part of the software supply chain, not as a novelty feature.

Relative performance metrics create a false sense of safety. The tournament showed that a submission can be secure enough to score well and still be unusable, or functional enough to win and still contain exploitable flaws. That tension exposes a named concept we would call security-functionality drift: the widening gap between what code does and what code can safely do. Teams need thresholds that refuse both insecure and incomplete AI output.

Static analysis only matters if it is embedded at the point of generation. This article reinforces the practical value of scanning before code is reviewed, not after it is merged. For identity programmes, that is especially relevant where generated code touches authentication, token handling, session logic, or privileged service calls. The governance conclusion is straightforward: the earlier the scan, the smaller the blast radius.

Prompting discipline does not substitute for control design. Participants were security aware, explicitly incentivised to avoid flaws, and still produced vulnerable submissions. That is the signal the market should not ignore. The identity and application security teams that treat AI coding as a governed production capability will be better positioned than those still framing it as an individual developer skill. The practical conclusion is to pair AI-assisted coding with enforcement, not encouragement alone.

The secure coding market is moving toward runtime verification of AI output. The article points to a broader shift in which detection is becoming part of the generation workflow itself. That direction aligns with how identity governance evolved: policy without enforcement creates drift, while policy plus runtime validation creates control. Practitioners should expect future toolchains to be judged on where they intercept risk, not just whether they can identify it afterward.

What this signals

Security-functionality drift will become a recurring issue as more teams embed coding agents into delivery pipelines. The practical signal is not whether AI can write code, but whether your controls can distinguish acceptable automation from unsafe delegation. That argues for policy enforcement at the point of generation, backed by NIST AI Risk Management Framework principles for governance and measurement.

Identity teams should watch for generated code that alters authentication logic, token handling, or service-to-service trust without a corresponding control review. Once AI-generated code starts shaping access decisions, application security and IAM can no longer operate as separate governance lanes. The adjacent resource OWASP NHI Top 10 helps frame the emerging risk surface around delegated AI behaviour and misuse.

Expect security engineering teams to move toward pre-commit validation, stronger approved-pattern libraries, and stricter policy gates for AI-assisted development. The signal for practitioners is clear: the winning operating model will be one that reduces the chance of vulnerable code reaching a reviewer, not one that merely detects it later.


For practitioners

  • Scan generated code before it reaches review Integrate static application security testing into the AI coding path so that insecure output is flagged at generation time, not only in CI or after merge.
  • Set an absolute security acceptance threshold Reject AI-generated code that exceeds your defect tolerance, even if it functionally outperforms another submission or implementation.
  • Constrain prompts around trust boundaries Require prompts to specify input validation, allowlists, dangerous operation restrictions, and secret-handling rules before code generation begins.
  • Review identity-sensitive code paths first Prioritise generated code that handles authentication, authorisation, tokens, sessions, and service-to-service calls because those defects become access-control failures.

Key takeaways

  • AI coding systems can still generate exploitable defects even when users are security conscious and actively trying to avoid them.
  • The tournament’s 31.4% vulnerability rate and 56.5% path-traversal share show that the problem is structural, not anecdotal.
  • Teams need generation-time scanning, absolute security thresholds, and identity-aware review of code paths that handle access and secrets.

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 address the attack and risk surface, while NIST AI RMF, 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
OWASP Agentic AI Top 10AI-generated code and prompt-driven tooling raise agentic security risks in development workflows.
NIST AI RMFGOVERNGovernance and accountability are central when AI systems generate production code.
NIST CSF 2.0PR.IP-1Secure development processes are directly implicated by generated code vulnerabilities.
NIST SP 800-53 Rev 5SA-11Security testing and verification are needed before AI-generated code is accepted.
CIS Controls v8CIS-16 , Application Software SecurityApplication security controls map directly to insecure AI-generated code paths.

Apply agentic AI controls to constrain dangerous code generation and validate output before merge.


Key terms

  • Secure AI Code Generation: The use of AI tools to produce application code under constraints that aim to preserve security, correctness, and maintainability. In practice, it requires more than prompting skill. It depends on validation, policy enforcement, and review mechanisms that stop unsafe code from reaching production.
  • Security-functionality Drift: The gap between code that works and code that is safe to ship. AI-generated output can satisfy a prompt or compile successfully while still introducing vulnerabilities, incomplete behaviour, or hidden assumptions. The drift becomes more dangerous when teams reward speed without measuring security acceptance.
  • Generation-time Scanning: Security scanning that runs while code is being produced, rather than after commit or in a downstream pipeline. This approach shortens feedback loops and reduces the chance that vulnerable AI-generated code will move into review, integration, or release stages before defects are caught.

What's in the full report

Symbiotic Security's full research post covers the operational detail this post intentionally leaves for the source:

  • Round-by-round submission patterns, including which challenge types produced the highest vulnerability counts.
  • The judging rubric and session mechanics used to score secure output versus functional output.
  • Examples of prompt strategies that led to zero-vulnerability submissions and where they still failed functionally.
  • The workshop and gameplay details behind the secure coding tournament methodology.

👉 The full Symbiotic Security post covers the round-by-round results, scoring mechanics, and secure prompt examples.

Deepen your knowledge

The NHI Foundation Level course, the industry's only accredited NHI security programme, covers NHI governance, machine identity security, secrets management, and agentic AI identity. It helps security and identity practitioners build the control model that AI-assisted development now requires.
NHIMG Editorial Note
Published by the NHIMG editorial team on August 19, 2026.
NHI Mgmt Group — the independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org