
# Manage Agents

Everything about an agent's existence - creating it, checking on it, reaching into it, tearing it down - runs through `dvx agent`. This guide covers the day-to-day operations. For the states an agent moves through, see [Agent Lifecycle](/agent-lifecycle/); for emergency containment and revocation, see [Agent lifecycle operations](/cli-lifecycle/).

## Create an agent

```bash
dvx broker list                                   # find an enclave to run it on
dvx agent create my-agent --broker-id <id>
```

Useful flags:

- `--template <name|id>` - start from an [agent template](/cli-reference/) (preset image and defaults).
- `--backend-type managed|external` - how the agent's compute is provided.

The agent starts in `created` and the enclave provisions it from there.

## List and inspect

```bash
dvx agent list                 # all your agents and their status
dvx agent get my-agent         # full detail for one agent
dvx status                     # fleet + enclave health at a glance
```

Add `--json` to any of these for scripting.

## Watch what an agent is doing

```bash
dvx agent logs my-agent
```

## Update an agent

```bash
dvx agent update my-agent ...
```

Common configuration (model, system prompt, channels) has its own guide - see [Configure your agent](/configure-agent/).

## Reach into a running agent

When you need to get onto the agent's host:

```bash
dvx agent ssh my-agent              # interactive shell
dvx agent connect my-agent          # connect to the agent
dvx agent port-forward my-agent ... # forward a local port
```

## Reprovision

If an agent's host is unhealthy or you've changed something that only takes effect at provision time, re-run provisioning:

```bash
dvx agent reprovision my-agent
```

## Decommission

Full teardown - revokes tokens, runs deprovisioning hooks, destroys the compute, and preserves the audit trail:

```bash
dvx agent delete my-agent
```

To pause or cut off an agent without deleting it, see [Agent lifecycle operations](/cli-lifecycle/).
