The problem
You need AI to do real work — not just generate text, but search your vaults, run legal research, compile reports, and upload results. But LLM API calls are stateless: no file system, no tools, no persistence.The solution
An agent is a reusable AI executor that runs in an isolated sandbox with the full Case.dev platform. Define it once with instructions, then create runs against it with different prompts. Each run spins up a dedicated sandbox with an AI coding agent and thecasedev CLI pre-authenticated. The agent can search vaults, run legal research, process documents, write files, and upload results — autonomously.
Quick start
Ad-hoc execution
Don’t need a persistent agent? Use the/execute endpoint to run an agent in a single call — no setup required:
/execute endpoint creates an ephemeral agent behind the scenes and immediately starts execution. You get back a runId to poll for status and results — same as the full flow.
| Parameter | Type | Required | Description |
|---|---|---|---|
prompt | string | yes | Task for the agent |
instructions | string | no | Custom system prompt |
model | string | no | LLM model (default: claude-sonnet) |
vaultIds | string[] | no | Restrict to specific vaults |
objectIds | string[] | no | Scope to specific vault object IDs |
guidance | string | no | Additional run context |
enabledTools | string[] | no | Tool allowlist |
disabledTools | string[] | no | Tool denylist |
sandbox | object | no | Custom CPU/memory |
How it works
Full lifecycle (persistent agents):- Define an agent with a name, instructions, and optional model/vault restrictions
- Create a run with a prompt — this queues it without executing
- Execute the run — a durable workflow spins up a sandbox and starts the AI
- Poll or watch — check status or register a callback URL for completion notifications
- Get results — full output plus every tool call, token count, and execution logs
- Call
/executewith a prompt and optional config — agent is created and started automatically - Poll or watch — same as above
- Get results — same as above
- Create a session — a sandbox starts and stays alive for multi-turn conversation
- Send messages — each message goes to the same running agent with full context
- Stream events — optional real-time SSE stream of agent activity
- End the session — sandbox is snapshotted and terminated, billing summary returned
Create and execute are separate steps by design. This lets you register a
watcher callback before execution starts, or batch-create
multiple runs and execute them on a schedule.
Next steps
Create & Configure
Define agents with instructions, model selection, and vault restrictions.
Execute Runs
Create runs, execute them, and understand the lifecycle.
Interactive Chat
Multi-turn agent sessions with real-time streaming.
Monitor & Analyze
Poll status, get full audit trails, and register webhooks.
Sandbox Environment
What’s inside the sandbox — tools, CLI, and capabilities.
Related services
Vaults
Store documents that agents can search and analyze.
Legal Research
Agents use this to search case law, statutes, and patents.
LLMs
The AI models that power agent reasoning.
OCR
Agents can trigger OCR on scanned documents.

