Diagram: Agent execution loop
Recommended baseline
For agent workloads, start with:mode: "ephemeral"for stateless runsnetwork: "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.Integrate with an LLM tool-call loop
The pattern is the same regardless of model provider:- model requests a tool call
- agent executes code with isol8
- tool result is fed back
- 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.- CLI server
- Library client
- API request
Secrets and network policy for tool calls
If the agent must call external APIs:- move from
network: "none"tonetwork: "filtered" - set strict allow/deny rules
- pass credentials through
secrets
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
stderrandexitCodeto model, not juststdout
Related pages
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.