---
title: AgentSpec
description: "One agent to install: its name, and the two defaults a caller may override."
---

```python
@final
class AgentSpec
```

One agent to install: its name, and the two defaults a caller may override.

`agent` is `"claude-code"` or `"codex"`; anything else is refused by the core with the
list. `model` defaults to the profile's row (an inference-profile id), `cli_version` to
the registry's latest at build time; a pin changes the image name.

## Constructor

```python
AgentSpec(agent: str, *, model: str | None = None, cli_version: str | None = None)
```

## Properties

### `agent`

```python
agent: str
```

`"claude-code"` or `"codex"`.

### `cli_version`

```python
cli_version: str | None
```

The pinned CLI version, or `None` for the registry's latest at build time.

### `headless_command`

```python
headless_command: str
```

The exact command `prompt` runs, with `<TASK>` where the quoted task goes.

### `model`

```python
model: str
```

The model this spec resolves to: the override, or the profile's default.

## Methods

### `claude_code`

```python
@staticmethod
def claude_code(
    *,
    model: str | None = None,
    cli_version: str | None = None,
) -> AgentSpec
```

Claude Code with the profile's defaults, or with overrides.

### `codex`

```python
@staticmethod
def codex(*, model: str | None = None, cli_version: str | None = None) -> AgentSpec
```

Codex with the profile's defaults, or with overrides.

## Special methods

### `__eq__`

```python
def __eq__(other: object, /) -> bool
```

### `__repr__`

```python
def __repr__() -> str
```

## Provenance

This page is generated from `bindings/microvms-py/microvms.pyi` by Griffe 2.3.0, run from `site/scripts/gen-reference.mjs` on every `pnpm run sync`, so an edit made here is overwritten by the next run.

To change the page, change the doc comment in the binding's Rust source, then regenerate the declarations with `mise run stubs`. `mise run stubs:check` fails when the committed file no longer matches the source.