Fetch an guardrail
const url = 'https://example.com/v1/guardrails/example';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://example.com/v1/guardrails/example \ --header 'Authorization: Bearer <token>'Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”GuardrailId — unique identifier for the guardrail.
Responses
Section titled “Responses”Guardrail.
object
The guardrail’s project. Absent when the runtime doesn’t record it: a pack kindgi dev serves from disk, or a runtime before Kindgi 0.1.6.
How the guardrail is checked. Open string: the built-in kinds are listed in examples; adapters register strategies for their own kinds.
Reference to the concrete check implementation registered server-side.
object
object
What a failed check does to the agent turn. Open string: the built-in actions are listed in examples, and any other non-empty name is accepted. The runtime acts on halt: the turn fails with guardrail-violation and its response is not stored. It acts on retry too: the answer goes back to the model with the check’s reason, for a new one, until retry.maxAttempts run out, and then the turn fails the same way, with details.attempts. Any other value is recorded as a violation, as log-only is, and the turn completes: in 0.1 nothing escalates or calls a compensating tool.
Counts the answers this guardrail fails in a turn, the first one included (with maxAttempts: 3 it sends a failed answer back up to twice, and the third answer it fails ends the turn). Left out, 2. The turn’s maxSteps, and the agent loop’s 32 model calls, bound it too.
object
Where an escalate goes. In 0.1 nothing escalates.
The tool id a compensate names. In 0.1 that tool isn’t called.
object
At before-tool and after-tool: the tools whose calls it checks, by id. A trailing * matches every id with that prefix, and a * anywhere else is refused. Absent: every tool.
Where in the agent’s turn the check runs: before a tool call runs, after it runs, on each model reply, or on the final answer. It must be one of the check’s points.
What the check sees: this turn, or the conversation’s earlier turns too.
object
object
Example
{ "kind": "zero-llm", "action": { "on-violation": "halt" }, "severity": "info", "scope": { "when": "always" }, "at": "before-tool", "sees": "turn"}Missing / malformed / expired / revoked bearer token.
object
object
Stable machine-readable discriminant. Values match domain error codes (see docs/API-ROUTE-CONVENTIONS.md §4.3).
Optional, kind-specific.
object
Server-assigned request id; also echoed via X-Request-Id header.
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}No guardrail with that id under this tenant.
object
object
Stable machine-readable discriminant. Values match domain error codes (see docs/API-ROUTE-CONVENTIONS.md §4.3).
Optional, kind-specific.
object
Server-assigned request id; also echoed via X-Request-Id header.
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}The database was too busy to answer in time (database-busy); Retry-After (whole seconds) says when to try again.
object
object
Stable machine-readable discriminant. Values match domain error codes (see docs/API-ROUTE-CONVENTIONS.md §4.3).
Optional, kind-specific.
object
Server-assigned request id; also echoed via X-Request-Id header.
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}