This is the bit I think gets uncomfortable with coding agents: We keep asking “is the agent sandboxed?” when the better question might be: What was this agent actually allowed to change, and can I prove it stayed inside that boundary?
Filesystem isolation solves one boundary. MCP permissions solve another. Human approval solves another. But once an agent can edit code + invoke tools + trigger external effects, “safe” becomes less about where it runs and more about whether its actual behaviour stayed inside the contract we gave it.
Have you seen anyone treating that contract itself as something executable/testable rather than another set of instructions the agent is expected to follow?
Forward deployed & applied AI engineer. Built Sahkarmi, an open-source desktop AI coworker with human approval gates. 16 yrs running the operations I now automate.
Yes—the contract needs to be executable at the boundary, not merely repeated in the system prompt. I have not built a framework-independent implementation of that yet, but the shape I would test is: an allowlisted tool set, typed arguments, permitted filesystem/network scopes, a side-effect budget, and an event log that records the observed action plus the resulting state change. Then the test is not “did the model say it complied?” but “could any emitted action or state diff exist outside the contract?” Prompt instructions can still express intent; a deterministic policy layer has to reject the out-of-contract action.
Exactly. Prompts express intent; deterministic policies enforce boundaries. That's the direction I'm exploring with Stet at the codebase level. Would love to compare approaches, particularly around validating state changes independently of the agent.
Forward deployed & applied AI engineer. Built Sahkarmi, an open-source desktop AI coworker with human approval gates. 16 yrs running the operations I now automate.
I'd start with a small fixture where the agent reports completion and an independent read checks the resulting state. A deliberate mismatch would tell us whether the verifier can catch an incorrect completion claim.
That's the right test: the verifier has to catch a false "done", not just confirm a true one.
I'd want the fixture to cover the three ways I see completion claims go wrong in practice, because they fail differently:
"All tests pass", but one was skipped or its assertion removed. The state looks green, so the verifier has to read the diff, not just the exit code.
"Fixed the bug", but only the expected value changed to match the bug. Tests pass on both sides, which makes it the hardest one to catch.
"Done", but a file outside the task changed too. Correct result, wrong path to it.
Each case gets a known-bad branch and a known-good one. The verifier reads the repo state independently against main and should flag the bad one and pass the good one. Run it a few times to show it's deterministic.
In my experiments the verifier catches 1 and 3 reliably today, and 2 is the gap. That's probably the most interesting thing a fixture like this could measure. Happy to put a small repo together if you want to try it against your setup.
When an agent needs a browser or web session over MCP, do you isolate that browser inside its own disposable remote container rather than letting an MCP bridge launch a browser on the host?
Forward deployed & applied AI engineer. Built Sahkarmi, an open-source desktop AI coworker with human approval gates. 16 yrs running the operations I now automate.
Agreed on the principle—isolating browser automation in its own disposable container or remote browser session (the posture behind OpenClaw's optional sandboxed browser) is much cleaner than letting an MCP bridge touch your daily browser profile, saved cookies, or local network. Speaking from architecture docs rather than running a multi-tenant browser grid ourselves, keeping browser state ephemeral per session avoids turning web access into host credential exposure.
Thanks for the detail on keeping browser state ephemeral per session so an MCP bridge never touches your daily browser profile, saved cookies, or local network. I'm building BrowserBox to run browser sessions inside an isolated remote container off the host machine so web access from an agent or operator cannot expose local host credentials: browserbox.io/go/forum-20261128-de...
Forward deployed & applied AI engineer. Built Sahkarmi, an open-source desktop AI coworker with human approval gates. 16 yrs running the operations I now automate.
Thanks—the remote disposable-session boundary is exactly the direction I meant. The verification checklist I would apply is: a fresh browser profile per logical run, no route to the operator’s LAN or daily-browser data, short-lived scoped credentials, explicit download/upload mounts, and deterministic destruction of cookies and session artifacts at the end. Isolation is strongest when those properties are enforced by the runtime and visible in an audit record, rather than left as instructions to the agent.
That list holds up, and the last sentence is the part most setups skip. Two of the five are easy to get wrong on the operator's own machine.
"No route to the LAN" is a firewall rule when the browser runs in a container on the laptop, and firewall rules drift: one --network=host for debugging and the agent can reach the router and the NAS again. Put the browser on a machine in another network and it is true by topology, with nothing to keep configured.
Destruction is the same story. Deleting a profile directory leaves the cache, the downloads folder, crash dumps and whatever the page wrote through the file system API, and you can't prove you found all of it. Delete the whole instance at the end of the run and the proof is one line: the provider's own delete event for that instance ID, which the agent could not have written.
That is also the test for the audit record. Anything the agent reports about its own isolation is the instruction read back to you. The record has to come from the layer that created and destroyed the browser.
One item to add: the link or token that reaches the session is a credential too. Make it random per run and let it die with the instance, or the disposable browser has a permanent front door.
Forward deployed & applied AI engineer. Built Sahkarmi, an open-source desktop AI coworker with human approval gates. 16 yrs running the operations I now automate.
The provider-side deletion event gives the audit trail an independent source. I'd tie the session credential to the same instance and expiry, so the audit can check both that the environment ended and that access ended with it.
Nova Ops — AI automation systems and software. Home of Elias HiveMind for Obsidian. We build small, measured tools — MCP servers, plugins, release gates — and write up real builds with real numbers.
'The stdio transport is not a sandbox' is the sentence most local MCP setups are quietly built on forgetting. Your Gateway point is the version that bites: the definitions and the stdio children live on the host control plane, so the container wraps the agent's workspace tools while the server process keeps the operator's full environment — ~/.ssh, exported tokens, all of it. Our own MCP server runs as a local stdio process, and the discipline we've applied so far is all at the tool surface — trimming what each tool returns, measuring the context cost — which your piece points out is a different boundary from the process itself. The digest-pinned image versus npx resolving transitive dependencies at install time is the same gap on the supply side. For a single-operator local setup, where do you land: containerize even the read-only servers, or is a tight tool filter plus no network enough for that threat model?
Forward deployed & applied AI engineer. Built Sahkarmi, an open-source desktop AI coworker with human approval gates. 16 yrs running the operations I now automate.
For a third-party or dynamically installed server, I would isolate it even if its advertised tools are read-only. A tool filter constrains the RPC surface; it does not constrain what the server process can read or execute before returning the result. For a small, audited in-house binary, a dedicated OS user, explicit read-only mounts, no network, no inherited environment and a pinned artifact may be a reasonable lower-cost boundary. The deciding question is process provenance and accessible host state—not whether the tool schema uses verbs like “get” or “list.”
Nova Ops — AI automation systems and software. Home of Elias HiveMind for Obsidian. We build small, measured tools — MCP servers, plugins, release gates — and write up real builds with real numbers.
Provenance and accessible host state, not the verbs in the schema — that's the deciding question stated correctly. A read-only tool from an unaudited process is still an unaudited process with the host's filesystem in reach. Our own MCP server earns the lighter boundary the same way yours does: it's in-house, the artifact is pinned, and the tool set is three tools we measured before adding — the trust follows the provenance, not the tool names. For the in-house case, does the pinned artifact get re-audited on every version change, or does a hash change alone trigger the re-check?
Forward deployed & applied AI engineer. Built Sahkarmi, an open-source desktop AI coworker with human approval gates. 16 yrs running the operations I now automate.
I'd use a hash change to trigger review. It tells you the artifact changed, and the review decides what to recheck. I'd look at dependency and permission changes too, even when the exposed tool names stay the same.
One boundary the checklist leaves open: the sandbox protects the host, not the outside world. Your ShellBench example makes the point - 40.3% of submissions recommended a duplicate or incorrect payment. That payment is not host state; it is an outbound tool call, and a contained agent with a networked MCP server can still make it from inside the container. The moment a tool genuinely needs network (payments, email, prod APIs), --network=none is off the table, and the container no longer bounds what the tool does.
Same shape on the Gateway side: SecretRefs stay on the host, so the agent never holds the token - but it can still spend it through any tool call the policy allows. The credential is out of reach but not out of influence.
Do you treat that as a second allowlist problem - per-tool confirmation for anything with an external effect - or is there a layer in OpenClaw that scopes what a sandboxed session may ask the Gateway to do on its behalf?
Forward deployed & applied AI engineer. Built Sahkarmi, an open-source desktop AI coworker with human approval gates. 16 yrs running the operations I now automate.
Sharp distinction—container isolation only bounds host filesystem and OS state, not valid outbound tool calls once network access is open. From OpenClaw's docs (rather than our own penetration test), it splits those controls across tool allow/deny policy per session, tools.exec approval gates, and host-held SecretRefs so raw tokens stay off the container. Even then, preventing a duplicate payment or unwanted email still requires a second enforcement layer at the tool/Gateway edge: explicit human confirmation or scoped limits per external side effect, because --network=none isn't viable there.
Good write-up, and the MCP quote is the line people skip. One pattern that closes the stdio gap without giving up local servers: launch the MCP server inside the same per-run sandbox as the agent, not beside it, so the harness talks stdio to a process that already sits behind the boundary. Then the only things crossing are the stdio stream and whatever secrets you inject on purpose for that run.
OAuth is the awkward part, since those flows want a host browser. I'd keep the token exchange on the host and pass in a short-lived, narrowly scoped token rather than the refresh token. Do you know if OpenClaw lets you move a single mcp.servers entry into the sandbox, or is it all-or-nothing?
Forward deployed & applied AI engineer. Built Sahkarmi, an open-source desktop AI coworker with human approval gates. 16 yrs running the operations I now automate.
From the OpenClaw boundary docs I audited, I did not find a per-mcp.servers switch that relocates one local stdio child into the agent’s existing sandbox. The Gateway owns those definitions and launches the child on the host. So I would make the server command itself an isolation wrapper—e.g. a digest-pinned container with explicit mounts, no host network by default, and a short-lived scoped token injected for that run. That gives you per-server isolation even though the Gateway still owns the stdio pipe. I would not pass the refresh token into the container.
GMT strategy and custom B2B outreach lists on request: people and companies by ICP, domain, profile URL, email or name. 1B+ profiles. Claude Code plugins, API, MCP. kevin@outricher.com
even before the container step i'd start every local server with an empty env and hand it only the one key it needs. inheriting the whole shell is such a quiet default and it's cheap to check
Forward deployed & applied AI engineer. Built Sahkarmi, an open-source desktop AI coworker with human approval gates. 16 yrs running the operations I now automate.
A clean environment is a good baseline. I'd add only the variables the server needs, scope any credential to that server, and check what the child process actually received without logging secret values. Filesystem and network access need their own checks too.
We're a place where coders share, stay up-to-date and grow their careers.
This is the bit I think gets uncomfortable with coding agents: We keep asking “is the agent sandboxed?” when the better question might be: What was this agent actually allowed to change, and can I prove it stayed inside that boundary?
Filesystem isolation solves one boundary. MCP permissions solve another. Human approval solves another. But once an agent can edit code + invoke tools + trigger external effects, “safe” becomes less about where it runs and more about whether its actual behaviour stayed inside the contract we gave it.
Have you seen anyone treating that contract itself as something executable/testable rather than another set of instructions the agent is expected to follow?
Yes—the contract needs to be executable at the boundary, not merely repeated in the system prompt. I have not built a framework-independent implementation of that yet, but the shape I would test is: an allowlisted tool set, typed arguments, permitted filesystem/network scopes, a side-effect budget, and an event log that records the observed action plus the resulting state change. Then the test is not “did the model say it complied?” but “could any emitted action or state diff exist outside the contract?” Prompt instructions can still express intent; a deterministic policy layer has to reject the out-of-contract action.
Exactly. Prompts express intent; deterministic policies enforce boundaries. That's the direction I'm exploring with Stet at the codebase level. Would love to compare approaches, particularly around validating state changes independently of the agent.
I'd start with a small fixture where the agent reports completion and an independent read checks the resulting state. A deliberate mismatch would tell us whether the verifier can catch an incorrect completion claim.
That's the right test: the verifier has to catch a false "done", not just confirm a true one.
I'd want the fixture to cover the three ways I see completion claims go wrong in practice, because they fail differently:
Each case gets a known-bad branch and a known-good one. The verifier reads the repo state independently against main and should flag the bad one and pass the good one. Run it a few times to show it's deterministic.
In my experiments the verifier catches 1 and 3 reliably today, and 2 is the gap. That's probably the most interesting thing a fixture like this could measure. Happy to put a small repo together if you want to try it against your setup.
When an agent needs a browser or web session over MCP, do you isolate that browser inside its own disposable remote container rather than letting an MCP bridge launch a browser on the host?
Agreed on the principle—isolating browser automation in its own disposable container or remote browser session (the posture behind OpenClaw's optional sandboxed browser) is much cleaner than letting an MCP bridge touch your daily browser profile, saved cookies, or local network. Speaking from architecture docs rather than running a multi-tenant browser grid ourselves, keeping browser state ephemeral per session avoids turning web access into host credential exposure.
Thanks for the detail on keeping browser state ephemeral per session so an MCP bridge never touches your daily browser profile, saved cookies, or local network. I'm building BrowserBox to run browser sessions inside an isolated remote container off the host machine so web access from an agent or operator cannot expose local host credentials: browserbox.io/go/forum-20261128-de...
Thanks—the remote disposable-session boundary is exactly the direction I meant. The verification checklist I would apply is: a fresh browser profile per logical run, no route to the operator’s LAN or daily-browser data, short-lived scoped credentials, explicit download/upload mounts, and deterministic destruction of cookies and session artifacts at the end. Isolation is strongest when those properties are enforced by the runtime and visible in an audit record, rather than left as instructions to the agent.
That list holds up, and the last sentence is the part most setups skip. Two of the five are easy to get wrong on the operator's own machine.
"No route to the LAN" is a firewall rule when the browser runs in a container on the laptop, and firewall rules drift: one --network=host for debugging and the agent can reach the router and the NAS again. Put the browser on a machine in another network and it is true by topology, with nothing to keep configured.
Destruction is the same story. Deleting a profile directory leaves the cache, the downloads folder, crash dumps and whatever the page wrote through the file system API, and you can't prove you found all of it. Delete the whole instance at the end of the run and the proof is one line: the provider's own delete event for that instance ID, which the agent could not have written.
That is also the test for the audit record. Anything the agent reports about its own isolation is the instruction read back to you. The record has to come from the layer that created and destroyed the browser.
One item to add: the link or token that reaches the session is a credential too. Make it random per run and let it die with the instance, or the disposable browser has a permanent front door.
The provider-side deletion event gives the audit trail an independent source. I'd tie the session credential to the same instance and expiry, so the audit can check both that the environment ended and that access ended with it.
'The stdio transport is not a sandbox' is the sentence most local MCP setups are quietly built on forgetting. Your Gateway point is the version that bites: the definitions and the stdio children live on the host control plane, so the container wraps the agent's workspace tools while the server process keeps the operator's full environment — ~/.ssh, exported tokens, all of it. Our own MCP server runs as a local stdio process, and the discipline we've applied so far is all at the tool surface — trimming what each tool returns, measuring the context cost — which your piece points out is a different boundary from the process itself. The digest-pinned image versus npx resolving transitive dependencies at install time is the same gap on the supply side. For a single-operator local setup, where do you land: containerize even the read-only servers, or is a tight tool filter plus no network enough for that threat model?
For a third-party or dynamically installed server, I would isolate it even if its advertised tools are read-only. A tool filter constrains the RPC surface; it does not constrain what the server process can read or execute before returning the result. For a small, audited in-house binary, a dedicated OS user, explicit read-only mounts, no network, no inherited environment and a pinned artifact may be a reasonable lower-cost boundary. The deciding question is process provenance and accessible host state—not whether the tool schema uses verbs like “get” or “list.”
Provenance and accessible host state, not the verbs in the schema — that's the deciding question stated correctly. A read-only tool from an unaudited process is still an unaudited process with the host's filesystem in reach. Our own MCP server earns the lighter boundary the same way yours does: it's in-house, the artifact is pinned, and the tool set is three tools we measured before adding — the trust follows the provenance, not the tool names. For the in-house case, does the pinned artifact get re-audited on every version change, or does a hash change alone trigger the re-check?
I'd use a hash change to trigger review. It tells you the artifact changed, and the review decides what to recheck. I'd look at dependency and permission changes too, even when the exposed tool names stay the same.
One boundary the checklist leaves open: the sandbox protects the host, not the outside world. Your ShellBench example makes the point - 40.3% of submissions recommended a duplicate or incorrect payment. That payment is not host state; it is an outbound tool call, and a contained agent with a networked MCP server can still make it from inside the container. The moment a tool genuinely needs network (payments, email, prod APIs), --network=none is off the table, and the container no longer bounds what the tool does.
Same shape on the Gateway side: SecretRefs stay on the host, so the agent never holds the token - but it can still spend it through any tool call the policy allows. The credential is out of reach but not out of influence.
Do you treat that as a second allowlist problem - per-tool confirmation for anything with an external effect - or is there a layer in OpenClaw that scopes what a sandboxed session may ask the Gateway to do on its behalf?
Sharp distinction—container isolation only bounds host filesystem and OS state, not valid outbound tool calls once network access is open. From OpenClaw's docs (rather than our own penetration test), it splits those controls across tool allow/deny policy per session,
tools.execapproval gates, and host-heldSecretRefsso raw tokens stay off the container. Even then, preventing a duplicate payment or unwanted email still requires a second enforcement layer at the tool/Gateway edge: explicit human confirmation or scoped limits per external side effect, because--network=noneisn't viable there.Good write-up, and the MCP quote is the line people skip. One pattern that closes the stdio gap without giving up local servers: launch the MCP server inside the same per-run sandbox as the agent, not beside it, so the harness talks stdio to a process that already sits behind the boundary. Then the only things crossing are the stdio stream and whatever secrets you inject on purpose for that run.
OAuth is the awkward part, since those flows want a host browser. I'd keep the token exchange on the host and pass in a short-lived, narrowly scoped token rather than the refresh token. Do you know if OpenClaw lets you move a single mcp.servers entry into the sandbox, or is it all-or-nothing?
From the OpenClaw boundary docs I audited, I did not find a per-
mcp.serversswitch that relocates one local stdio child into the agent’s existing sandbox. The Gateway owns those definitions and launches the child on the host. So I would make the server command itself an isolation wrapper—e.g. a digest-pinned container with explicit mounts, no host network by default, and a short-lived scoped token injected for that run. That gives you per-server isolation even though the Gateway still owns the stdio pipe. I would not pass the refresh token into the container.even before the container step i'd start every local server with an empty env and hand it only the one key it needs. inheriting the whole shell is such a quiet default and it's cheap to check
A clean environment is a good baseline. I'd add only the variables the server needs, scope any credential to that server, and check what the child process actually received without logging secret values. Filesystem and network access need their own checks too.