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

# Managed agents

> Deploy and manage managed agents from the Python SDK, and where the full workflow is documented.

> [!NOTE]
>
> **Early access.** Cloud sessions and managed agent runs can change between releases.
> They run in a cloud sandbox operated by Mutagent, so
> there is nothing to host. A sandbox with nothing to do for 15 minutes stops; send an interactive
> session a message and it wakes up, delivers your message and carries on in the same conversation.
> A `-p` task run cannot be woken; run it again.

Managed agent calls are on `client.managed_agents`. They list, inspect, deploy, activate and retire
managed agents, and read the status of a deploy or activate operation. For what a managed agent is,
see [Managed agents](https://docs.mutagent.io/platform/managed-agents/overview.md).

## Create the client

Managed agent calls take your API key. `Mutagent()` reads `MUTAGENT_API_KEY` from the environment.
They act in the workspace of a workspace API key. With an organization API key, also send the
`x-workspace-id` header: set it as a header on an `httpx.Client` passed as `http_client`.

```python theme={null}
from mutagent import Mutagent

client = Mutagent(server_url="https://api.mutagent.io")  # reads MUTAGENT_API_KEY
```

## The workflow

The [`mutagent agent`](https://docs.mutagent.io/cli/commands/agent) CLI documents every step of the workflow: check and pack an
`agent.md` folder, deploy it as a revision, activate or roll back a revision, retire a slot, and run a
deployed agent with `mutagent agent run @<slug> "<task>"`.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.