client.guardrails
client.guardrails — the guardrails operations.
On AsyncKindgi every method is the same, awaited.
client.guardrails.list()
Section titled “client.guardrails.list()”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,) -> GuardrailCollectionPageList guardrails. GET /v1/guardrails
Cursor-paginated list of registered guardrails. Optional ?name= filters by prefix on guardrail id.
client.guardrails.register()
Section titled “client.guardrails.register()”register( body: RegisterGuardrailBody | Mapping[str, Any] | None = None, /, *, idempotency_key: str | None = None, timeout: float | None = None, **fields: Any,) -> RegisterGuardrailResultRegister 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()
Section titled “client.guardrails.get()”get(guardrail_id: str | UUID, /, *, timeout: float | None = None) -> GuardrailFetch an guardrail. GET /v1/guardrails/{guardrailId}
client.guardrails.outcomes()
Section titled “client.guardrails.outcomes()”outcomes( guardrail_id: str | UUID, /, *, project_id: str | UUID, from_: str, to: str, recent: int | None = None, timeout: float | None = None,) -> GuardrailOutcomesWhat 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()
Section titled “client.guardrails.unregister()”unregister( guardrail_id: str | UUID, /, *, idempotency_key: str | None = None, timeout: float | None = None,) -> UnregisterGuardrailResultUnregister an guardrail. POST /v1/guardrails/{guardrailId}/unregister