Agent Runtime
Give your project agents that are coding harnesses in their own machines: they keep working across chats, use your routes as their tools, and act with each person's access.
How it works
An agent on Agent Runtime is a coding harness, the kind of tool a developer runs in a terminal, running in its own virtual machine on Modal. It works there as it would on your own computer: it has a file system it reads and writes, a shell, and programs it can run, and its files are still there the next time it wakes. The harness today is Codex. It is a setting on each agent's definition, which is where other coding harnesses, such as Claude Code, plug in.
The runtime is everything around that harness. Your project says what each agent is for and which routes it may call; the runtime delivers messages, runs the agent, and brings its replies and files back to the chat. The agent keeps working after the browser tab closes, and it touches your data only as the person it works for could.
- Chats: People and agents talk in direct chats and groups, with files, replies, mentions, and live updates.
- Agents: Each agent is one long-lived worker with its own machine and disk. It keeps its memory and files between conversations and answers by sending messages.
- Tools: An agent's tools are your project's own routes, plus the runtime's tools for messages, chats, and routines. Every call runs with the access of the person the agent acts for. A route refuses the agent where it would refuse that person.
- One-shot calls: A typed answer from a model, with no chat and no sandbox, for work that needs one answer.
The Agents template ships the runtime already installed, with a chat interface and a general agent named Flint.
The runtime installs into the project's FastAPI backend and its Temporal worker. Postgres keeps agents, chats, members, messages, and read marks in the runtime's own agent_runtime schema, and the project's object storage keeps file bytes. One Temporal workflow per agent delivers what woke it and watches its turns. Each agent runs Codex in its own Modal sandbox with its own volume. A sidecar beside the sandbox holds every key, and the agent never sees one. Model calls go through the LLM Gateway, and tool calls go through Ciridae MCP to the project's routes as the person the agent acts for. Redis carries live updates to browsers and stores nothing durable. Every turn is traced to Braintrust when the project sets its Braintrust key and project.
Choose the shape of the work
Start with an agent only when the work needs one.
| The work | Use |
|---|---|
| Needs tools, files on disk, several steps, or a person to talk to | An agent |
| Needs one typed answer or one decision from a model | A one-shot call from your own code |
| Is a record that moves through stages with checks, approvals, and rules | A stage machine, which can hand a stage's work to an agent |
The runtime's guides cover one-shot calls, and a template project's stage-machine-backend skill covers stage machines.
Start with your coding agent
Coding agents start from the agent-best-practices skill, which a template project already has. It points the coding agent at the guides inside the runtime package your backend installs, for that exact version: definitions, tools and access, context, and how to check an agent before production.
Build your first agent has the prompt to give your coding agent and takes one task from idea to a checked result.
What your project decides
- What the agent is for: Its instructions and skills are files in your repository, changed by pull request.
- Which routes it may call: Every route, only the ones that read, or a named few.
- Whose access it uses: The person who started it, or the person your own code names when it starts one.
- How it is found again: A key your code gives it, such as one agent per record.
- What it reads: Reference text your project keeps current is synced into its workspace. Records that must be current and access-checked stay behind routes.