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

# Output validators

> JSON Schema validators for agent node outputs

Output format validators constrain structured outputs (for example validating a JSON shape after a node runs). Manage them with **`client.agent_validation`**.

## Upsert from Pydantic models

Pass Pydantic **classes** (not instances). The client uses each class **`__name__`** as the validator name and **`model_json_schema()`** as the JSON Schema.

```python theme={"theme":{"light":"github-light","dark":"github-dark"}}
from pydantic import BaseModel, Field

class Invoice(BaseModel):
    vendor: str = Field(...)
    total: float = Field(...)

result = await client.agent_validation.upsert_validators([Invoice])
```

## Raw JSON Schema dicts

```python theme={"theme":{"light":"github-light","dark":"github-dark"}}
await client.agent_validation.upsert_validators([
    {"name": "Invoice", "json_schema": {"type": "object", "properties": {}}},
])
```

## List and fetch

```python theme={"theme":{"light":"github-light","dark":"github-dark"}}
validators = await client.agent_validation.list_validators(limit=20)
v = await client.agent_validation.get_validator(validators.validators[0].id)
```

Attach validators to nodes in your agent graph configuration in the product UI or API so failed validation can trigger retries where your platform supports it.
