# client.guardrails

> client.guardrails — the guardrails operations.

`client.guardrails` — the `guardrails` operations.

On `AsyncKindgi` every method is the same, awaited.

## `client.guardrails.list()`

```python signature
list(
    *,
    limit: int | None = None,
    cursor: str | None = None,
    name: str | None = None,
    scope_kind: Literal['tenant', 'org', 'project'] | None = None,
    scope_id: str | UUID | None = None,
    inherit: bool | None = None,
    timeout: float | None = None,
) -> GuardrailCollectionPage
```

List guardrails. `GET /v1/guardrails`

Cursor-paginated list of registered guardrails. Optional `?name=` filters by prefix on guardrail id.

## `client.guardrails.register()`

```python signature
register(
    body: RegisterGuardrailBody | Mapping[str, Any] | None = None,
    /,
    *,
    idempotency_key: str | None = None,
    timeout: float | None = None,
    **fields: Any,
) -> RegisterGuardrailResult
```

Register an guardrail. `POST /v1/guardrails`

Body is a full `Guardrail` shape. Server validates via `@kindgi/guardrails.validateGuardrailSpec`. The `check` id must reference an implementation already available to the runtime; check code is not uploaded through this route.

## `client.guardrails.get()`

```python signature
get(guardrail_id: str | UUID, /, *, timeout: float | None = None) -> Guardrail
```

Fetch an guardrail. `GET /v1/guardrails/{guardrailId}`

## `client.guardrails.outcomes()`

```python signature
outcomes(
    guardrail_id: str | UUID,
    /,
    *,
    project_id: str | UUID,
    from_: str,
    to: str,
    recent: int | None = None,
    timeout: float | None = None,
) -> GuardrailOutcomes
```

What a guardrail's checks came to in a project. `GET /v1/guardrails/{guardrailId}/outcomes`

Counts from the server, over a window: how many of the guardrail's checks on agent turns in the project `passed`, were `violated` (the answer went through: `log-only`, `noop`, or an action handed back), `blocked` (a `halt` failed the turn) or `errored` (the check couldn't run; a `halt` guardrail's error fails the turn too, and is counted here). The same counts per agent version, and the window's latest blocked turns, by run id and time only: a blocked answer stays behind its run's page. A guardrail whose scope didn't match a turn wasn't checked on it. Replays and dry runs aren't counted. Outcomes go with their run's retention, so a window can hold fewer than asked; `recordedSince` says how far back they go. A guardrail no longer registered still has its outcomes. Needs `read` on the guardrail and on the project.

## `client.guardrails.unregister()`

```python signature
unregister(
    guardrail_id: str | UUID,
    /,
    *,
    idempotency_key: str | None = None,
    timeout: float | None = None,
) -> UnregisterGuardrailResult
```

Unregister an guardrail. `POST /v1/guardrails/{guardrailId}/unregister`
