---
title: "How Legora runs 2,000 parallel agent evals on Modal Sandboxes"
description: "Legora, an agentic system supporting lawyers, replaced its AI assistant with a full-fledged agent for longer autonomous tasks across thousands of documents. To test this agent, Legora runs every eval in an isolated Modal Sandbox, booting the full application including a DOCX editor, Turbopuffer, PDF conversion, Postgres, blobs, and code sandboxes. A typical experiment uses 100 cases, 4 harness variants, and 5 trials, totaling 2,000 parallel runs that must happen concurrently in the cloud. Legora uses Modal Volumes for shared document storage, snapshotting world state, and deduplicating setup, and an hourly pipeline builds the container image and pre-warms Sandboxes so only the delta needs to be applied. Switching from gVisor to Modal VM Sandboxes eliminated Docker workarounds, and the platform enables a self-improving agent loop that cut agent cost by 30% through smarter compaction and custom tool search."
---

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

[Modal](https://yomu.fyi/company/modal) · Modal · Oct 19, 2026

**Type:** Problem & solution

## Summary

Legora, an agentic system supporting lawyers, replaced its AI assistant with a full-fledged agent for longer autonomous tasks across thousands of documents. To test this agent, Legora runs every eval in an isolated Modal Sandbox, booting the full application including a DOCX editor, Turbopuffer, PDF conversion, Postgres, blobs, and code sandboxes. A typical experiment uses 100 cases, 4 harness variants, and 5 trials, totaling 2,000 parallel runs that must happen concurrently in the cloud. Legora uses Modal Volumes for shared document storage, snapshotting world state, and deduplicating setup, and an hourly pipeline builds the container image and pre-warms Sandboxes so only the delta needs to be applied. Switching from gVisor to Modal VM Sandboxes eliminated Docker workarounds, and the platform enables a self-improving agent loop that cut agent cost by 30% through smarter compaction and custom tool search.

## Context

Legora needed to rebuild its evaluation framework after shifting from an AI assistant to an autonomous legal agent. The new agent runs for hours across thousands of documents, requiring massive scalability and high environment fidelity that local execution could not provide.

## Approach / What changed

Each eval run executes in its own Modal Sandbox with a custom image and filesystem. Legora uses Modal Volumes for shared storage and world state snapshots, runs an hourly pipeline to pre-build container images, and switched from gVisor to Modal VM Sandboxes to eliminate Docker workarounds like host-mode networking, DNS, and FUSE mounts.

## Takeaways

- Legora runs 2,000 parallel agent eval runs concurrently using Modal Sandboxes, each sandbox booting the entire application including DOCX editor, Postgres, blob storage, and code sandboxes.
- Switching from gVisor to Modal VM Sandboxes eliminated workarounds for Docker networking, DNS, and FUSE, making Docker behave as on a normal Linux host.
- Legora’s evals platform enables a self-improving agent loop where agents hill-climb the harness; they cut agent cost by 30% through smarter compaction and custom tool search.

## FAQ

### How does Legora handle storage for 2,000 parallel eval runs?

Legora uses Modal Volumes to make large document collections available across Sandboxes, snapshot world state, and deduplicate shared setup while ensuring repeated runs begin from the same documents, database state, permissions, and blobs.

### Why did Legora switch from gVisor to Modal VM Sandboxes?

Legora switched to Modal VM Sandboxes to get a real Linux kernel, making Docker behave normally. This eliminated workarounds for host-mode networking, DNS resolution, and FUSE mounting that were previously required.

### How does Legora reduce evaluation build time?

Legora built an hourly pipeline that builds the container image and pre-warms Sandboxes, reducing the reset-to-commit step to only the delta from the previous build.

**Tags:** [Agents](https://yomu.fyi/topic/agents), [Evaluation](https://yomu.fyi/topic/evaluation), [Modal](https://yomu.fyi/topic/modal), [Sandboxing](https://yomu.fyi/topic/sandboxing)

- Source: [Modal](https://modal.com/blog/how-legora-runs-thousand-scale-parallel-agent-evals-on-modal-sandboxes)
- Source URL: https://modal.com/blog/how-legora-runs-thousand-scale-parallel-agent-evals-on-modal-sandboxes
- Ingested by Yomu: 2026-10-26T18:00:18.216Z

[Read original post](https://modal.com/blog/how-legora-runs-thousand-scale-parallel-agent-evals-on-modal-sandboxes)
