Independent analysis by NHI Mgmt GroupSource article: Pillar Security, “The Week of Sandbox Escapes Day 7: A time bomb in .vscode: bypassing Antigravity's Secure Mode” (July 20, 2026)

TL;DR: A coding-agent sandbox can still be bypassed if the agent is allowed to write auto-executing workspace files, as Pillar Security shows in its analysis of Antigravity Secure Mode and .vscode task handling. The real control problem is not shell confinement alone, but whether host-side configuration will trust agent-written files before execution.


At a glance

What this is: NHI Mgmt Group's analysis, drawing on Pillar Security's blog post: Sandboxed AI coding agents can still create host-side execution risk when they are allowed to write auto-running workspace configuration files.

Why it matters: It matters because IAM and security teams evaluating AI agents need to govern what the agent can write, not just what it can execute, or sandbox boundaries will be undermined by host trust.


Context

AI coding agents often rely on a split trust model: the agent is confined, but the workspace and editor still retain the ability to execute trusted configuration. That creates a governance gap when the agent can write files that a host component later treats as authoritative. In this case, the primary risk is not code execution inside the sandbox, but configuration-written execution outside it.

The identity and access question is whether the host should trust files created by an AI agent in the same way it trusts files created by a human developer. Once agent-authored workspace config can trigger actions on folder open, the effective security boundary moves from runtime confinement to file-level authorisation and execution trust. That is a classic NHI governance problem in an agentic workflow.


Key questions

Q: What breaks when AI coding agents can write auto-run workspace files?

A: A sandbox breaks down when the agent can write files that another trusted component later executes. The immediate command may still be blocked, but the agent has already planted state that survives the session. That turns a contained interaction into deferred host execution, which is harder to detect and easier to miss in routine review.

Q: Why do auto-run workspace files create a sandbox escape risk?

A: They create risk because the host executes them with user trust after the agent’s sandboxed action is over. The danger is not the write itself, but the later handoff from agent-authored file to host-side execution. That trust chain defeats controls that only focus on runtime confinement.

Q: How do security teams know whether agent workspace controls are working?

A: Look for whether the agent can create configuration that changes execution behaviour without a second approval step. If auto-run files, startup hooks, or task definitions can appear in the workspace and later execute silently, the control is failing. Effective governance should make those writes visible, reviewable, and, by default, impossible.

Q: Should organisations use blocklists or allowlists for AI agent write access?

A: Allowlists are the safer default because blocklists only stop the dangerous files someone remembered to name. In agentic environments, the missed file is the one that becomes the bypass. Organisations should permit only the workspace paths the agent genuinely needs and treat everything else as non-writable.


Technical breakdown

Why workspace config becomes an execution boundary

Sandboxing only constrains the agent process. It does not automatically constrain the downstream components that consume files the agent writes. In VS Code-based environments, workspace settings and task definitions can trigger actions when a folder opens, which means the file itself becomes an execution boundary. If the agent can create or modify those files, the host may later execute them with user privileges, outside the original sandbox. The security failure is trusting a write operation as if it were a safe configuration change. Practical implication: treat agent-written configuration files as potentially executable inputs, not inert workspace state.

Practical implication: Block or tightly scope agent writes to auto-executing workspace paths, especially where host tooling trusts project-local config.

Auto-run task files create a host-side trust chain

Auto-run mechanisms such as folder-open tasks shift control from the agent to the editor or operating system. The agent does not need to break the sandbox if it can seed a file that another component will later consume. That creates a trust chain across two authorities: the agent that writes the file and the host that executes it. The article’s key point is that this chain survives because the host treats certain workspace files as legitimate instructions. Practical implication: separate file write permission from execution permission, and require explicit human review before any workspace-configured auto-run path can fire.

Practical implication: Design policy so agent-authored workspace files never inherit auto-execution trust by default.

Blocklists fail when the dangerous file is the one you missed

A blocklist stops known bad paths, but it does not prevent the next auto-executing config file from becoming the bypass. The article shows that guarding some sensitive names under .vscode was not enough when tasks.json remained writable. That is why this class of issue is fundamentally a governance failure, not a syntax bug. The adversary does not need a novel exploit when the policy leaves one trusted configuration path open. Practical implication: use allowlists for agent write targets and review every file type that can trigger host execution or startup behavior.

Practical implication: Move from blocklisting known risky files to allowlisting only the workspace paths the agent genuinely needs.


Threat narrative

Attacker objective: The attacker wants persistent host-side execution from a sandboxed AI coding session, using trusted workspace config as the delivery path.

  1. Entry occurs through prompt injection or another poisoned instruction that tells the agent to create workspace configuration files inside the project.
  2. Credential or access abuse happens when the agent is allowed to write .vscode files that the host later trusts as execution directives.
  3. Impact occurs when the user reopens the workspace and the host runs the task outside Secure Mode with the user’s privileges.

Read and download The State of NHI & AI Agent Breach Report 2026, covering 200+ breaches impacting Non-Human Identities including AI Agents.


NHI Mgmt Group analysis

Agent-written configuration is now part of the attack surface: once an AI coding agent can author files that the host later executes, workspace config becomes a governance boundary, not just a convenience layer. The security model must distinguish between files the agent can write and files the runtime will trust. Practitioner conclusion: any editor or IDE workflow that auto-runs project config needs explicit control over agent-authored writes.

This is a non-human identity governance problem, not just a sandbox problem: the agent is acting as a runtime identity that can create state which another system later trusts. That makes file provenance and execution authority part of NHI governance. The important question is who or what is authorised to create executable workspace state, and under what conditions that state can be acted on.

Allowlists matter more than blocklists when host trust is involved: the article shows how one missed auto-executing file can negate a broader denylist. Blocklists age poorly in fast-changing agent environments because the next dangerous configuration name is always one release away. Practitioner conclusion: govern writable paths as if they were execution channels, not just storage locations.

Auto-run workspace config is a named control gap: the specific failure here is the assumption that a sandboxed writer cannot later influence unsandboxed execution. That assumption is false whenever host tooling honours agent-authored settings, tasks, hooks, or launch files. Practitioner conclusion: treat trusted workspace config as a high-risk execution dependency and review it accordingly.

Agentic trust boundaries must be evaluated end to end: the risk appears only when the agent, the workspace, and the host are analysed together. Security reviews that stop at prompt filtering or shell confinement miss the more important question of post-write execution trust. Practitioner conclusion: extend governance to the full path from agent action to host-side effect.

From our research library:

What this signals

Auto-run workspace config is the weak trust layer: security teams should assume that any agent-authored file capable of triggering editor or host behaviour is part of the identity boundary, not just the code boundary. The practical shift is to govern what an AI agent can write with the same care used for privileged automation identities.

If teams continue to measure AI agent risk only at the prompt or shell layer, they will miss the real failure mode: trusted host execution after the sandboxed write has completed. That is especially important in environments where AI systems already receive broader access than human workers would be given for the same task, according to the 2026 Infrastructure Identity Survey.

Agent-to-host trust delegation: this is the named concept practitioners should track. It describes the point at which an AI agent’s write permission is converted into host-side execution authority, and that handoff is where governance must now focus.


For practitioners

  • Restrict writes to auto-executing workspace files Deny AI coding agents permission to create or modify task, launch, hook, and similar workspace config files unless the path is explicitly approved for that workflow.
  • Move from blocklists to path allowlists Define a minimal set of writable directories for the agent and remove blanket access to project config locations such as .vscode and other execution-bearing folders.
  • Review host-side auto-run features separately from sandbox policy Inventory editor and IDE features that execute on open, save, or project load, then require human approval before those mechanisms can consume agent-authored files.
  • Treat workspace config as executable input Apply change review, provenance checks, and rollback procedures to any file the host can interpret as a command, task, or launch instruction.
  • Test for prompt-injected file creation paths Red-team the agent with poisoned documentation and hidden instructions that ask it to write trusted configuration files, then confirm the host cannot auto-execute them.

Key takeaways

  • The central failure is not sandbox breakout in the narrow sense, but host trust in configuration written by the agent.
  • The article shows how an auto-run workspace file can turn a harmless write permission into a later execution event with user privileges.
  • The control that matters most is not just denying obvious dangerous paths, but preventing agent-authored config from becoming executable state.

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, OWASP Agentic AI Top 10 and MITRE ATT&CK address the attack and risk surface, while NIST CSF 2.0 and CIS Controls v8 set the governance and control requirements practitioners need to meet.

FrameworkControl / ReferenceRelevance
OWASP Non-Human Identity Top 10NHI-10 — Human Use of NHIThe agent is writing host-trusted config on behalf of the user, which is a governed human-to-agent delegation boundary.
Recommendation — Restrict human-directed agent actions that can create host-executable workspace state.
OWASP Agentic AI Top 10ASI03 — Identity & Privilege AbuseThe article shows an agent using write permissions to influence later execution outside its sandbox.
Recommendation — Constrain agent write privileges so they cannot become host execution authority.
NIST CSF 2.0PR.AA-05 — Access Permissions, Entitlements and AuthorizationsThis is an access scoping failure where the agent can write files that should not be executable inputs.
Recommendation — Limit agent entitlements to non-executable workspace paths and review permissions regularly.
MITRE ATT&CKTA0006; TA0003 — Credential Access; PersistenceThe attack chain uses configuration write access to create persistent execution after the initial prompt injection.
Recommendation — Map prompt-injected config abuse to persistence patterns and hunt for workspace files that enable delayed execution.
CIS Controls v8CIS-5 — Account ManagementThe issue depends on overly broad account and agent write permissions in the development environment.
Recommendation — Audit account and agent permissions so only approved identities can modify execution-bearing workspace files.

Key terms

  • Auto-Executing Workspace File: A configuration file that causes code or commands to run when a project opens, a task starts, or a toolchain initialises. These files are part of the execution surface and should be governed like privileged inputs, not treated as harmless project metadata.
  • Host-Side Execution Trust: The assumption that a file created in the workspace can be safely executed or consumed by the local development environment. This trust is risky when the file was authored by an AI agent, because the execution decision happens outside the agent’s sandbox and often with user privileges.
  • Sandbox Escape: A sandbox escape is when code breaks out of its intended isolation boundary and gains access to host capabilities. In identity terms, it turns a constrained non-human execution path into a privileged runtime that can touch files, secrets, or downstream systems.
  • Agent-Authored Executable State: Any file or setting produced by an AI agent that later influences code execution, startup behaviour, or privileged automation. The governance challenge is to treat that output as potentially dangerous state, not as ordinary workspace content.

Deepen your knowledge

NHI Foundation Level course, the industry's only accredited NHI security programme, covers NHI governance, agentic AI identity, machine identity security, IAM, and secrets management. It helps practitioners translate identity control concepts into day-to-day governance for AI and automation programmes.
NHIMG Editorial Note
Published by the NHIMG editorial team on July 22, 2026.
Updated on October 13, 2026.
NHI Mgmt Group, the independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org