By NHI Mgmt Group Editorial TeamDomain: AI SecuritySource: Pillar SecurityPublished July 20, 2026

TL;DR: AI coding agents can be pushed past sandbox boundaries through reachable local daemons, with one Docker socket path enabling host-level execution and file access across Codex, Cursor, and Gemini CLI, according to Pillar Security. The control lesson is that deny-default profiles are not enough when privileged services remain reachable from the agent’s runtime context.


At a glance

What this is: The article shows how AI coding agent sandboxes can be bypassed through Docker Desktop and other reachable local daemons, turning workspace-limited execution into host-level access.

Why it matters: This matters because IAM, PAM, and NHI teams must treat agent runtime boundaries, local daemon reachability, and privileged sockets as identity and access control problems, not just sandbox settings.

👉 Read Pillar Security's research on sandbox escapes in AI coding agents


Context

AI coding agents are often treated as if a closed sandbox is the same thing as a secure operating boundary. It is not. If the agent can execute binaries, reach a privileged local daemon, and talk to an exposed socket, the effective control plane shifts from the sandbox policy to the daemon’s own privileges. For identity and access teams, that turns an application isolation issue into a machine identity and local privilege problem.

The primary governance gap is that organisations frequently verify what the agent process can do while ignoring what trusted host services will do on its behalf. That matters for NHI because tool access, sockets, API keys, and local service accounts can become the hidden bridge out of containment. The same pattern also affects human-operated developer workflows when local privilege and agent automation collide.


Key questions

Q: What breaks when an AI coding agent can reach privileged local daemons from a sandboxed workspace?

A: The sandbox stops being the real trust boundary. If the agent can execute local binaries, read a daemon socket, and ask that daemon to perform privileged work, the host service effectively extends the agent’s privilege set beyond the sandbox policy. That is why containment must include service reachability, not just process restrictions.

Q: Why do conversational AI systems create new identity and access risks?

A: Because they can combine data retrieval, decision-making, and execution in a single interaction. That collapses the gap between information access and business action, which traditional IAM and security tools were not built to manage. The result is higher exposure when the system can modify records or disclose sensitive guest data.

Q: How do security teams know whether sandbox controls are actually working?

A: They know by testing for alternate expressions of the same action, not by checking whether one blocked syntax case still fails. A sandbox is weak if template literals, reflective APIs, indirect property writes, or call arguments can still produce the same privileged effect. The right signal is whether equivalent behaviour is contained across different language forms.

Q: Who is accountable when an AI agent escapes its sandbox?

A: Accountability should sit with the team that owns the agent runtime, its permissions and its exception process. If a sandbox escapes, the failure is usually not one line of code but a control design decision that allowed excessive privilege, weak confinement or incomplete validation. That is a governance issue, not only an engineering issue.


Technical breakdown

Why deny-default sandboxes still fail against privileged local daemons

A deny-default sandbox limits what the agent’s process can request from the OS, but it does not automatically control interactions with already-running host services. If the sandbox allows process execution, file reads, and network access, the agent can often invoke a local client, reach a daemon socket, and delegate privileged work outside the sandbox policy. The security boundary therefore moves from syscall filtering to service reachability. That is why a technically correct sandbox can still be operationally porous when a privileged daemon is available on the same machine.

Practical implication: Treat reachable daemons as part of the attack surface and block or broker socket access before relying on sandbox policy.

How Docker socket access becomes host-level authority

A readable and writable Docker socket is not just another file. It is an API surface that can instruct the daemon to create privileged containers, mount host paths, and inherit the daemon’s own trust. Once the agent can send those requests, the sandbox no longer constrains the effective action set because the daemon performs the sensitive operation. On developer endpoints, Docker Desktop adds a second execution environment that often sits outside the agent’s containment model. That is why the socket is the real privilege boundary, not the sandbox profile alone.

Practical implication: Inventory and restrict Docker socket exposure wherever AI agents or developer assistants run with local execution rights.

Why host-sharing features turn a workspace escape into data exposure

Host-sharing mechanisms such as mounted home directories or VM-backed file systems can collapse the distinction between permitted workspace writes and prohibited host writes. If an attacker can start a privileged container and mount a shared path, sensitive material like SSH keys, browser data, and configuration files can become reachable even when the original agent session appeared constrained. The problem is architectural: the sandbox governs the agent, while the daemon governs the host-sharing path. Once those layers are linked, containment assumptions fail quietly.

Practical implication: Disable or tightly segment host-sharing features on machines that run autonomous coding agents, especially where secrets are stored locally.


Threat narrative

Attacker objective: The attacker wants to escape the agent sandbox, gain host-level execution through the daemon, and persist on the developer machine or steal local secrets.

  1. Entry begins with indirect prompt injection or a benign-looking instruction that persuades the AI coding agent to execute a script using local tooling.
  2. Escalation occurs when the script reaches Docker Desktop through the readable socket and asks the daemon to run a privileged container outside the sandbox boundary.
  3. Impact follows when the privileged container mounts host-accessible paths and exposes files such as credentials, browser data, or shell startup files for persistence.

NHI Mgmt Group analysis

Sandbox policy is not the control boundary if the agent can reach privileged services. The article shows that deny-default profiles can block direct process abuse while still leaving a reachable daemon free to act on the agent’s behalf. That creates a hidden trust bridge between the contained runtime and the host. Practitioners should stop measuring agent safety only at the sandbox layer and include daemon reachability in the control model.

Local daemon exposure is becoming a practical form of privilege sprawl for AI agents. When tools like Docker Desktop are installed on developer endpoints, the agent may inherit a path to host execution without ever receiving explicit host-admin rights. That is a machine identity problem as much as an endpoint problem because the trusted service, not the model, becomes the entity exercising authority. Teams should classify local daemons as privileged identities and govern them accordingly.

Host-sharing mechanisms create a dangerous overlap between workspace permission and host permission. The article’s chain succeeds because a permitted workspace action is later amplified through privileged mounting and file-system sharing. That pattern exposes a governance gap we can call runtime delegation leakage: trusted local services turn scoped agent actions into broader host effects. Security programmes should treat that leakage as a distinct control failure, not a generic sandbox weakness.

AI agent containment now needs runtime identity control, not just code execution control. The broader lesson is that agent governance must account for which services, sockets, and credentials the agent can reach in the live environment. That intersects directly with NHI management because any token, socket, or local service account available to the agent expands its effective privilege set. Organisations should align containment with least privilege at runtime, not only at launch time.

What this signals

Runtime delegation leakage: the real risk is no longer whether an AI agent can break out of its own sandbox, but whether a trusted local service can amplify an apparently harmless action into host-level authority. That means endpoint governance and identity governance are converging around the same question: which runtime identities can act on behalf of the agent, and under what constraints.

As organisations deploy more coding agents, developers will need to treat sockets, helper services, and host-sharing features as part of the access control perimeter. The most useful control is not a bigger deny list but a smaller trust graph, especially where local daemons can reach secrets, home directories, and container runtimes.

Security teams should align this issue with the OWASP Agentic AI Top 10 and the NIST AI Risk Management Framework, because the failure mode is not just technical misconfiguration. It is a governance failure in which an agent is trusted to operate in a space where other privileged identities are already present. That is the programme-level risk to prepare for.


For practitioners

  • Map reachable daemons on agent hosts Inventory Docker Desktop, local orchestration services, and any privileged sockets exposed to AI coding agents. Block direct socket access where possible, or place a mediation layer between the agent and the daemon so privileged requests cannot be issued from the sandboxed process.
  • Separate agent workspaces from host-sharing paths Do not allow autonomous coding agents on developer machines that also expose host-mounted home directories, shared volumes, or convenience file bridges. If those features are required, isolate them from the agent runtime with separate user profiles and separate execution hosts.
  • Treat local service accounts as privileged identities Apply PAM-style governance to local daemons and helper services that can act for the agent. Where a service can perform host-level actions, require explicit ownership, hardened configuration, and periodic review of the permissions it can exercise on the endpoint.
  • Test for indirect execution paths in agent sandboxes Red-team the exact path described in the article by checking whether the agent can execute local binaries, reach the Docker socket, and invoke privileged container operations from a permitted workspace. Validate both default settings and common developer overrides.

Key takeaways

  • AI coding agents can escape sandbox boundaries when they can reach privileged local services that act outside the sandbox policy.
  • The exposed Docker socket is a privilege boundary problem, not just a tooling issue, because it can turn permitted workspace actions into host-level execution.
  • Practical containment requires endpoint-level identity governance, socket restriction, and host-sharing separation, not only deny-default sandbox settings.

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 and MITRE ATT&CK address the attack and risk surface, while NIST AI RMF, NIST CSF 2.0 and NIST SP 800-53 Rev 5 set the governance and control requirements practitioners need to meet.

FrameworkControl / ReferenceRelevance
OWASP Agentic AI Top 10Agent sandbox escapes and tool reachability map directly to agent misuse and delegation risk.
MITRE ATT&CKTA0007 , Discovery; TA0008 , Lateral Movement; TA0004 , Privilege EscalationThe chain depends on discovering reachable services and escalating through a trusted daemon.
NIST AI RMFGOVERNThe article is fundamentally about accountability for AI runtime controls and delegated authority.
NIST CSF 2.0PR.AC-4Least privilege and access enforcement are central when agents can reach privileged host services.
NIST SP 800-53 Rev 5AC-6Least privilege is directly challenged when a sandboxed agent can invoke privileged helpers.

Assign ownership for agent runtime boundaries and require governance over reachable services and sockets.


Key terms

  • Runtime Delegation: The process by which an identity is allowed to choose actions, tools, or next steps while a task is in progress. In AI agent environments, runtime delegation is risky when it is broad, opaque, or disconnected from explicit policy, because the resulting behaviour may exceed the original intent.
  • Privileged Local Daemon: A background service on the endpoint that can execute actions with higher authority than the sandboxed agent. In AI coding workflows, this often includes container runtimes or management services that can mount files, start containers, or access host resources.
  • Host-sharing Path: Any file-system or virtualisation mechanism that allows data to move between a contained workspace and the host environment. These paths are convenient for development but become high-risk when an autonomous agent can combine them with privileged service access.

What's in the full report

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

  • The exact proof-of-concept chain used to move from sandboxed agent execution to privileged Docker activity on macOS.
  • Vendor-by-vendor response differences, including the fix path, triage position, and documentation stance across the affected tools.
  • The full sandbox and socket interaction sequence, including how the agent reaches the Docker daemon and why the boundary fails.
  • The practical containment recommendations and follow-on research in The Week of Sandbox Escapes series.

👉 The full Pillar Security post shows the Docker-based escape chain and vendor response comparisons in detail.

Deepen your knowledge

The NHI Foundation Level course, the industry's only accredited NHI security programme, covers NHI governance, secrets management, and machine identity security. It helps practitioners connect identity controls to the runtime decisions that shape agent and workload risk.
NHIMG Editorial Note
Published by the NHIMG editorial team on July 22, 2026.
NHI Mgmt Group — the independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org