Why sandboxed AI agents still need authority, state, approval, traces, and recovery.
By Sumant Thakur
Published: 2026-05-28
URL: https://sumantthakur.substack.com/p/a-container-wont-save-your-ai-agent
We are entering the sandbox phase of agentic AI.
After months of giving agents tools and hoping prompts would keep them safe, the new answer is becoming obvious: put the agent in an isolated environment.
Give it a container, a temporary filesystem, a browser session, a terminal, and a workspace where it can inspect files, run commands, write code, and experiment without touching the rest of the system directly.
This is progress.
A sandbox is far better than letting an agent operate directly against a user’s laptop, production repository, cloud account, database, or internal tools.
But I think we are starting to treat the sandbox as a bigger answer than it really is.
A sandbox can limit where an agent acts. It cannot decide whether the action should happen, whether the caller has the right authority, whether the workflow state is still valid, whether the approval is meaningful, or whether the system can recover when something partially succeeds.
That is the fallacy.
The mistake is simple: we are isolating the agent, but leaving the workflow under-governed.
Isolation is necessary.
But isolation is not governance.

P.S. This is also one of the directions shaping how we are thinking about Flurit AI: not just agents that generate infrastructure, but governed execution paths for planning, reviewing, and applying infrastructure changes.
If that sounds relevant to your team, you can join the early-access waitlist here: [Join the Flurit waitlist]
The sandbox solves space, not authority
A sandbox gives the agent a place to work.
That matters. If an agent needs to clone a repository, inspect files, run tests, install dependencies, execute scripts, or generate artifacts, an isolated environment is a much better boundary than unbounded execution.
But production systems do not fail only because an agent had access to the wrong filesystem.
They also fail because the agent had the wrong authority.
A sandbox can isolate execution, but it does not know whether the current user, in the current context, should be allowed to perform the current action.
A developer may be allowed to view a repository. That does not mean their agent should be allowed to modify deployment configuration.
A platform engineer may be allowed to approve staging changes. That does not mean the same approval should carry over to production.
An admin may have broad access. That does not mean every agent acting on behalf of that admin should inherit the same authority.
This becomes even more important when agent workflows become reusable.
A compiled workflow should carry the procedure, not the permission assumptions from the trace that produced it.
If an agent previously completed a safe workflow for one user, in one workspace, with one risk level, that does not mean the same workflow is safe for every future caller.
The sandbox does not solve that.
Authorization has to remain dynamic and context-bound. Scope, delegation, revocation, caller identity, environment, and risk level need to be evaluated at execution time.
Otherwise, the system is not becoming safer.
It is just making an unsafe path faster.
The sandbox does not understand time
This is the part I think gets under-discussed.
A sandbox controls space.
Production agents also need control over time.
Agentic workflows do not happen in one frozen moment. They unfold across changing state.
The repository can change after the agent reads it. The user can update the requirement halfway through. A credential can expire. A policy can change. A previous tool call can partially succeed. A teammate can merge another infrastructure change. The cloud state can drift between planning and execution.
The sandbox may still be perfectly isolated.
But the workflow may no longer be valid.
This is why “the agent runs in a sandbox” is an incomplete answer. The real question is whether the execution carries durable, refreshable, and invalidatable state.
For a production agent, the system needs to know what assumptions were made, what files were read, what cloud snapshot was used, what plan was generated, which approvals were granted, and whether any of that context has expired before the next action.
Without that, a stale plan can become a live change.
And in infrastructure, a stale plan is not just a bad answer.
It can become a bad deployment.
Approval is not governance
Most agent approval flows are still too shallow.
They show the user a model-generated summary and ask for confirmation.
That may be fine for low-risk actions. But for production systems, approval needs evidence.
If an agent is about to modify infrastructure, the human should not only see a sentence saying, “I will update the deployment configuration.”
They should see what will change, which environment is affected, what resources are being created or modified, what the cost impact is, which policy checks passed, what exceptions exist, and what the rollback path looks like.
Without that, the user is not approving the action.
They are approving the agent’s description of the action.
That is a weak boundary.
A sandbox does not fix this. The agent may be safely contained while still presenting an incomplete approval request.
This is one of the subtle problems in agentic UX.
Humans-in-the-loop are only useful when the loop contains enough evidence for judgment.
A button is not governance.
A meaningful approval is a decision made with scope, diff, risk, and consequence visible.
Containment is not recovery
A sandbox can limit damage.
It does not automatically recover from damage.
That distinction matters.
Containment asks: how far can the failure spread?
Recovery asks: what happens next?
If a tool call fails, can the agent retry safely? If a tool call partially succeeds, can the system detect side effects? If a plan becomes stale, can the workflow pause and replan? If credentials are revoked, can the run stop cleanly? If the wrong environment was selected, can the system prevent execution before damage happens?
Resetting the sandbox is not the same as recovering the real-world workflow.
Once an agent interacts with repositories, cloud accounts, CI/CD systems, databases, ticketing systems, or customer environments, the consequence may live outside the sandbox.
The sandbox may be disposable.
The side effect may not be.
That is why production agents need checkpoints, replayable traces, revocation paths, and recovery semantics.
Not just isolated execution.
The real primitive is the governed execution cell
I think the better primitive is not the sandbox.
It is what I would call a governed execution cell.
A governed execution cell includes the sandbox, but it is larger than the sandbox.
It wraps the agentic task with the context needed to make execution safe, auditable, and recoverable.
Governed Execution Cell: Task intent Caller context Scoped capabilities Sandboxed execution Workflow state Policy gates Decision trace Approval checkpoints Recovery plan Revocation path
The sandbox answers:
Where does the agent work?
The governed execution cell answers:
Under what authority, with what state, under which controls, producing which trace, and with what recovery path?
That is a much more useful unit for production systems.
Because production readiness is not about whether the agent is isolated.
It is about whether the execution is governed.
DevOps agents expose this fastest
DevOps is one of the hardest domains for agentic systems because the agent is not just generating text.
It is operating around real systems with real consequences.
A DevOps agent may inspect repositories, infer architecture, generate Terraform, estimate cost, check policies, open pull requests, read logs, query cloud state, detect drift, recommend rollback, and coordinate approvals.
Each step carries context.
Each step has permission boundaries.
Each step can become unsafe if the environment, state, or caller assumptions are wrong.
That is why I think “AI-generated Terraform” is still too narrow as a category.
The harder problem is not generating Terraform.
The harder problem is governing the path from intent to infrastructure change.
A model can write code.
A tool can run a command.
A sandbox can contain execution.
But a production DevOps agent needs more than that.
It needs to know the difference between a draft and an approved plan. It needs to know when a cloud snapshot is stale. It needs to understand whether a cost estimate is based on enough configuration. It needs to know whether a policy violation blocks execution or requires exception approval. It needs to preserve the decision trail. It needs to recover when the workflow fails halfway through.
This is not just an agent problem.
It is a platform problem.
The prompt is not the boundary
A common mistake in agent systems is putting too much responsibility into the prompt.
The prompt says: be careful before making changes. Ask for confirmation. Do not access sensitive information unless necessary. Follow company policy.
That is useful as guidance.
It is weak as enforcement.
A prompt can influence behavior, but it should not be the boundary that protects the system.
The boundary should live in the runtime and control plane: scoped capabilities, policy gates, approval checkpoints, state validation, revocation, replay, and rollback.
Prompts are instructions.
Policies are constraints.
Runtimes are enforcement surfaces.
Production agents need all three, but they should not be confused.
The agent may be contained while the workflow is not
This is the line I keep coming back to.
The agent can be inside a sandbox and the workflow can still be unsafe.
The agent can be isolated and still act with stale permissions.
The agent can run in a container and still use the wrong environment.
The agent can ask for approval and still hide the real blast radius.
The agent can produce logs and still leave no useful decision trace.
The agent can be reset while the external side effect remains.
That is why I think the next generation of serious agent platforms will move beyond three early ideas:
Prompt as safety Tool schema as boundary Sandbox as production readiness
Each was useful.
None is sufficient.
The next layer is governed execution.
The real test
Before calling an agent production-ready, I would not ask only whether it can call tools or run in a sandbox.
I would ask whether the execution can be scoped, paused, revoked, resumed, audited, replayed, and recovered.
Can the system detect stale state before action? Can it show evidence before approval? Can it separate procedure from permission? Can it stop when the workflow is no longer valid?
If the answer is no, the agent may still be useful.
It may be a good prototype.
It may be a strong internal assistant.
It may be a promising demo.
But it is not production-ready yet.
Closing thought
The sandbox is where the agent works.
It is not what makes the work safe.
Safety comes from the larger boundary around the execution: authority, state, policy, traceability, approval, revocation, and recovery.
That is why I think the next serious agent platforms will not only ask:
Is this agent isolated?
They will ask:
Is this execution governed?
The agent sandbox is necessary.
The governed execution cell is the real primitive.
Thanks for reading Autonomous AI Architect! Subscribe for free to receive new posts and support my work.