DEV Community

Cover image for E2B Sandbox Executed the Code. The Policy to Run It Lived in a Sticky Note
Moshe Avdiel
Moshe Avdiel

Posted on Originally published at github.com

E2B Sandbox Executed the Code. The Policy to Run It Lived in a Sticky Note

I have sat next to the admin-dashboard wall at 22:19 while Grok Build was this close to calling the wrong MCP tool.

Not a model failure. A posture failure.

Toolradar: E2B MCP for data agents. Cardinal rule still: only what this week needs — live.

Someone on the floor said, out loud, it is sandboxed so it is safe. Grok Build had started earlier. The tool list was frozen in config.toml / .mcp.json / a skill file. The only “safe” move anyone trusted was:

  1. Kill Grok Build (or its MCP child)
  2. Edit the server list
  3. Restart the host
  4. Lose the plan the model already paid for

That is the ceremony. E2B/MCP code-exec is essential. Whether this turn may exec is a live gate.

The Aha: Sandbox is where. execute-gate is whether. Two different bugs. Real-time nested state is now a primitive — as native as a hashmap — via Kiponos.io. The host stays up. The leaf moves. The next tool call already obeys.

The problem: Sandboxes isolate CPU. They do not isolate policy.

Agentic programming in 2026 has a public fight: MCP vs CLI vs Skills. The likes on MCP and Grok Build posts are the tell. The industry is stuck on how to expose tools.

The missing primitive is live nested state:

Where the roster hid What you restart What you lose
MCP schema dump at session start The host, sometimes the child npx 16–72% of the window before the user speaks
~/.grok/config.toml / Cursor mcp.json Grok Build The open turn
SKILL.md / AGENTS.md The next turn, sometimes the host Context you already bought
“Just reconnect the server” The MCP session Tool-space you finally had right

E2B/MCP code-exec is essential. Whether this turn may exec is a live gate.

That is not a protocol bug you wait out. That is a process that cannot get() a tree that moved.

What teams believe

Belief Production
MCP is the standard so we are done MCP is how you call. It is not live posture
Skills will progressive-disclose it Skills are files. Files do not fan out
A bigger context window fixes tool overload 1M tokens still rot; selection still drops
Put the SDK in the SPA so the tile matches Connect tokens do not belong in a browser

What is Kiponos here

Kiponos is a live nested config hub. Dashboard edit → WebSocket delta → in-memory tree on every connected process. Hot-path get() is a local map lookup. One WebSocket per process lifetime.

It is not an MCP server. It is not a Skill. It is the control plane those things do not ship: which tools may run, how fat a result may be, whether execute is allowed, whether a child inherits posture — this turn.

Profile shape: ['my-app']['v1.0.0']['dev']['base']. The leaf in this story is execute-gate under examples/agentic-mcp-1005-pm-sandbox-not-posture/execute-gate.

Architecture

Architecture diagram

The model still calls tools. The wrapper reads execute-gate before the call. No schema dump policy in argv.

Config tree

examples/agentic-mcp-1005-pm-sandbox-not-posture:
  execute-gate: plan
  schema-budget: "4000"
  result-cap: "2000"
  tool-search: "on"
  execute-gate: "plan"
Enter fullscreen mode Exit fullscreen mode

Eight-plus keys when you pair execute-gate with sister dials (budget, mute, pause). They move together on the admin-dashboard wall.

Integration

Java tool wrapper (Grok Build just calls it):

import io.kiponos.Kiponos;
import io.kiponos.Folder;

Folder gate = Kiponos.createForCurrentTeam()
    .getFolder("examples/agentic-mcp-1005-pm-sandbox-not-posture");
String roster = String.valueOf(gate.get("execute-gate"));
// Grok Build tool: refuse the dangerous MCP call when posture moved
Enter fullscreen mode Exit fullscreen mode

Python peer:

from kiponos import Kiponos

k = Kiponos.connect(quiet=True)
try:
    posture = k.get("examples/agentic-mcp-1005-pm-sandbox-not-posture/execute-gate", "live")
    if not str(posture):
        raise PermissionError("Sandboxes isolate CPU. They do not isolate policy. gated live — host not restarted")
finally:
    k.disconnect()
Enter fullscreen mode Exit fullscreen mode

React/Angular: Node BFF @kiponos/react/server / @kiponos/angular/server. SPA never holds Connect tokens.

Runnable mesh: https://github.com/kiponos-io/kiponos-io/tree/master/examples/java/agentic-mcp-1005-pm-sandbox-not-posture./gradlew test run.

Real scenarios

Event Without Kiponos With Kiponos
Three MCP servers at boot 72% of the window gone Live roster / schema-budget; dump shrinks
User says “no writes” mid-turn Restart Grok Build Set execute-gate; next call already denies
Second host started earlier Paste the json into chat Both get() the same leaf
Subagent spawned Frozen argv copy Child get()s inherit-posture
Tool returns 500k tokens Context rot, doom loop result-cap in the wrapper

Performance (this path)

  • Wrapper get() is in-process after bootstrap.
  • One WebSocket per Grok Build lifetime — not per MCP call.
  • A dashboard edit is a delta of execute-gate, not a config.toml reload.
  • You do not spend model tokens to “please restart Grok Build.”
  • Schema tax is optional once the live set is small.

Compare to alternatives

Approach Honest fit Why it still restarts
More MCP servers More integrations More schema, worse selection
Skills progressive disclosure Good docs, lazy load Not a multi-host bus
Claude Code tool search Better client Other hosts still dump
Redis poll in the tool Shared, extra RTT You invented a hub with worse UX
Feature-flag SaaS Product experiments Rarely session-safe for MCP
Kill -9 the npx child Janitor The turn still died

When not to use Kiponos

Situation Why
Tool schema itself changed (new argument) That is a code/Grok Build restart
Secret rotation of Connect / MCP OAuth tokens Credentials are not live knobs
One-off local script, no peers A hub is overkill
Browser-only “SDK in the SPA” Forbidden — tokens leak or defaults lie

Pair execute-gate with a sister dial

execute-gate rarely moves alone on the admin-dashboard wall. Pair it with schema-budget, result-cap, or execute-gate so you do not fix Sandboxes isolate CPU. They do not isolate policy. by inventing a second incident.

Why Grok Build is the wrong restart target

Grok Build is good at calling tools. It is not a control plane. Killing it to flip execute-gate teaches the on-call that judgment requires a process ID. The admin-dashboard wall already disagrees.

Getting started (15 minutes)

  1. TeamPro on kiponos.io → Connect → KIPONOS_ID / KIPONOS_ACCESS / profile ['my-app']['v1.0.0']['dev']['base'].
  2. Clone github.com/kiponos-io/kiponos-io.
  3. cd examples/java/agentic-mcp-1005-pm-sandbox-not-posture && cp kiponos.local.env.example kiponos.local.env
  4. ./gradlew test run — prints examples/agentic-mcp-1005-pm-sandbox-not-posture/execute-gate=...
  5. In the dashboard, change execute-gate. Keep Grok Build up. No MCP reconnect.
  6. Point the tool wrapper at the same leaf. Do not ship a new server binary to flip Sandboxes isolate CPU. They do not isolate policy..

Further reading

The moral

If flipping Sandboxes isolate CPU. They do not isolate policy. requires restarting Grok Build or reconnecting MCP, you do not have agentic control. You have a hope with a process ID.

MCP, Skills, and tools are how agents act. Kiponos is the live primitive they do not ship — so the admin-dashboard wall can change its mind without killing the session.

How to try: examples/java/agentic-mcp-1005-pm-sandbox-not-posture and ./gradlew test.

Top comments (0)