By NHI Mgmt Group Editorial TeamBased on TruFoundry: “Sandboxed Code Agents: Let Models Execute Without Letting Them Roam” (August 17, 2026)

TL;DR: Giving AI systems code execution increases capability, but it also turns runtime access into a security boundary that must be tightly scoped. TruFoundry argues that the right production pattern is to give the model a smaller computer, with isolated workspaces, explicit artifact promotion, and governed tool access.


At a glance

What this is: TruFoundry argues that sandboxed code execution should shrink an AI agent’s runtime authority, not expand it into production systems.

Why it matters: For IAM, NHI, and agentic AI programmes, the key issue is that code execution changes the trust boundary, so filesystem, network, secrets, and tool access must be governed separately.


Context

A sandbox is only useful if it meaningfully limits what the agent can reach. Once an AI system can execute code, the real control question becomes which files, network paths, secrets, and tools sit inside that runtime boundary. That makes the topic directly relevant to agent identity governance, because authority should be granted to the smallest execution surface that still accomplishes the task.

The article frames this as an architectural problem, not a model-quality problem. TruFoundry's position is that computation should happen in an isolated workspace first, with external actions handled through governed tools and explicit approvals. That separation matters because many agent workflows now combine code execution, MCP access, and artifact promotion in the same operational path.

For identity and security teams, this is typical of the broader shift in agent design. The issue is no longer whether an agent can act, but where its authority begins and ends.


Key questions

Q: What fails when an autonomous AI system can move from sandboxed testing to production access?

A: Sandbox-only controls fail when the actor can reason about the boundary, discover a path around it, and then chain actions across environments. The failure mode is not just escape, but the loss of control over the sequence after the first legitimate-looking step. Security teams need runtime containment that tracks behaviour across the full chain, not just the initial session start.

Q: Why do AI agent sandboxes need approval gates for external actions?

A: Because code execution is only useful when it can produce something actionable, but that action should not happen automatically. Approval gates stop sandbox output from becoming immediate side effects such as deployment, publication, or system changes. They also create accountability, because a reviewed artifact is easier to trace than an unconstrained runtime event.

Q: What signals show that an AI agent sandbox is too permissive?

A: Broad filesystem read access, mounted secrets, unrestricted environment variables, and default network reach are the clearest warning signs. If the agent can inspect credential files or print sensitive content to STDOUT, the sandbox is containing the host but not the workload risk.

Q: How should security teams govern AI agents that have their own sandboxes?

A: Security teams should govern AI agents with the same discipline used for other machine identities, but extend the model to include the sandbox, the agent account, and every delegated integration it can reach. The key is to bind access to task scope, record all actions, and revoke the full execution environment when the task or agent ends.


Technical breakdown

Why sandbox boundary design matters for AI agent code execution

A sandbox is a capability boundary, not just a container. If the process can read host files, reach the network, inherit environment variables, or install packages freely, code execution becomes a broad execution and data-access path. The important design question is therefore not whether the agent can run code, but which filesystem mounts, egress destinations, credentials, and resource limits it receives. In agentic systems, that boundary is part of the identity model because the same agent may compute in one context and act in another. Strong designs keep computation local to the workspace and move any external effect behind a separate governed control plane.

Practical implication: Treat sandbox configuration as an access-control decision, not an infrastructure default.

How governed tool access differs from sandbox access

A sandboxed process should not automatically inherit production credentials or direct API authority. The article’s core pattern is separation of concerns: the sandbox computes, while a governed tool authenticates externally and exposes only the narrow action required. This is especially important when MCP is involved, because tool access, approval, and auditability belong at the gateway boundary rather than inside the runtime itself. In practice, this reduces the chance that arbitrary code can mutate production systems simply because it was allowed to run. The agent can still be powerful, but the power is constrained to explicit operations with policy around them.

Practical implication: Route sensitive actions through governed tools instead of exposing credentials inside the sandbox.

Why artifact promotion is safer than direct mutation

Artifact promotion separates generation from consequence. An agent can create a patch, report, dataset transform, or deployment plan inside the sandbox, but a later review step decides whether that output is published or applied. That pattern is stronger than letting code write directly into production because it creates a checkpoint for testing, policy checks, and human approval. For NHI governance, this matters because it limits the blast radius of a compromised or misdirected agent identity. It also makes the agent’s behaviour auditable, since the output and the downstream action are no longer the same event.

Practical implication: Require promoted artifacts to cross a reviewed boundary before they can affect production state.


NHI Mgmt Group analysis

Sandboxed execution is an identity boundary as much as a runtime boundary. Once an agent can execute code, the question is no longer simply what it can compute. The governance question becomes what authority the process inherits, what it may reach, and what survives the run. For agentic AI programmes, that means runtime design and identity design have to be treated as the same control problem.

Tool access and execution access should never be conflated. The article correctly separates local computation from governed external action, and that separation is now a baseline control pattern for agent security. If a sandbox can also call production systems, the organisation has effectively collapsed two trust zones into one. Practitioners should view this as a control decomposition issue, not a feature decision.

Capability-based governance is the right mental model for AI agents. The useful unit is not the container label, but the matrix of filesystem, network, secrets, package, and time privileges assigned to each job class. That concept is especially important for NHI governance because agent identities are becoming operational actors with varying scopes. Practitioners should document each agent class as a capability profile, then align policy to that profile.

Artifact promotion is the practical control that keeps autonomy bounded. Letting an agent produce a result is materially different from letting it publish or deploy that result. This pattern preserves the productivity benefits of code execution while preventing uncontrolled side effects from reaching production systems. The practitioner takeaway is to make consequence a separate, governed step, not a byproduct of computation.

From our research library:

What this signals

Capability-based agent governance is becoming the practical alternative to treating every code-executing agent as if it were a fully trusted service account. The boundary now matters more than the container label, because runtime authority can be narrower, cleaner, and easier to audit when it is assigned by task class instead of by platform default.

Sandboxed code execution only reduces risk when the external-action boundary remains separate. That means practitioners should expect more use of governed tool layers, approval gates, and explicit artifact promotion in agent workflows. The programme risk is not merely execution, but uncontrolled translation from execution into production side effects.


For practitioners

  • Define sandbox capability matrices Map each agent job class to explicit filesystem, network, secrets, package-install, and runtime limits before enabling code execution.
  • Separate computation from external authority Use governed tools for production API calls, and keep credentials outside the sandbox unless the action is narrowly scoped and approved.
  • Make artifact promotion a required checkpoint Require tests, policy review, and approval before a sandbox-produced patch, report, or deployment plan can affect production state.
  • Minimise inherited secrets and mounts Deny host secrets, restrict mounted paths, and make any secret exposure inside the runtime an explicit exception rather than the default.

Key takeaways

  • Sandboxed code execution increases agent capability, but it also creates a new control boundary around filesystem access, network reach, secrets, and tools.
  • The main governance failure is treating runtime execution and production authority as the same thing, which collapses the boundary that should separate them.
  • The safest operating pattern is to let agents compute in isolated workspaces, then promote artifacts through a separate reviewed path before they can affect live systems.

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 addresses the attack and risk surface, while NIST AI RMF and NIST CSF 2.0 set the governance and control requirements practitioners need to meet.

FrameworkControl / ReferenceRelevance
OWASP Agentic AI Top 10ASI03 — Identity & Privilege AbuseThe article is about constraining what an agent identity can do inside and outside a sandbox.
ASI02 — Tool MisuseThe article warns against letting sandboxed code call production tools without control.
ASI09 — Human-Agent Trust ExploitationArtifact promotion and approvals address over-trust in agent-produced output.
Recommendation — Scope agent privileges tightly and separate local execution from governed external authority. Route sensitive actions through approved tools with policy checks at the boundary. Require human review before agent-generated artifacts become live changes.
NIST AI RMFGOVERN — AI Governance and AccountabilityThe article centers on governance of AI runtime authority and accountability.
Recommendation — Define ownership, approval, and accountability for every agent execution boundary.
NIST CSF 2.0PR.AA-05 — Access Permissions, Entitlements and AuthorizationsSandbox permissions, credentials, and external actions are the central controls here.
Recommendation — Limit each agent runtime to the minimum permissions needed for the task.

Key terms

  • Sandbox Boundary: A control boundary that separates untrusted execution from sensitive systems, data, and credentials. For agentic development, the boundary must cover both what the code can read and what it can call externally, otherwise a sandbox can still reach production through outbound requests.
  • Artifact Promotion: Artifact promotion is the controlled step of moving an output from a private execution space into a system where it has operational effect. It turns generated code, reports, or manifests into a governed change path with review, testing, and approval before consequence.
  • Governed Tool Boundary: A governed tool boundary is the control point where an agent requests an external action through an approved interface rather than acting with embedded credentials. It centralises authentication, policy, and audit so the sandbox can compute without directly owning production authority.
  • Capability Matrix: A capability matrix documents exactly what each agent job class may do, including data access, network destinations, package installation, and external actions. It is a governance tool for making runtime privilege visible, comparable, and auditable across different workflows.

Deepen your knowledge

The NHI Foundation Level course, the industry's only accredited NHI security programme, covers NHI governance, agentic AI identity, and machine identity security. It helps security and IAM practitioners apply stronger identity controls to agent-driven environments.
NHIMG Editorial Note
Published by the NHIMG editorial team on August 18, 2026.
Updated on October 12, 2026.
NHI Mgmt Group, the independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org