---
title: "Deploy an agent"
description: "Define an agent from an image, a protocol and an idle timeout."
---

> Documentation Index
> Fetch the complete documentation index at: https://docs.jgcp.mistrivedev.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Deploy an agent

Deploy an agent from an OCI image that serves the [invocation contract](https://docs.jgcp.mistrivedev.com/agents/invocation/). Creating the agent creates its first revision and makes it active. No sandbox starts until the first session.

## What a revision holds

| Field | What it sets |
| --- | --- |
| `protocol` | `HTTP` or `MCP`. See [Invocation contract](https://docs.jgcp.mistrivedev.com/agents/invocation/). |
| `sandbox` | The sandbox each session gets: `source` (an image, template or snapshot), `resources`, `env`, `volumes`, `ports`, `lifecycle`, `network` and `integrations`. |
| `processes` | Named processes that start in each session's sandbox. |
| `sessionVolume` | A volume each session keeps across stops, and where it is mounted. |

Set the idle timeout with `sandbox.lifecycle.idleTimeout`. It decides how long a session stays up without requests.

## Change an agent

A revision never changes. To deploy a new image or new settings, create a revision with `agent.revisions.create` and make it active with `agent.update({ activeRevision })`. New sessions use it; running sessions finish on the revision they started with. To roll back, make the earlier revision active again. See [Revisions](https://docs.jgcp.mistrivedev.com/services/revisions/).

Delete the agent with `agent.delete()`. This stops and deletes every session's sandbox.

:::note[Today]
Today you deploy an app from a manifest with `anchor app deploy`. The SDKs cannot deploy an image yet, so the Today sample is CLI only. The command creates the app, starts one sandbox that runs your image, checks the health path and prints the app's URL. Use `anchor app list`, `stop`, `start` and `delete` to manage it.
:::

Source: https://docs.jgcp.mistrivedev.com/agents/deploy/index.mdx
