Skip to main content

What You’ll Learn

  • How to create one sandbox per agent for maximum isolation
  • How to pass data between agents by reading from one sandbox and writing to the next
  • How to verify that agents cannot access each other’s files
  • The orchestrator-mediated data flow pattern for multi-agent systems

Prerequisites

  • Declaw running locally or in the cloud (see Deployment)
  • DECLAW_API_KEY and DECLAW_DOMAIN set in your environment
This example is available in Python. TypeScript support coming soon.

Pipeline Architecture

Sandboxes never communicate with each other. The orchestrator reads the output of one sandbox and supplies it as the input to the next.

Code Walkthrough

Agent scripts

Each agent is a self-contained Python script uploaded to its sandbox: Agent 1 — Data Collector generates 20 sales records and writes them to output.json:
Agent 2 — Data Processor filters returned items, computes revenue, and aggregates by product and region:
Agent 3 — Report Generator reads the processed data and produces a formatted text report.

The run_agent helper

A shared helper handles the upload-run-read cycle for each agent:

Orchestrating the pipeline

Expected Output

Isolation Guarantees

Each sandbox is a separate sandbox with its own:
  • Filesystem — Agent 1 cannot read Agent 2’s files or vice versa
  • Process tree — Agents cannot list or signal each other’s processes
  • Network namespace — Agents cannot connect to each other’s ports
This makes the pattern safe for untrusted agent code: even if an agent is compromised, it cannot reach the other agents or the host.