Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

Modal 4 min read Case study mediumAdept

How Legora runs 2,000 parallel agent evals on Modal Sandboxes

Legora tests its long-running legal agent by booting the full application, pinned to a specific commit, inside a separate Modal Sandbox for each eval run. A typical experiment is about 2,000 runs (100 cases × 4 harness variants × 5 trials), all executed in parallel. Modal Volumes snapshot world state such as documents, database state, permissions and blobs, and also cache Docker images. An hourly pipeline pre-builds the image and pre-warms Sandboxes, and moving from gVisor to VM-backed Sandboxes let the team delete their Docker networking and FUSE workarounds. Agents now drive the eval CLI to hill-climb the harness, which helped cut agent cost by 30% through smarter compaction and custom tool search.

Related posts

  • Building with Modal and the OpenAI Agents SDK

    Modal mediumAdept

    A custom agent harness built on the OpenAI Agents SDK runs coding agents inside Modal Sandboxes, optionally with GPUs, rather than on the host, where an unsandboxed exec tool can be abused by malicious prompts. The harness grows step by step: SQLite-backed Sessions for memory, an orchestrator that delegates to subagents with fresh context windows to limit context rot, and an asyncio-based subagent pool for parallel, non-blocking work. Hooks and a set_status tool let the orchestrator monitor subagents, and per-GPU-type quotas cap spend. Filesystem snapshots are also used to avoid duplicated work. The worked example targets OpenAI's Parameter Golf challenge, with parallel MNIST training as an intermediate test.

  • How Abundant designed efficient rollout architecture with Modal Sandboxes

    Modal easyNovice

    Abundant runs its reinforcement learning rollout platform on Modal, with each of 75,000+ RL tasks executing in an isolated Modal Sandbox and Modal Functions powering the scheduler API. The design places a small monitor inside each Sandbox that sends heartbeats every 30 seconds, live events and final results over HTTP. The control plane retries three times before terminating a silent Sandbox. CPU and memory bursting let them request average rather than peak resources, cutting idle compute spend and avoiding OOMs. To counter evaluation awareness, they delete task instructions before work starts and add a reviewer agent that flags suspicious traces during verification.

  • Sandboxes, secure inference, and keeping agents from going rogue

    Stack Overflow Blog easyNovice

    Agent sandboxes are mostly micro-VMs built on Firecracker, Cloud Hypervisor, QEMU, gVisor or Docker, and buyers choose them mainly for performance rather than security. Daytona's Ivan Burazin says the biggest workloads are RL/post-training, where slow sandbox spin-up leaves expensive GPUs idle, and long-running app-layer agents. He contrasts sandboxes with EC2: millisecond starts from memory and disk snapshots distributed to local NVMe, live resizing, pause/resume, and forking from saved state. He also notes that recent exploits are often old bugs in the underlying isolation layers. A second conversation, with Blackbox AI's Richard Risk, argues for end-to-end encrypted inference, saying zero data retention is not the same as zero data visibility.

  • How Ramp built a full context background coding agent on Modal

    Modal easyNovice

    Ramp Inspect, an internal background coding agent, runs each session in a Modal Sandbox containing a full dev environment (Postgres, Redis, Temporal, RabbitMQ, OpenCode, VS Code server, VNC with Chromium) and now starts roughly half of merged pull requests at Ramp. Fast startup comes from a cron job that clones repos, installs dependencies and builds every 30 minutes, saving diff-based filesystem snapshots so sessions begin from a near-current state in seconds. Modal Dicts handle session locks and image metadata, and Queues route prompts from Slack, web and Chrome extension clients into shared multiplayer sessions, letting the system scale to hundreds of concurrent isolated sessions.

  • The Most Common Questions About Agent Evals, Answered

    LangChain mediumAdept

    Agent evals score agent runs to handle nondeterminism, multiple valid answers and variable execution paths: start by reading traces, pick one behavior, build a 10-20 example dataset from real traces, run a baseline experiment, and fold new failures back in. Offline evals compare versions against datasets before shipping, while online evals score sampled production traces without reference outputs. Use code evaluators where possible, LLM judges with narrow binary questions calibrated against human review, and pairwise comparison for choosing variants. Container-based benchmarks like Terminal-Bench (run via the open-source Harbor harness) score the end state of an environment for long multi-step tasks, and online costs can be controlled through sampling, filters, code checks and cheaper judge models.

The quest for software engineering knowledge.

Look:
Layout: