Skip to main content
IronClaw provides a Docker-based sandbox for executing long-running jobs in isolated containers. Each job runs in its own environment with strict resource limits, credential injection, and real-time event streaming.

Architecture

Job Modes

Worker

Standard IronClaw agent with proxied LLM calls through the orchestrator

Claude Code

Spawns the official claude CLI directly for Claude Code workflows

Creating Jobs

Via Tool

Via CLI

Worker Mode

Runs the IronClaw agent inside a container with LLM calls proxied through the orchestrator:

Container Configuration

Security Constraints

  • No network access (except orchestrator API)
  • Read-only filesystem (except /tmp and project dir)
  • CPU throttling via cgroup shares
  • Memory limits enforced by Docker
  • No privileged operations
  • Credentials injected via env vars, never in image

Execution Flow

  1. Orchestrator creates container
    • Generates unique bearer token
    • Stores credential grants
    • Starts container with orchestrator URL
  2. Worker fetches job description
  3. Worker fetches credentials
  4. Worker runs agent loop
    • LLM calls proxied through orchestrator
    • Tool execution within container
    • Real-time events streamed
  5. Worker reports completion

LLM Proxy

The worker uses ProxyLlmProvider to forward requests:

Project Directory Binding

Optionally bind a host directory into the container:
Validation prevents path traversal:

Claude Code Mode

Spawns the official Anthropic claude CLI for Claude Code workflows:

Configuration

Container Setup

Execution

Features

  • Full Claude Code experience inside sandbox
  • Tool filtering via allowlist
  • OAuth or API key auth
  • Real-time streaming to UI
  • Project directory binding for code access

Credential Injection

Credentials are injected at runtime, never baked into images:

Grant Definition

Injection Flow

  1. Job creation: Grants stored in TokenStore
  2. Worker startup: Fetches credentials via /credentials endpoint
  3. Tool execution: Credentials injected into child processes via Command::envs()

Security Properties

  • Never logged (redacted from debug output)
  • Never persisted (in-memory only)
  • Scoped to job (revoked on completion)
  • Process-isolated (not in global env)

Real-Time Events

Jobs stream events to the orchestrator for UI visibility:

Event Types

Streaming API

Resource Limits

Memory

Enforced via Docker --memory flag.

CPU

Throttles CPU usage but doesn’t hard-cap.

Timeout

Jobs are killed if they exceed timeout.

Concurrent Jobs

Global limit across all users.

Container Lifecycle

Creation

Monitoring

Cleanup

Containers are automatically removed after 1 hour of inactivity.

Docker API

Uses bollard for Docker interaction:

Building Images

Worker Image

Building

Security Considerations

Containers have no internet access except the orchestrator API. Use credential injection for external API calls through the host.
Root filesystem is read-only. Only /tmp and the project directory (if bound) are writable.
Containers run as non-root user. No --privileged flag, no capabilities.
Per-job bearer tokens are generated randomly and stored in-memory only. Tokens are revoked on job completion.
Credentials are redacted from logs and never persisted to disk. Leak detector scans all outputs.

Next Steps

Channels

Learn about multi-channel support

Configuration

Configure sandbox settings