TL;DR: Vibe coding security is emerging as a workflow problem, not just a code-quality issue, because AI-generated code can ship insecure patterns, exposed secrets, risky dependencies, and weak access logic before review happens, according to Xygeni. The governance gap is that “it works” no longer proves the code, the dependencies, or the agent’s instructions were safe.
At a glance
What this is: This is an analysis of vibe coding security and its key finding that AI-assisted development bypasses the review checkpoints AppSec depends on.
Why it matters: It matters because the same workflow that speeds delivery can also accelerate secret exposure, dependency risk, and access-control flaws across human, machine, and AI-assisted development programmes.
By the numbers:
- Only 44% of developers are reported to follow security best practices for secrets management, exposing a significant developer behaviour gap.
👉 Read Xygeni's analysis of vibe coding security and AI-assisted development risk
Context
Vibe coding security is the governance challenge that appears when developers rely on AI-generated code and agentic tooling to move faster than human review can keep up. The primary failure is not that AI writes code, but that the workflow often treats generated output as trusted before it has been checked for insecure logic, exposed secrets, dependency abuse, or access-control gaps.
That matters across AppSec, IAM, PAM, and NHI programmes because the same development path can create weak authentication, over-broad permissions, and secret sprawl in one sprint. In practice, the starting position described in the article is becoming typical rather than exceptional: professional teams are normalising AI-assisted code generation before they have normalised the controls around it.
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 AI coding agents complicate secrets management?
A: AI coding agents complicate secrets management because they combine prompting, execution, and environment setup in one workflow. If secrets are copied into prompts, .env files, or repositories, they become easy to duplicate and hard to audit. The problem is not the agent alone, but the speed at which it can spread access material across tools.
Q: What do organisations get wrong about scanning AI-generated code?
A: The common mistake is treating more scanning as a complete answer. In reality, high-volume findings create noise unless teams can prioritise exploitability, exposure, and business impact. Organisations also miss the governance layer, where AI tools and agents need ownership, permission boundaries, and auditable actions.
Q: How should organisations govern coding agents that can modify code and config?
A: They should treat them like privileged systems that need scoped access, auditability, and explicit approval boundaries. The safest model is to restrict what the agent can read, install, and execute, then require human review for any file that can influence runtime behaviour. In identity terms, the agent is not a casual user; it is a governed non-human actor.
Technical breakdown
Why AI-generated code breaks traditional AppSec timing
Traditional AppSec assumes code is written first and evaluated later in a stable pipeline. Vibe coding shortens that window so much that insecure logic can move from prompt to commit before a scanner or reviewer sees it. The problem is not only the model’s output quality, but the timing mismatch between generation, review, and deployment. Security controls built for slower, human-authored change struggle when the artefact appears in seconds and is immediately reused by other features.
Practical implication: move detection and policy checks into the IDE and treat generated code as untrusted until it passes control gates.
Secrets, dependencies, and config files are part of the attack surface
AI coding tools do not just write functions. They also select libraries, touch configuration, and may follow instruction files that shape behaviour outside the visible code diff. That means hardcoded secrets, slopsquatted dependencies, permissive defaults, and attacker-controlled instructions can all enter the workflow without a normal review path. In identity terms, these controls affect both human access decisions and non-human identity exposure, because tokens, keys, and tool permissions are often the first thing an agent can abuse.
Practical implication: extend review and validation to dependencies, rules files, and MCP-style tool configs, not only to source code.
Why “it works” is not a security control
A passing test or a successful build only proves the code satisfied the prompt or scenario that was exercised. It does not prove the code rejects malformed input, limits access correctly, or avoids leaking credentials. That gap is especially dangerous in AI-assisted development because the system can generate vulnerabilities at scale while still producing apparently functional output. Security failure then accumulates silently across releases until the first real abuse case exposes the weakness.
Practical implication: define security acceptance criteria separately from functional acceptance criteria and make both visible to developers before merge.
Threat narrative
Attacker objective: The attacker objective is to turn trusted development workflow shortcuts into unauthorized access, secret exposure, or downstream compromise.
- Entry begins when a developer or agent introduces AI-generated code, a package, or a configuration file that has not been security-reviewed at generation time.
- Credential access or abuse follows when the generated workflow hardcodes secrets, trusts inherited permissions, or accepts a dependency that expands the attacker’s reach.
- Impact occurs when insecure code, exposed secrets, or malicious instructions reach production and enable theft, unauthorized access, or broader compromise.
NHI Mgmt Group analysis
Vibe coding security is really an identity governance problem as much as an AppSec problem. Once AI tools can create code, choose dependencies, and touch config files, the question shifts from code quality to who or what is authorised to change production behaviour. That is where IAM, PAM, and NHI controls meet development workflow. Teams need to govern the permissions, approvals, and review checkpoints around the AI-assisted path, not just the repository after the fact.
“It works” has become a dangerous security proxy because it collapses functional success into security approval. The article describes a control gap that most teams already recognise in other forms: passing output is not proof of safe behaviour. In a world of AI-generated changes, the organisation must separate build success from security trust. Practitioners should treat that separation as a policy requirement, not a cultural preference.
Instruction files and tool configs are now part of the software attack surface. Rules files, skill files, and MCP configurations can redirect what an agent does without a visible source-code diff. That creates a named governance gap we can call prompt-to-production trust leakage: instructions written for convenience becoming implicit authority in the delivery pipeline. Security teams should classify these files as controlled assets, not documentation.
AI-assisted development increases the blast radius of weak secret hygiene. The same workflow that writes code can also copy, hardcode, or propagate credentials into places developers do not notice. In a post where secrets, dependencies, and agent permissions interact, OWASP NHI and IAM governance are no longer separate conversations. The practitioner conclusion is simple: if the agent can touch secrets, it needs lifecycle control, not informal trust.
AppSec programmes will need to measure review integrity, not just scan coverage. Scanning more code after merge does not solve a workflow that already normalises skipped review. Security leaders should measure where AI-generated changes are introduced, who approved them, and whether the agent’s permissions were constrained at the point of generation. The control objective is governed change, not more alert volume.
What this signals
Prompt-to-production trust leakage: the operational risk is not just that AI writes flawed code, but that instructions, dependencies, and permissions gain implicit authority before they are governed. Security leaders should expect this pattern to merge AppSec, NHI, and IAM controls into a single workflow problem.
The practical signal is that review integrity will matter more than raw scan volume. Teams that still rely on post-commit scanning will see more late findings, while teams that constrain agent permissions and validate instructions at generation time will have a smaller blast radius when something goes wrong.
For practitioners
- Move security gates into the IDE Run policy, secret, and dependency checks while the AI is still generating the change, before the code becomes part of the next commit or feature branch.
- Classify agent-read files as controlled inputs Treat rules files, skill files, and MCP configuration files as security-relevant artefacts that require review, approval, and change tracking.
- Constrain agent permissions to the minimum workflow scope Limit repository, install, and execution access so coding agents cannot silently expand their reach across projects, package registries, or secrets stores.
- Validate every dependency introduced by an assistant Require provenance checks, allowlisting, and malicious-package screening before any AI-selected library is installed or merged.
Key takeaways
- AI-assisted development changes the security question from whether code runs to whether the workflow that produced it was governed.
- Secrets, dependencies, and config files now sit inside the same risk path as source code when agents can modify all three.
- The strongest control pattern is to move review, validation, and permission scoping back to the point of generation.
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 and 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.
| Framework | Control / Reference | Relevance |
|---|---|---|
| OWASP Non-Human Identity Top 10 | NHI-03 | Generated code and secrets exposure map directly to non-human identity and secret lifecycle risk. |
| NIST CSF 2.0 | PR.AC-4 | The article centres on access control gaps created by over-broad agent permissions and weak review. |
| NIST SP 800-53 Rev 5 | IA-5 | Secret handling and authenticator management are central to the exposed credential risk described here. |
| CIS Controls v8 | CIS-5 , Account Management | Agent permissions and developer access governance are part of the account management problem here. |
| MITRE ATT&CK | TA0006 , Credential Access; TA0009 , Collection | The threat path includes secret exposure and collection through generated code and dependencies. |
Review machine and developer account scope under CIS-5 before allowing AI tools broad repository access.
Key terms
- Vibe Coding: A software development approach where natural-language prompts drive much of the implementation and AI produces the code. In practice, the term covers a wide range of control levels, from no-review prototyping to structured engineering with tests, review, and architecture held by humans.
- Prompt-to-Production Trust Leakage: A governance gap where instructions, agent behaviour, and generated artefacts gain implicit trust as they move from prompt to deployed code. It matters because security controls may only review the final output, while the real decision-making has already happened earlier in the workflow.
- Agent-Expanded Attack Surface: The wider set of risks created when an AI coding agent can read, write, install, or execute across a development environment. It includes source code, dependency selection, configuration files, and secrets stores, making the agent’s permissions part of the security boundary.
- Instruction File Abuse: A failure mode where rules files, skill files, or tool configuration quietly alter what an AI agent does without a visible source-code change. Because these files can shape behaviour, they should be governed like code and reviewed with the same level of scrutiny.
What's in the full article
Xygeni's full article covers the operational detail this post intentionally leaves for the source:
- The workflow checkpoints the vendor says should move into the IDE before code reaches pull request review.
- The practical breakdown of how generated code, dependency choice, and instruction files expand the AppSec attack surface.
- The specific Xygeni DevAI and MEW detection workflow described for inline remediation and malicious package warning.
- The implementation detail behind treating AI-generated code as untrusted input across the development lifecycle.
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 security practitioners connect identity controls to the workflows that now include AI-assisted development.
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