> ## 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 TypeScript 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.managedAgents`. 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. They act in the workspace of a workspace API key. With an
organization API key, also send the `x-workspace-id` header. Every call takes request options as its
last argument, for example `{ headers: { 'x-workspace-id': '<workspace-id>' } }`.

```typescript theme={null}
import { Mutagent } from '@mutagent/sdk';

const client = new Mutagent({
  serverURL: 'https://api.mutagent.io',
  security: { apiKey: process.env.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.