Vibe Coding Agent
Security & Evaluation
Software engineering is undergoing its biggest transformation since high-level languages — from writing code to expressing intent. But an agent that passes every security check may still have misunderstood everything. This is the definitive framework of 2026.
Figure 1 · The Secure Vibe Coding Agent Framework — architecture overview
Authors: Sokratis Kartakis · Aron Eidelman · Wafae Bakkali · Meltem Subasioglu — Google, 2026
From syntax to intent
The biggest transformation since high-level languages: trusting intelligent systems to translate intent into working software.
Software engineering is undergoing its most significant transformation since the introduction of high-level languages. The deepest shift is the transition from writing code to expressing intent — trusting intelligent systems to translate that intent into working software. This new paradigm spans a spectrum: from casual "vibe coding", where the developer describes what they want in natural language and accepts whatever the AI generates, to disciplined "agentic engineering", where the AI acts as an implementation engine within carefully designed constraints.
🔒 Binary trust (deterministic software)
The code compiles ✓ · the tests pass ✓ · the static credentials are valid ✓. If everything is green, the system is trustworthy. Simple and predictable.
🤖 Ambient agency (agentic system)
An autonomous workforce possesses the ambient agency to execute generated code, access sensitive internal APIs, and dynamically modify production environments. Binary trust is not enough.
To operationalize vibe coding in the enterprise, we need to redefine trust along two distinct axes:
🛡️ Security
- Did the agent stay within the boundaries?
- Did it operate safely and without malicious intent?
- Did the "safety harness" contain the blast radius?
📊 Evaluation
- Is what happened within the boundaries worth shipping?
- Did the agent achieve the user's nuanced intent?
- Does the "glass box" reveal quality reasoning?
A vibe-coded agent can pass every security check and still fundamentally misread the developer's intent, ignore project conventions, or silently degrade the user experience.
This whitepaper provides the definitive 2026 framework for both: establishing the strict "safety harness" needed to protect non-deterministic agents, and opening the "glass box" to rigorously measure the quality, efficiency, and alignment of internal reasoning.
The evolution: why traditional security fails
We are no longer protecting web apps — we are protecting a non-human workforce with ambient agency.
"Adversaries have moved beyond the simple use of large language models to draft phishing content and are now deploying adaptive tools capable of rewriting code." — Mandiant special report for Google Cloud, 2026.
Intent-driven development drastically accelerates innovation, but introduces unprecedented security vulnerabilities. We are no longer simply protecting web applications against traditional exploits — we are tasked with protecting a non-human workforce that possesses the ambient agency to execute generated code, access sensitive internal APIs, and dynamically modify production environments.
Traditional software testing and security models rely on deterministic logic, where a fixed set of inputs produces a predictable output. However, in an agentic system, an agent may hold a valid access token yet operate autonomously with misaligned intent. A critical realization: a raw AI model is NOT an agent. It only becomes one when wrapped in a "harness" — the scaffolding that gives it state, tool execution, feedback loops, and enforceable constraints. Securing this new paradigm requires shifting focus from protecting code syntax to protecting the harness.
In this fluid, non-deterministic environment, static identity acts as a poor perimeter. Trust cannot be a gate the agent passes once at deploy — it must be continuously earned, verified, and dynamically enforced based on runtime context. We define this continuous assurance as Effective Trust — a continuous metric evaluated across 4 factors: supply chain, identity, runtime behavior, and contextual associations.
To achieve this continuous Effective Trust and protect the chaotic reality of vibe coding, we developed a layered defence-in-depth architecture: a strict 7-pillar baseline, extended by high-velocity execution controls, and crowned by active agentic defense mechanisms.
The foundation: 7 Security Pillars
From Identity-as-a-Perimeter (RBAC) to Context-as-a-Perimeter — a "safety envelope" external to the AI.
In traditional enterprise environments, security is deterministic. Applications rely on predictable code syntax, and access is governed by static Identity-as-a-Perimeter models, such as RBAC. If a user or service account has the correct authorization token, the system implicitly trusts the execution path.
The agentic environment fundamentally breaks this model. Since everyday agent failures often trace back to a missing tool, a vague rule, or a nonexistent guardrail, organizations must migrate to a "Context-as-a-Perimeter" model. Since we must assume the underlying model can fail or be compromised, security cannot reside solely in the AI — we need to apply a strict, external "safety envelope" spanning multiple disciplines.
1 · Infrastructure
Kernel-level sandboxes (gVisor) + strict egress governance
2 · Data
CMEK + mTLS + least privilege + tenant partitioning in Vector DBs
3 · Model
Prompts and rule files as the new source code — cryptographically attested artifacts
4 · Application & Runtime
LLM firewalls + deterministic hooks + Agent Gateways (A2A bouncers)
5 · IAM
SPIFFE IDs + ABAC + JIT downscoping → Intent × User × Time
6 · Observability & SecOps
Red/Blue/Green Triad + OpenTelemetry + Agent Behavioural Analytics
7 · Governance
EU AI Act · Algorithmic Impact Assessments · immutable audit trail · Logic Reviews · Risk-Stratified Attestation
Pillars 1–3: Infrastructure, Data, Model
The foundation, the walls, and the blueprint of the house: a fenced lot, internal vaults, and rules about what is forbidden to build.
Pillar 1 — Infrastructure & Networking
Cloud Infrastructure Engineers must protect the foundational environment against upstream poisoning and container escapes. Since the harness must dictate where the agent's code actually runs and what it cannot reach, we isolate runtime execution inside kernel-level ephemeral sandboxes (such as gVisor). In addition, strict network egress governance ensures that agent-generated data travels only through authorized offline caches or explicit internal proxies, preventing inadvertent public exfiltration.
Pillar 2 — Data
Data Architects face the threat of agents leaking sensitive information from their context windows or ingesting poisoned RAG data. The practice of "context engineering" provides agents with rich, structured information about codebases and intent. To protect this sensitive context: data at rest is protected with Customer-Managed Encryption Keys (CMEK), data in transit via mutual TLS (mTLS). Data access must be strictly scoped to enforce the principle of least privilege. Crucially, long-term memory stores — particularly Vector Databases — must enforce strict tenant partitioning to prevent Cross-Tenant Vector Poisoning: a malicious payload ingested by one tenant cannot be retrieved during another tenant's similarity search.
Pillar 3 — Model
AI Engineers must defend the application's core logic against semantic attacks that subvert the model's instructions. In agentic workflows, the prompt and the "Instructions and Rule Files" that define what the agent is forbidden to do serve as the new source code. Protecting this pillar requires treating the model's system instructions and prompt templates as highly sensitive, cryptographically attested artifacts.
Pillars 4–7: Application, IAM, Observability, Governance
From the runtime to the boardroom: LLM firewalls, ephemeral identities, the SecOps triad and the EU AI Act.
Pillar 4 — Application & Runtime
Agents operate interactively — traditional rules-based firewalls are insufficient. We deploy LLM firewalls for dynamic prompt and response filtering, along with deterministic "hooks" that run at specific points in the lifecycle (before a tool call, after a file edit). Centralised Agent Gateways act as the "bouncers of the ecosystem", governing Agent-to-Agent (A2A) orchestration to prevent unauthorized lateral movement.
Pillar 5 — Identity & Access Management
The main risk is the "Confused Deputy": an over-privileged agent is tricked into executing unauthorized commands. We solve this by assigning unique cryptographic identities (SPIFFE IDs) to each agent. Access depends on Attribute-Based Access Control (ABAC) and Just-In-Time (JIT) token downscoping, enforcing a strict permission matrix of Intent × User × Time — agents receive fresh, hyper-restricted credentials that expire immediately after the task completes.
Pillar 6 — Observability & Security Ops
SecOps must combat "invisible failures" where an agent silently cascades into an infinite reasoning loop. Without observability — logs, traces and metering — there is no way to know whether an agent is performing well or silently drifting. We solve this by deploying an autonomous SecOps triad: the Blue Team uses OpenTelemetry and Agent Behavioural Analytics (ABA), the Red Team proactively simulates multi-hop attacks, and the Green Team executes "Stateful Quarantines" if an anomaly is detected.
Pillar 7 — Governance
Governance Officers must ensure that autonomous decisions meet rigorous regulatory standards. Beyond traditional data frameworks, governance must now strictly adhere to the EU AI Act, mandating Algorithmic Impact Assessments for high-risk autonomous agents. Organizations must create an immutable audit trail that strictly attributes every real-world action to a specific agent and to the human who deployed or approved it. We replace simple approval buttons with mandatory "Logic Reviews" (translating complex syntax into plain language) and use Risk-Stratified Attestation to bind digital signatures to the agent's outputs.
With the 7 pillars established, the modern developer transitions from a line-by-line executor to a conductor — orchestrating specialized agents like an orchestra, where each instrument has its role, but the symphony only works under precise direction.
Sandboxes and the "Vibe Loop"
Write → execute → read errors → rewrite: the high-speed iterative cycle that demands total isolation.
The core mechanism of vibe coding relies on dynamically translating human intention into executable logic on the fly. However, vibe-coded agents rarely write perfect code on the first attempt. The reality of intent-driven development is a high-speed iterative cycle: the agent writes a script, executes it, reads the resulting error logs and autonomously rewrites the logic until it aligns with the user's "vibe". Because this generative process introduces high variability, the resulting code cannot be implicitly trusted. Running these dynamically generated scripts directly alongside the root agent or on standard host infrastructure introduces an unacceptable level of risk.
Any skill-generated code must first execute inside an ephemeral, network-isolated sandbox. Sub-agents designed to run untrusted code or invoke tools must run in hardened environments — dedicated containers, VMs or kernel-level environments like gVisor. Crucially, these sandboxes are not merely "prisons" for malicious payloads: they must actively block raw access to the host and completely reset their state between executions. Even if a vibe-coded script contains a severe vulnerability or is manipulated to attempt a container escape, the compromised logic cannot persist nor impact the underlying host node.
The ephemeral sandbox is like a test room that self-destructs and rebuilds from scratch with every experiment — if the experiment blows up, the next one starts in a brand-new room.
Slopsquatting and Egress Governance
LLMs hallucinate packages that don't exist — and attackers publish malware under those exact names.
Agentic code generation introduces a highly specific and dangerous supply chain vulnerability: LLMs frequently hallucinate software packages that don't exist. Malicious actors actively monitor developer forums and AI outputs for these hallucinations, proactively publishing malware under those exact, fabricated names. Because autonomous agents can alter dependency graphs without human confirmation, a single hallucination can pull malware directly into the build environment.
Attackers actively exploit the tendency of LLMs to hallucinate dependency names: they upload malicious packages using those fabricated names so that automated agents inadvertently download them — a technique Wiz calls "slopsquatting". Agents must fetch dependencies exclusively from vetted providers or internal enterprise registries, with strict cryptographic version pinning. CI/CD must automatically verify SBOM entries and digital signatures before any artifact advances to production, via Binary Authorisation.
While kernel-level isolation protects the host infrastructure, organizations must also secure the network boundary. In traditional software, outbound traffic is highly predictable. In vibe-coded systems, egress is non-deterministic because it is driven by the dynamic use of newly generated tools. A common failure mode: the agent inadvertently attempts to push unverified code to live environments or exfiltrate sensitive data. However, relying on a simple allowlist of approved domains is insufficient — an allowlist cannot protect an agent against indirect prompt injections hidden in third-party web pages.
To mitigate this risk, agents must be restricted to non-interactive internet access. Administrators must force the agent to fetch external information exclusively through offline caches or dedicated, pre-sanitized web-crawling services. By forcing all data to travel strictly through governed paths, organizations prevent the agent from interacting directly with malicious payloads or inadvertently downloading typosquatted packages.
Application Vulnerabilities and IDE vs CI/CD
AI-generated code fails in two predictable ways: it over-trusts the browser and leaves the backend wide open.
A perfect sandbox does not prevent an agent from writing fundamentally flawed code or connecting to a malicious internal tool. Vibe coding inherently prioritizes immediate functionality over secure design — the generated applications frequently contain severe structural flaws. Users often implicitly trust generated code simply because it compiles and runs without errors, blind to the fact that the application may have completely bypassed standard backend security controls.
🌐 Failure 1: Over-trusts the browser
AI takes the path of least resistance: sensitive operations on the frontend. API keys, password validation and session flags right on the client side. Anyone with browser devtools can read credentials or manipulate access level without a real password.
🔓 Failure 2: Wide-open backend
Build speed outweighs setup of invisible layers. AI connects databases and creates admin dashboards, but rarely enables default-deny controls. Row-level database security is skipped — private and staging data exposed on the public internet.
To catch these structural flaws, we need to balance developer speed with strict security enforcement. Aggressively trying to block unsafe prompts directly in the IDE is easily bypassed and causes excessive friction. Instead: "shift left" via Developer Advisory Linters in the IDE (real-time guidance), while non-negotiable enforcement is pushed to deterministic checks in the CI/CD pipeline. Integrating SAST (Static Application Security Testing) and SCA (Software Composition Analysis) into the pipeline ensures that all generated application logic is deterministically scanned for vulnerable dependencies and structural flaws before reaching production.
MCP Spoofing and Contextual Authorization
Forged servers pose as legitimate MCP tools — and autonomous agents execute malicious commands before any human intervention.
Once the vibe-coded application logic is deployed, security controls must govern how the agent interacts with external systems. Agents increasingly rely on tool coordination frameworks, such as the Model Context Protocol (MCP), which allow them to discover and connect to external or internal enterprise servers at runtime.
A forged or compromised server can pose as a legitimate MCP tool to inject payloads or demand excessive privileges. Because agents operate autonomously, they may execute malicious commands provided by these spoofed servers before any human intervention.
To secure Agent-to-Tool and Agent-to-Agent (A2A) orchestration, organizations must deploy a runtime LLM firewall in front of the active agent to dynamically intercept opportunistic prompt injections. In addition, a Centralised Agent Gateway must evaluate Contextual Authorization — acting as the enforcer of the "Association" trust factor, dynamically verifying whether the agent's request to call a tool aligns perfectly with the developer's original intent.
By routing all invocations through this governed entry and exit point, the architecture prevents unauthorized lateral movement when an agent attempts to connect with internal tools.
By routing all tool invocations through a Centralised Agent Gateway, we successfully limit the agent's ability to execute unauthorized actions in the runtime pillar. However, the integrity of these decisions ultimately depends on how we verify the actor behind the agent, manage credentials under pressure and establish human control over high-risk actions. This shifts the security boundary from application orchestration to cryptographic identity verification and the mechanics of human authorization.
Identity, Confused Deputy and Zero Ambient Authority
Each agent needs a unique cryptographic identity — and must never inherit the developer's full privileges.
Because developers often use vague or highly abstracted natural language to generate code (for example, "fix the backend routing"), the resulting agentic workflows are inherently broad. Granting these autonomous agents shared, long-lived service identities creates an uncontrollable insider threat vector. To secure this pillar, organizations must assign unique cryptographic identities (such as SPIFFE IDs) to each individual agent.
The Confused Deputy and Delegated vs. Agentic Identity
Even with a unique identity, a vibe-coded agent remains highly susceptible to the Confused Deputy problem. This occurs when a prompt injection — such as a malicious instruction hidden inside an open-source repository that a developer unknowingly pasted into the IDE's context window — tricks an over-privileged agent into executing an unauthorized command on the attacker's behalf.
❌ Delegated human credentials
- Agent operates under the user's identity
- Dangerous ambient access — inherits everything
- Audit logs don't distinguish human from agent
✅ Dedicated agentic identity
- Agent authenticates with an identity explicitly marked as agentic
- Strictly scoped and observable permissions
- Granular per-agent audit logs
To resolve this, an agent must never be the final arbiter of access. A distinct, observable agentic identity ensures that its permissions remain strictly scoped and subject to granular audit logs.
Zero Ambient Authority and JIT Downscoping
Building on this, the architecture must enforce Zero Ambient Authority. An agent executing a "vibe" must never inherit the developer's full administrative privileges and environments. Instead, the system relies on Just-In-Time (JIT) token downscoping.
When an agent dynamically writes a new script or skill to solve a task, the execution sandbox receives fresh, hyper-restricted credentials explicitly scoped to the exact data sources needed for that specific script — instead of inheriting the broad permissions of the parent agent. Administrators must enforce file-tree allowlists that confine read and write operations to specific project directories, using deny-by-default rules to block access to secrets, build scripts and production manifests. These downscoped tokens are highly ephemeral and expire at the exact moment the task completes.
Zero Ambient Authority is like giving the intern the key to ONE drawer, for ONE hour, for ONE specific task — instead of the master keyring to the entire building.
Elicitation, MFA and the "Vibe Diff"
High-risk actions demand more than approve/deny buttons — they require the human to actually understand what they are authorizing.
While automated identity constraints handle most routine tasks, high-risk actions — such as modifying production databases, executing financial transfers or altering IAM configurations — require explicit verification and cannot rely on simple "approve/deny" buttons. Because vibe coders often rely on AI to write complex syntax they may not fully understand (the "It Works, Ship It" fallacy), simple approval gates quickly cause confirmation fatigue, leading developers to blindly authorize code they don't comprehend.
To combat this, the system must implement structured, context-aware elicitation. The agent is forced to actively request confirmation based on the specific context of a high-risk action, which must be accompanied by two distinct security boundaries:
🔑 Cryptographic Hardware MFA
The system must require physical multi-factor authentication challenges — such as requiring the developer to touch a hardware USB security key to cryptographically approve execution.
📋 The Vibe Diff
Before a critical tool runs, an Evaluator Quorum intercepts the request and translates the complex generated code back into a plain-language summary. It shows the dev exactly how the original, diffuse intent maps to the proposed execution steps — ensuring the human operator truly understands what they are authorizing before providing cryptographic consent.
The Vibe Diff is like the doctor translating the technical report into plain language before you sign for surgery — you don't sign what you don't understand.
Even with perfect identity verification and granular human authorization, malicious instructions can still slip past the initial defenses. When developers blindly trust open-source repositories or pull massive blocks of unstructured context, they invite sophisticated semantic attacks that bypass standard IAM controls. To proactively detect and neutralize these hidden threats as code is generated, security operations must evolve to match the exact speed of the agentic workflow.
The Red/Blue/Green Triad (Pillar 6)
Security operations themselves must become agentic — a continuous AI triad running in parallel with the dev's workflow.
In a vibe-coded environment, application logic is generated, executed and discarded at unprecedented speed. Because the attack surface is non-deterministic and driven by natural language, traditional manual security operations simply do not scale. To secure autonomous systems, security operations themselves must become agentic, requiring the deployment of a continuous triad of Red, Blue and Green teaming running in parallel with the developer's workflow.
Invisible Payloads and Repository Poisoning
Before deploying defensive operations, we need to understand the stealthy nature of agentic threats. Repositories act as a highly effective attack vector. Threat actors can compromise repositories by inserting zero-width Unicode characters or homoglyphs directly into the codebase. Knostic warns that these "invisible payloads hide in plain sight and bypass human review". Because agents manipulate and replicate code far faster than a human developer, a single hidden payload can "spread across hundreds of files in minutes" before anyone notices.
🔴 Red Team (Agent Attacker)
Passive monitoring is fundamentally reactive. Virtual Red-Teaming Agents proactively inject "Adversarial Vibes" — sophisticated roleplay jailbreaks and malicious instructions hidden in massive blocks of RAG context or fake forum posts that devs paste into IDEs. It actively tests whether the enterprise agent gets distracted by poisoned context and hallucinates an insecure solution.
🔵 Blue Team (Agent Defender)
Replaces traditional UEBA (ineffective for non-deterministic AI) with Agent Behavioural Analytics (ABA) — a baseline of expected execution paths + AI-specific anomaly detection. It continuously monitors the Runtime AgBOM (a dynamic inventory of active tools, models and data sources at every millisecond). If the logic drifts — a script queries an unusual number of external tools or enters an unlimited resource loop — ABA flags it immediately.
🟢 Green Team (Agent Fixer)
Killing the host container is disruptive and dangerous — a "mid-thought" agent can leave APIs in a corrupted state. Instead, it executes a "Stateful Quarantine" via SOAR playbooks: gracefully revokes tool access, freezes the ability to act BUT preserves short-term memory intact for forensic analysis. It goes further: Auto-Refactoring — autonomously rewrites the insecure script and presents the safe code directly in the dev's IDE.
It's like having an ethical hacker, a vigilante with a lie detector and an emergency surgeon — all robots — working in continuous shifts inside your codebase.
Integrating the Triad and Batch Sizes
Three runtime phases where the triad dynamically adapts the primary agent's behavior.
To prevent agents from generating massive, unreviewable code modifications during this process, developers must restrict the agent's output to small batch sizes. This is ideally achieved using a test-driven loop where the system blocks the agent from modifying tests and implementation code simultaneously, ensuring the test remains as an objective baseline.
With these constraints in place, the Red, Blue and Green triad dynamically adapts the primary agent's behavior at runtime in three distinct phases:
📐 Planner Phase
When the primary agent designs a workflow, a specialized threat-modelling skill helps evaluate the plan, identifying logical flaws and policy violations before the agent begins active execution.
⚖️ Evaluator Phase
The evaluator quorum reviews the proposed execution trace while the Agent Defender (Blue) simultaneously checks the AgBOM and monitors the semantic context for intent drift.
⚡ Executor Phase
While the Executor performs the downscoped action, the Agent Fixer (Green) monitors the actual tool execution — ready to instantly orchestrate a stateful quarantine or trigger an auto-refactoring loop if the agent encounters an error or violates a security constraint.
To ensure these automated defense mechanisms can successfully intervene, the security triad requires a granular, unimpeded view into the agent's internal reasoning. An agentic security operation is entirely blind if it only looks at the final code output. We need to shift the focus from observing the host infrastructure to observing the agent's "mind", creating an immutable audit trail that maps exactly how a diffuse intent translates into a real-world action.
Observability: Auditing the Agent's Mind
"You cannot secure what you cannot see." — Observability is a strict security requirement, not merely an operational concern.
To effectively secure and evaluate a vibe-coded agent, we need to recognize a fundamental rule: you cannot secure what you cannot see. In traditional microservices, an HTTP 200 OK status indicates a successful operation. However, in an agentic system, a "success" status may merely mask a scenario where the agent's internal logic has silently cascaded into a hallucination loop. This introduces the critical risk of Denial of Wallet (DoW) attacks, where adversaries intentionally trigger infinite, computationally expensive API loops to deliberately bankrupt the organization's cloud and LLM billing accounts.
Observability is no longer merely an operational concern about uptime and latency; it is a strict security requirement to illuminate the "glass box" of non-deterministic logic.
Tracing the "Vibe Trajectory" and Content Scanning
To answer the critical question "Why did an agent do that?", security teams must build a unified chronological lens to see the agent's cognitive steps. Using standard telemetry frameworks like OpenTelemetry, enterprises can aggregate diverse signals — API calls, tool inputs/outputs, RAG retrievals, and token latency — into a complete Vibe Trajectory.
Tracing this trajectory requires logging the massive cognitive leap from the user's initial prompt to the compiled Abstract Syntax Tree (AST). To fortify this trace, organizations must pair traditional logging with Centralised Content Scanning, explicitly designed to inspect all dynamic code snippets or scripts retrieved by the agent at runtime. This trace securely links the agent's internal reasoning loop to its physical actions, supporting rigorous third-party security audits.
Measuring Intent Drift and Trust Decay
As a vibe-coded agent dynamically generates logic and pulls in new tools, its security perimeter constantly fluctuates, rendering static asset inventories (SBOMs) instantly obsolete. Instead, observability platforms must monitor a Runtime Agent Bill of Materials (AgBOM) — a living document that maps the agent's active blast radius every millisecond.
Since trust in an autonomous system is a degradable asset, the architecture continuously monitors for Intent Drift. The principle of Trust Decay dictates that trust is lost when the agent's internal chain of thought pursues sub-goals that diverge from the original human "vibe". For example, a simple prompt to "optimize the database query" can maliciously drift into the agent attempting to download a new unauthorized indexing library.
Checkpoints and Stateful Circuit Breakers
To prevent destructive actions when this drift occurs, the observability pillar must proactively manage state. Before an agent executes any codebase modification, the system must generate a version control checkpoint.
As Agent Behavioural Analytics evaluates the Vibe Trajectory against the AgBOM, any detected instability instantly penalizes the dynamic Agent Trust Score. If this score falls below a predefined threshold, an automatic "circuit breaker" is triggered. The environment uses the version control checkpoint to perform an immediate rollback of the changes, gracefully revoking tool access and freezing the agent's autonomous execution without corrupting connected APIs, preserving the environment state for forensic analysis.
The circuit breaker is like the breaker in your home: when the current (drift) rises too high, it shuts everything off BEFORE the fire — and you can investigate what caused the short circuit with everything preserved.
Security Recap: The 5 Commandments
Abandon implicit trust. The practical baseline for securing a vibe-coded architecture.
For developers operationalizing these concepts, securing a vibe-coded architecture depends on abandoning implicit trust and implementing the following practical baseline:
1️⃣ Sandbox the Vibe Loop
Always run dynamically generated scripts inside kernel-level, network-isolated sandboxes to contain the blast radius. Embed up-to-date Software Composition Analysis (SCA) to actively scan for hallucinated or vulnerable dependencies before code reaches production.
2️⃣ Shift the Perimeter Left
Enforce the use of trusted sources and verified internal registries. While blocking unsafe generation at the IDE level provides an advisory first step, rely on strict deterministic checks at multiple points of the CI/CD pipeline to intercept vulnerable or malicious agent logic before deployment.
3️⃣ Enforce Zero Ambient Authority
Never grant an agent a "Global Key". Restrict access by sending delegated user identities and hyper-restricted JIT tokens that expire the moment the task completes. For high-risk actions, replace blind approval buttons with a mandatory "Vibe Diff" to ensure developers understand the generated logic.
4️⃣ Deploy Agentic SecOps
Continuously stress-test your architecture by deploying Virtual Red-Teaming Agents to inject "Adversarial Vibes". Leverage Agent Behavioural Analytics to monitor the dynamic Runtime AgBOM, while empowering the Green Team to self-refactor vulnerabilities on the fly.
5️⃣ Trace the Execution Trajectory
Log the agent's API calls, tool inputs, and reasoning steps. Security teams must continuously monitor these execution logs to detect unexpected behavior and use version control checkpoints to roll back access if the agent drifts from the intended task.
Implementing these security controls helps our vibe-coded agents operate safely within a secure, well-governed perimeter. However, a secure agent is not inherently an effective agent. Security guarantees that the agent did nothing malicious or unauthorized — but how do we definitively prove that it actually achieved the user's nuanced intent?
To truly operationalize these agents, we need to go beyond securing the perimeter and open the "glass box" to measure the quality, efficiency, and alignment of internal reasoning. This brings us to the next crucial phase of the pipeline: Agent Evaluation.
Evaluation: Orchestrating Quality
Security tells you the agent stayed inside the boundary; evaluation tells you whether what happened inside that boundary is worth shipping.
The previous sections covered the security controls that restrict what a vibe-coded agent can do. These controls do not answer the question the developer actually has: did the agent build what I asked for, and is it good? A vibe-coded agent can pass every security check and still misread the developer's intent, ignore project conventions, or break an unrelated feature.
Security tells you the agent stayed inside the boundary; evaluation tells you whether what happened inside that boundary is worth shipping.
The following sections are structured around three questions: why vibe coding evaluation is different from evaluating other software, what to evaluate, and how to evaluate. Two areas are deliberately out of scope for this framework, both deserving dedicated treatment: subjective evaluation of non-verifiable outputs, where quality is defined by user or business preferences rather than ground truth; and the feedback loop of user corrections back into the model, the harness, or the eval suite to drive improvement.
Figure 2 · The vibe coding agent evaluation framework
Why evaluating vibe coding agents is different
It is not the same problem as evaluating deterministic software — nor a customer-service agent, nor a research agent.
Evaluating vibe coding agents is not the same problem as evaluating deterministic software, and it is also not the same problem as evaluating a customer-service agent or a research agent. Three things make it unique:
📭 1. The Underspecification Gap
Traditional software testing operates on the unshakable assumption that a complete, rigid specification exists before a single line of code is evaluated. Vibe coding is the exact opposite: the user's prompt is inherently underspecified. "Make the dashboard load faster" is not a test case. The prompt relies entirely on the model's latent knowledge, aesthetic judgment, and domain expertise to fill in the operational gaps. The first job of evaluation is to determine whether the agent filled that gap and reconstructed the correct unstated spec.
🙈 2. The user cannot validate
Non-technical users cannot review 600 lines of code line by line. Experienced engineers cannot either, in real time. The gap between "the agent thinks it succeeded" and "the code is actually correct" is wider here than in any other agent category — and closing that gap is the core job of evaluation.
🔄 3. Iterative session, codebase is state
Each turn modifies real files. Early bad decisions compound. Evaluation must cover not only per-turn decisions, but the complete arc of a multi-turn conversation, in a living codebase with its own conventions, dependencies, and history.
These three constraints shape every dimension, method, and tip that follows.
Evaluating vibe coding is like judging a chef who received only "make something tasty" as the order — no recipe, no photo of the dish, and the customer can't cook to check.
What to evaluate: the 7 dimensions
Seven dimensions in two groups — user-facing and internal — with Safety & Responsible AI as a transversal band.
The evaluation of vibe coding agents is divided into seven dimensions, in two groups. User-facing dimensions are what the developer experiences directly. Internal dimensions describe what the agent does invisibly to the user. In addition, Safety and Responsible AI is transversal — it intersects multiple dimensions (code vulnerabilities, refusal behavior, content safety, IP exposure) and must be evaluated alongside each of them.
👤 User-Facing Dimensions
1. Intent satisfaction
Did the agent build what the user meant, not just what they said? The hardest dimension to evaluate because intent is unstated, ambiguous, and often changes mid-session. It is what the user uses to judge the agent in the end.
2. Functional correctness
Does the code build, run, and pass the tests? The floor, not the ceiling. Easy to measure but easy to game: tests can be deleted or mocked to turn red into green without fixing anything.
3. Visual & behavioural correctness
For agents that produce web apps or UI, the artifact is the rendered output, not the code. Code-level metrics miss the target entirely. The page looks right and behaves right, or it doesn't.
4. Cost & efficiency
Token spend, wall-clock latency, tool-call count, and iteration count — how many corrections did the user need to issue before the agent converged? An agent that nails the diff in 1 turn is a different product from one that needs 8 corrections.
5. Code quality & convention matching
Does the code match the project's idioms, patterns, and conventions? A diff that passes the tests but violates the codebase's style is a vibe-coding failure even when locally correct.
🧠 Internal Dimensions
6. Trajectory quality
Did the agent take a sensible path: read the related files first, sequence edits coherently, choose the right tool or skill at each step? Correct output produced by bad reasoning is a fragile success.
7. Self-repair behaviour
When the build fails, the test breaks, or the user says "no, not like that" — does the agent recover or compound the failure? Recovery quality compounds over a multi-turn session.
These dimensions are not independent. For example, stronger trajectory quality (dimension 6) tends to mean stronger functional correctness (dimension 2), which is a prerequisite for intent satisfaction (dimension 1).
Figure 3 · Evaluation dimensions for vibe coding agents
How to evaluate: the 8 methods
No single method covers everything — production pipelines combine several. The matrix shows which method covers which dimension.
The seven dimensions are not all measurable in the same way. No single method covers everything, so production pipelines combine several. The matrix below summarizes the evaluation methods and the recommended dimensions for each; the rest of the section describes each one in detail.
| Method | What it does | Recommended dimensions |
|---|---|---|
| Standardized benchmarks | Compares against the field on shared task sets. | 2, 4 |
| Automated functional testing | Runs build, tests, and linters on the output. | 2, 5 |
| Security & safety evaluation | Static analysis + adversarial probing of refusal. | RAI |
| LLM-as-judge / Agent-as-judge | Scores outputs against rubrics. | 1, 5, 6 |
| Browser-based testing | Multi-step workflows on the deployed app. | 3 |
| Trajectory inspection | Analyzes reasoning, tool calls, retrievals. | 6, 7 |
| Human review | Qualified reviewers; ground truth for intent. | 1, 5, RAI |
| Online evaluation | Samples production traffic; offline rubrics. | All |
Figure 4 · Evaluation methods and recommended dimensions
🧪 Automated functional testing
Run the build, the test suite, and the linters on the agent's output. The standard tooling does most of the work here — pytest, jest, eslint, mypy — plugged into the project's CI pipeline. This is the cheapest signal available, recommended for functional correctness (dimension 2) and the rule-checkable parts of code quality (dimension 5).
🛡️ Security & safety evaluation
Combine static security analysis on generated code with adversarial probing of refusal behavior. It is cross-cutting — it scores safety and responsible AI alongside the other dimensions, not as a separate gate. Static scanners like Snyk and Semgrep find vulnerabilities, git-secrets catches credential leaks, and scripted red-team suites test whether the agent refuses clearly harmful requests.
⚖️ LLM-as-judge / Agent-as-judge
Use a model to score outputs against rubrics. Recommended for dimensions where rules cannot capture the right answer — intent satisfaction (1), code quality and style (5), and trajectory quality (6). In practice: Gemini scoring an output against the user's original prompt, or an agent-as-judge inspecting the trace for plan coherence.
🌐 Browser-based testing
Run multi-step workflows against the deployed app and observe what happens. Recommended for visual and behavioural correctness (dimension 3) in agents that produce UI. The techniques are well established: Playwright scripts that interact with the rendered UI, screenshot comparison against a reference.
🔍 Trajectory inspection
Analyze the agent's reasoning, tool calls, skill invocations, and retrievals. Recommended for the internal dimensions — trajectory quality (6) and self-repair behaviour (7). The substrate is OpenTelemetry traces with span-level tool-call data, surfaced via trace-replay tools that link each model invocation to the actions that followed.
👥 Human review
Sample sessions for direct review by qualified reviewers. Recommended for intent satisfaction (1 — humans are the only ground truth), code quality (5 — the traditional domain of code review), and safety/RAI calls that require nuanced judgment. Does not scale; used primarily to calibrate the other methods. In practice: structured annotation by senior engineers in review queues fed by online sampling.
📡 Online evaluation
Sample live production traffic and score against the same rubrics used in offline eval. Covers all dimensions at the sampling rate. The trick is sampling well: a flat 1% misses the long tail, so bias toward high-cost sessions, sessions with many corrections, and sessions the user abandoned.
Standardized Benchmarks and Kaggle Agent Exams
Standardized tests isolate specific cognitive capabilities — but they are calibration, not a substitute for evaluating intent.
While custom evaluation frameworks handle the open-ended nature of vibe coding, standardized tests isolate specific cognitive capabilities from the noise of custom enterprise environments. They provide the empirical baseline needed to trust a non-deterministic system.
🏗️ Vibe Code Bench
Evaluates zero-to-one web app generation. Compares your agent against the field on shared task sets for full application creation.
🐙 SWEbench Verified
Evaluates code changes in real GitHub repositories. Proves the agent can navigate a highly structured Python repository.
⚡ LiveCodeBench
Provides a contamination-resistant signal for code generation — fresh problems that have not leaked into training data.
Kaggle Agent Exams (SAE) and Zero-Setup Evaluation
Addressing the historically heavy infrastructure burden required to run these benchmarks, the Kaggle Standardised Agent Exams (SAE) represent a massive shift toward "zero-setup" autonomous evaluation. Deployed as a lightweight API integration via a SKILL.md file, SAE allows an agent to autonomously register on Kaggle, fetch exam questions, execute multi-step logic within its own sandboxed environment, and instantly publish its score on a live public leaderboard. It serves as a rigorous, frictionless test of the agent's multi-hop reasoning and adversarial safety under pressure.
Despite their immense utility, over-reliance on standardized benchmarks introduces a severe tradeoff: benchmark overfitting. Agents can be hyper-optimized to achieve top scores on static Kaggle datasets yet fail catastrophically when exposed to the messy, contradictory realities of human intent in production. A high SWE-bench score proves the agent can navigate a structured Python repository — but provides zero guarantees that it possesses the aesthetic judgment needed to "vibe code" a consumer-facing application. Standardized exams should be used strictly for cognitive calibration, not as a substitute for evaluating custom intent.
Benchmarks are like college entrance exams: they prove the candidate knows how to take a test — not that they will be a good employee in the real world.
Observability: the prerequisite for evaluation
Without observability, agent failures appear as inexplicable monolithic events.
To evaluate an agent's internal reasoning, developers need the ability to see it. Observability is the absolute prerequisite for Glass Box evaluation; without it, agent failures appear as inexplicable monolithic events.
🧵 Tracing the Thought
Modern agent observability uses OpenTelemetry to capture non-deterministic flows. agent.session spans capture the entire task duration, agent.think spans record the internal reasoning and prompting cycle before action, and agent.tool spans log the specific arguments and latencies of environmental interactions.
💰 Tracking Costs
Observability provides granular data to calculate real operational costs. By aggregating span attributes, teams can precisely measure token consumption, inference latency, and the cost of self-repair loops.
🎯 Dynamic Tail-Based Sampling
Capturing 100% of traces in production quickly blows storage budgets. Dynamic tail-based sampling allows the collector to evaluate the complete trace after completion — discarding routine successes while retaining traces containing errors or excessive self-repair loops.
Tip 1: Session prefix as an intent rubric
The first 1–2 user messages are the closest thing to a spec you have. Use them as a rubric.
Vibe coding has no spec to test against — user intent is unstated and evolves across turns. The closest thing to a spec is the first one or two user messages. Treat them as a rubric: derive evaluation criteria automatically from the session prefix, then score each subsequent turn against them. This is the only practical way to evaluate dimension 1 (intent satisfaction) at scale.
from google import genai client = genai.Client(vertexai=True, project="...", location="us-central1")# Derive criteria from the user's opening turnsopening = " ".join(session.user_messages[:2]) criteria = client.models.generate_content( model="gemini-3-pro", contents=f"Produce 3-5 acceptance criteria for: {opening}. Return JSON.", ).parsed["criteria"]# Score every agent turn against the derived criteriascore = client.models.generate_content( model="gemini-3-pro", contents=f"Does this output satisfy {criteria}? Score 1-5 with rationale."f"Output: {agent_response}", ).parsed
Tip 2: Judge the rendered artifact, not the code
In vibe coding the user judges the output, not the diff. A multimodal model looking at the rendered page catches what code evaluation misses.
In vibe coding the user judges the output, not the diff. A multimodal model looking at the rendered page captures problems that code-level evaluation misses completely: broken layout on mobile, contrast too low for accessibility, wrong button states. Combine this with Playwright assertions — the judge captures visual and design issues, the assertions capture broken interactivity.
from google import genaifrom google.genai import types client = genai.Client(vertexai=True, project="...", location="...") result = client.models.generate_content( model="gemini-3-pro", contents=["Score this rendered web app against the spec on layout_match, styling, ""and interactive_correctness (1-5 each). Return JSON.", user_spec, types.Part.from_bytes(data=screenshot_bytes, mime_type="image/png"), ], )
Tip 3: Evaluate session convergence, not per-turn accuracy
The relevant question is not "was turn 4 correct?" but "did the user converge on something they wanted?"
A vibe coding session is multi-turn by construction. The relevant question is not "was turn 4 correct?" but "did the user converge on something they wanted?" Sessions that converge in few turns are the success cases. Sessions abandoned mid-flow are the most informative failures — far more so than per-turn errors. Cloud Trace exposes a vibe coding session, instrumented via ADK and Agent Engine, as a single trace tree.
from google.cloud import trace_v2 trace = trace_v2.TraceServiceClient().get_trace( name=f"projects/{project}/traces/{session_id}")def session_outcome(trace):return {"converged": trace.last_turn.user_signal == "satisfied","turns_to_converge": trace.user_correction_count,"abandoned": trace.last_user_action == "close","cost_to_converge": trace.total_token_cost_usd,}
Tip 4: Mine user corrections as labeled failure data
Every "no, not like that" is a labeled failure example — and vibe coding produces them in volume.
Every "no, not like that" from the user is a labeled failure example, and vibe coding produces them in volume. Cluster them and the agent's systematic gaps become visible — much faster than building a synthetic failure benchmark.
from google import genaifrom sklearn.cluster import KMeans client = genai.Client(vertexai=True, project="...", location="...") corrections = [t.user_message for trace in tracesfor t in trace.turns if t.is_correction] emb = client.models.embed_content( model="text-embedding-005", contents=corrections, ) vectors = [e.values for e in emb.embeddings] clusters = KMeans(n_clusters=8).fit(vectors)# Clusters.labels_ is the prioritized list of failure modes for the next iteration
Conclusion: the new craft
Generation is largely a solved problem. Verification, security, and architectural judgment are the new craft.
The transition from syntax to intent is not a future prediction; it is the immediate reality of software development. In 2026, the bottlenecks in software creation have fundamentally shifted. We are no longer waiting for human hands to type boilerplate; we are waiting for human minds to define the boundaries, evaluate the outputs, and secure the execution environment.
Migrating from casual vibe coding to disciplined agentic engineering requires abandoning implicit trust. A raw AI model is merely an engine; it only becomes an enterprise-ready agent when wrapped in a robust harness. By implementing the 7-Pillar Security Architecture — applying strict sandboxing, contextual ABAC, and Red/Blue/Green agentic teaming — organizations can safely contain the blast radius of autonomous actions.
However, security alone only proves the agent caused no harm. By pairing these security controls with a rigorous Evaluation Framework — measuring everything from intent satisfaction and trajectory quality to visual correctness — engineering leaders can confidently prove that the agent actually delivered value.
Generation is largely a solved problem. Verification, security, and architectural judgment are the new craft.
The teams that will thrive in this new era are those that embrace AI as a high-velocity implementation engine while maintaining the rigorous discipline needed to produce software the world can truly rely on.
🎯 Test your understanding
✅ Implementation checklists
🛡️ Security Baseline
📊 Evaluation Readiness
💡 Applied Tips
📋 Cheat sheets
# SECURE VIBE CODING — 5 COMMANDMENTS1. SANDBOX THE VIBE LOOP→ kernel-level, network-isolated sandboxes→ SCA scan for hallucinated/vulnerable deps2. SHIFT THE PERIMETER LEFT→ trusted sources + verified internal registries→ deterministic checks at multiple CI/CD points3. ENFORCE ZERO AMBIENT AUTHORITY→ delegated user identities + JIT hyper-restricted tokens→ mandatory "Vibe Diff" for high-stakes actions4. DEPLOY AGENTIC SECOPS→ Virtual Red-Teaming Agents inject "Adversarial Vibes"→ ABA monitors Runtime AgBOM + Green auto-refactors5. TRACE THE EXECUTION TRAJECTORY→ log API calls, tool inputs, reasoning steps→ version-control checkpoints to revert on drift
# EVALUATION — 7 DIMENSIONS × 8 METHODSDIMENSIONS 1 Intent satisfaction 2 Functional correctness3 Visual & behavioural 4 Cost & efficiency5 Code quality 6 Trajectory quality7 Self-repair RAI Safety (transversal)METHODS benchmarks → 2,4 functional testing → 2,5security eval → RAI LLM/Agent-judge → 1,5,6browser-based → 3 trajectory inspect → 6,7human review → 1,5,RAI online eval → all
# DAY 4 — KEY TERMSEffective Trust continuous metric: supply chain + identity + runtime behaviour + contextual associationsslopsquatting malware published under hallucinated pkg namesConfused Deputy over-privileged agent tricked by prompt injectionZero Ambient Auth agent never inherits dev's full privilegesVibe Diff plain-English translation before critical tool runsAgBOM Runtime Agent Bill of Materials (live blast radius)Intent Drift chain-of-thought diverges from original vibeTrust Decay trust is a degradable assetDoW Denial of Wallet — bankrupt via infinite API loopscircuit breaker auto rollback when Trust Score drops below thresholdunderspecification the prompt is not a spec — gap must be reconstructedSAE Kaggle Standardised Agent Exams (zero-setup eval)
Continue the journey
The companion papers of the series — each guide follows the same interactive, trilingual format.
Agents Whitepaper Series — hub
All the guides of the series in one place.
The New SDLC with Vibe Coding
Agentic Engineering, the Factory Model and the Agent = Model + Harness equation.
Agent Tools & Interoperability
The 5 open protocols that connect agents to tools and to each other.
Context Engineering: Sessions, Memory
How to assemble, on every turn, the right information inside the context window.
Spec-Driven Production Grade Development
Spec-driven development to take vibe coding to production level.
References (paper endnotes)
The 6 sources cited in the original Security & Evaluation whitepaper.
📚 Endnotes
Priya Pandey, Antonio Gulli, Reah Miyara and Sita Lakshmi Sangameswaran (content contributors) · Anant Nawalgaria (curator and editor) · Michael Lanning (designer).