Skip to main content
Use this guide when your LLM needs a reliable code-execution tool and you want strong isolation by default.

Diagram: Agent execution loop

For agent workloads, start with:
  • mode: "ephemeral" for stateless runs
  • network: "none" unless explicitly required
  • explicit timeoutMs, memoryLimit, and output cap
  • secrets passed via engine secrets (not raw echoing in code/output)

Build a reusable tool function

Wrap execution so your orchestrator always receives normalized fields.
Keep the tool contract small and stable (stdout, stderr, exitCode, durationMs) so your LLM prompt doesn’t drift.

Integrate with an LLM tool-call loop

The pattern is the same regardless of model provider:
  1. model requests a tool call
  2. agent executes code with isol8
  3. tool result is fed back
  4. model decides whether another iteration is needed

Stream output for long tasks

For long-running tool calls, stream events to your UI so users see progress.

Stateful agent workflows

When one step should reuse files/state from prior steps, use persistent execution in a long-lived process.
Persistent containers are runtime-bound. Do not switch Python -> Node in the same persistent container.

Remote multi-agent deployment

Use the same tool contract with remote execution when you need centralized policy and shared infrastructure.

Secrets and network policy for tool calls

If the agent must call external APIs:
  1. move from network: "none" to network: "filtered"
  2. set strict allow/deny rules
  3. pass credentials through secrets
Secret masking applies to stdout/stderr text, not arbitrary files written by executed code.

Patterns for reliable agent behavior

  • keep execution snippets short and focused
  • prefer deterministic tool outputs (JSON when possible)
  • gate package installs; pre-bake stable dependencies for production
  • enforce hard timeouts per tool run
  • return both stderr and exitCode to model, not just stdout

Execution guide

Understand lifecycle, modes, streaming, and request fields.

Option mapping

Exact CLI/config/API/library mapping for each option.

Security model

Network controls, seccomp, and secret masking boundaries.

Remote server and client

Run agents against centralized isolated execution infrastructure.