---
title: "How Legora runs 2,000 parallel agent evals on Modal Sandboxes"
description: "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."
url: "https://swe.quest/articles/how-legora-runs-2-000-parallel-agent-evals-on-modal-sandboxes-18a61f0150fc40b8"
canonical: "https://modal.com/blog/how-legora-runs-thousand-scale-parallel-agent-evals-on-modal-sandboxes"
source: "Modal"
published: "2026-10-19"
difficulty: "medium"
kind: "Case study"
reading_minutes: 4
tags: ["evals","ai-agents","sandboxing","virtualization","containers"]
---

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

A post on [Modal](https://swe.quest/sources/modal.md), published 2026-10-19, 4 min read, Case study. Original: [https://modal.com/blog/how-legora-runs-thousand-scale-parallel-agent-evals-on-modal-sandboxes](https://modal.com/blog/how-legora-runs-thousand-scale-parallel-agent-evals-on-modal-sandboxes)

## Summary

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.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Evaluation](https://swe.quest/tags/evals.md) (AI & ML)
- [AI agents](https://swe.quest/tags/ai-agents.md) (AI & ML)
- [Sandboxing & isolation](https://swe.quest/tags/sandboxing.md) (Security)
- [Virtualization](https://swe.quest/tags/virtualization.md) (Infrastructure)
- [Containers](https://swe.quest/tags/containers.md) (Infrastructure)

## Prerequisites

- Docker Compose ([easy posts on Containers](https://swe.quest/tags/containers.md?difficulty=easy))
- LLM agent evaluation ([easy posts on LLMs](https://swe.quest/tags/llms.md?difficulty=easy))

## Keywords

Modal, Modal Sandboxes, Modal Volumes, gVisor, Docker, Legora, BAR benchmark

## Related posts

- [Building with Modal and the OpenAI Agents SDK](https://swe.quest/articles/building-with-modal-and-the-openai-agents-sdk-c24777075f600dcf.md): Modal · 2026-04-15 · Medium · 12 min read · AI agents, Sandboxing & isolation, LLMs, Python, Cloud platforms
  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.
- [How Abundant designed efficient rollout architecture with Modal Sandboxes](https://swe.quest/articles/how-abundant-designed-efficient-rollout-architecture-with-modal-sandboxes-6590e651fd7feefd.md): Modal · 2026-11-19 · Easy · 4 min read · Sandboxing & isolation, Model training, Evaluation, Serverless, Cost optimization
  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.
- [Sandboxes, secure inference, and keeping agents from going rogue](https://swe.quest/articles/sandboxes-secure-inference-and-keeping-agents-from-going-rogue-5eb1e7d621c68043.md): Stack Overflow Blog · 2026-11-27 · Easy · 25 min read · Sandboxing & isolation, AI agents, Virtualization, Inference & serving, Performance engineering
  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.
- [How Ramp built a full context background coding agent on Modal](https://swe.quest/articles/how-ramp-built-a-full-context-background-coding-agent-on-modal-8c26a10f9ce0801d.md): Modal · 2026-02-19 · Easy · 6 min read · AI agents, AI for coding, Sandboxing & isolation, Developer productivity
  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.
- [The Most Common Questions About Agent Evals, Answered](https://swe.quest/articles/the-most-common-questions-about-agent-evals-answered-40ebbb294f8cf253.md): LangChain · 2026-10-15 · Medium · 15 min read · Evaluation, AI agents, Observability, LLMs
  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.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
