# Archil for legal and document AI: the whole matter, as files every agent can use

Source: https://archil.com/solutions/document-ai

Unzip a production onto one disk and mount it in every sandbox. Agents list, open, search, and write a matter's documents with ordinary file tools, even at millions of files, with a checkpoint to return to after every run.

Legal and document AI

# The whole matter, as files every agent can use.

Unzip a production onto one disk and every sandbox mounts it. Agents list, open, search, and write the matter's documents the normal way, even at millions of files.

[Talk to an integration specialist](https://cal.com/team/archil/demo)[Read the docs](https://docs.archil.com/getting-started/introduction)

The production lands once. Every sandbox mounts the same disk and works on the files at once.

Mounts where your agents run

-   _Amazon Web Services_
-   _Google Cloud_
-   _Cloudflare_
-   _Kubernetes_
-   _Linux_

Disks mount on any Linux machine or sandbox, and can sync with S3, Google Cloud Storage, or R2. [How BYOC works](https://docs.archil.com/reference/byoc).

## Where a big matter strains the usual setups.

Each works for a small folder. Millions of documents find the gaps.

### A bucket mount lists page by page

An ls is S3 LIST calls of 1,000 keys, one after another, and existing files can't be edited.

### An NFS share waits on every create

An unzip makes one server round trip per file, and S3 code can't reach the share.

### A copy in every sandbox

Each sandbox waits for its own copy, and its edits never reach the others.

## Normal file operations, at matter scale.

One disk per matter, mounted by every sandbox that works on it.

### The operations agents run all day

Published p50s, measured from one host in the disk's region; the scripts are public.

### Unzip a production onto the disk

Check out the folder and the unzip runs at local-disk speed while other sandboxes keep reading.

### One disk per matter, thousands of sandboxes

A disk token mounts its matter and no other, from up to 5,000 clients at once.

### A way back from any agent run

Checkpoint before a run and branch from it to return to that state, on Archil-managed disks in AWS regions.

### The same files over S3

Your app reads and writes the matter over the S3 API, consistent with every mount.

## Give agents the matter, then let them work.

File tools for the agent, a mount for every sandbox, and a checkpoint before each run.

[AI SDK tools](https://docs.archil.com/integrations/ai-sdk)

matter\_agent.ts

File tools for the agent

```
import { generateText, isStepCount } from "ai";
import * as archil from "disk";
import { createDiskTools } from "@archildata/ai-sdk";
 
// One disk per matter
const { disk: matter } = await archil.createDisk({
  name: "matter-2026-0142",
});
 
// A mount token for the matter's sandboxes
const { token } = await matter.createToken("sandboxes");
 
// list_files, glob, grep, read_file, write_file,
// delete_file, run_bash: the matter as files
const result = await generateText({
  model: "anthropic/claude-sonnet-5.5",
  tools: {
    ...createDiskTools(matter),
    semantic_search: yourIndexTool, // keep your index
  },
  prompt: "List every document in PROD004 that cites "
    + "the side letter, and log each one to notes/.",
  stopWhen: isStepCount(30),
});
```

sandbox.sh

In every sandbox

```
# In every sandbox: mount the matter, shared
export ARCHIL_MOUNT_TOKEN="<token>"
sudo --preserve-env=ARCHIL_MOUNT_TOKEN \
  archil mount dsk-XXXXXXXXXXXX /mnt/matter \
  --region aws-us-east-1 --conditional
 
# Unzip a production into a folder this sandbox
# checks out, then hand it back
mkdir /mnt/matter/PROD004
archil checkout /mnt/matter/PROD004
unzip -q /incoming/PROD004.zip -d /mnt/matter/PROD004
archil checkin /mnt/matter/PROD004
 
# Checkpoint before the agent runs
archil checkpoints create /mnt/matter before-run
 
# Not what you wanted? Branch from the checkpoint
# and mount the matter as it was
archil branches --region aws-us-east-1 create \
  dsk-XXXXXXXXXXXX retry-1 --from-checkpoint before-run
```

-   The grep tool fans out across microVMs, so it searches millions of files in one call.
-   Team includes 25,000 disks per region; Enterprise, unlimited.

[Sharing a disk between agents](https://docs.archil.com/concepts/sharing-disks)[Checkpoints and branches](https://docs.archil.com/concepts/branches-and-checkpoints)

## Built for the security review.

Where the data lives, and who else touches it.

### Residency by region

Active data stays in the region you choose, US or EU; Enterprise can sign a DPA.

### BYOC, inside your cloud

File data and names never leave your account, and Archil isn't your customers' sub-processor.

-   SOC 2 Type II; AES-256 at rest and TLS 1.2+ in transit.

[Security and compliance](https://docs.archil.com/details/security)[BYOC](https://docs.archil.com/reference/byoc)[Authorization](https://docs.archil.com/concepts/authorization)

## How the options compare.

Ways to put a big matter in front of many agents.

Ways to put a big matter in front of many agents, compared
| Property | Bucket mount (Mountpoint) | Shared NFS (EFS, Filestore) | Copy into each sandbox | Archil |
| --- | --- | --- | --- | --- |
| Edit an existing file | No, new files only | Yes | Yes, in that copy | Yes |
| Unzip thousands of files | Each file a new object | A server round trip each | Local disk, once per copy | Local-disk speed, checked out |
| Many sandboxes, one matter | Each mounts the bucket | Each mounts the share | One full copy each | Up to 5,000 per disk |
| Back to a known good state | S3 versions, object by object | Restore a backup | Copy it again | Branch from a checkpoint |
| Apps that speak S3 | Yes, the bucket | No S3 API | Not the copies | Yes, every disk |

### Bucket mount (Mountpoint)

Edit an existing file

No, new files only

Unzip thousands of files

Each file a new object

Many sandboxes, one matter

Each mounts the bucket

Back to a known good state

S3 versions, object by object

Apps that speak S3

Yes, the bucket

### Shared NFS (EFS, Filestore)

Edit an existing file

Yes

Unzip thousands of files

A server round trip each

Many sandboxes, one matter

Each mounts the share

Back to a known good state

Restore a backup

Apps that speak S3

No S3 API

### Copy into each sandbox

Edit an existing file

Yes, in that copy

Unzip thousands of files

Local disk, once per copy

Many sandboxes, one matter

One full copy each

Back to a known good state

Copy it again

Apps that speak S3

Not the copies

### Archil

Edit an existing file

Yes

Unzip thousands of files

Local-disk speed, checked out

Many sandboxes, one matter

Up to 5,000 per disk

Back to a known good state

Branch from a checkpoint

Apps that speak S3

Yes, every disk

[Performance](https://docs.archil.com/details/performance)[Limits](https://docs.archil.com/reference/limits)

## Bring your largest matter.

[Talk to an integration specialist](https://cal.com/team/archil/demo)[Start building](https://console.archil.com)
