Skip to main content

Install

Use

What the tool does

  • On the first call, lazily creates a Podflare sandbox.
  • On each invocation, calls sandbox.run_code(code, language).
  • Returns a dict with keys stdout, stderr, exit_code.
  • The same sandbox is reused across invocations — Python REPL state persists, so the agent can build up state over a conversation.

Options

Cleanup

The returned tool exposes a close_podflare_sandbox() method. Call it after the agent run completes to destroy the VM.
For many short-lived agent runs, creating a new sandbox per run is fine (pool hits are ~10 ms). For long-running conversations, reuse the same tool across turns to keep REPL state alive.