> For the complete documentation index, see [llms.txt](https://docs.otari.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.otari.ai/otari/for-integrators/api-reference/organization-guardrail-definitions.md).

# Organization guardrail definitions

## List Organization Guardrail Definitions

> List the guardrails the caller's organization has defined.\
> \
> Organization owners and admins only. A stored vendor credential is never\
> returned: each one comes back as \`\`\*\*\*\`\` under its own name, which is what a\
> form resubmits to keep it.\
> \
> \`\`build\_state\`\` answers for the worker that served this request, so a read\
> taken moments after a write may still report \`\`pending\`\` on a sibling that\
> has not caught up.

```json
{"openapi":"3.1.0","info":{"title":"otari","version":"0.33.0"},"security":[{"ApiKeyAuth":[]},{"XApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"description":"Enter your API key here (sent as Otari-Key header).","in":"header","name":"Otari-Key","type":"apiKey"},"XApiKeyAuth":{"description":"Anthropic-native clients send credentials here (no Bearer prefix).","in":"header","name":"x-api-key","type":"apiKey"}},"schemas":{"OrganizationGuardrailDefinitionsPublic":{"properties":{"count":{"title":"Count","type":"integer"},"data":{"items":{"$ref":"#/components/schemas/OrganizationGuardrailDefinitionPublic"},"title":"Data","type":"array"}},"required":["data","count"],"title":"OrganizationGuardrailDefinitionsPublic","type":"object"},"OrganizationGuardrailDefinitionPublic":{"description":"The API-facing shape. Carries the names of the stored secrets and none of their values.","properties":{"build_state":{"description":"Whether the worker that answered this request holds a guardrail built from this version of the definition. built means it does and the check runs; failed means that worker tried these exact arguments and could not build them, so every mandate pointing here is unevaluable; pending means it holds nothing for this version yet, which is the answer right after a write and on any worker that has not caught up within the refresh interval; disabled means the definition is switched off and nothing is built on purpose. It answers for one worker, so two reads can disagree while a write propagates. Why a build failed is never reported here: the reason is in the gateway's log","enum":["built","failed","pending","disabled"],"title":"Build State","type":"string"},"create_kwargs":{"additionalProperties":true,"description":"The constructor arguments the catalog does not mark secret, as they were stored. Returned in clear: the secrets were taken out of this map by flag, and a form has to round-trip an endpoint or a project id","title":"Create Kwargs","type":"object"},"create_secrets":{"additionalProperties":{"type":"string"},"description":"The secret constructor arguments this definition holds, each as ***. Sending one back unchanged keeps the stored value; sending a new one rotates it, and leaving one out clears it","title":"Create Secrets","type":"object"},"created_at":{"title":"Created At","type":"string"},"enabled":{"title":"Enabled","type":"boolean"},"guardrail_name":{"title":"Guardrail Name","type":"string"},"id":{"format":"uuid","title":"Id","type":"string"},"name":{"title":"Name","type":"string"},"organization_id":{"format":"uuid","title":"Organization Id","type":"string"},"secrets_decryptable":{"description":"False when the stored secrets cannot be read with the current OTARI_SECRET_KEY, in which case create_secrets is empty and the definition needs its credentials sent again","title":"Secrets Decryptable","type":"boolean"},"updated_at":{"title":"Updated At","type":"string"}},"required":["id","organization_id","name","guardrail_name","create_kwargs","create_secrets","secrets_decryptable","enabled","build_state","created_at","updated_at"],"title":"OrganizationGuardrailDefinitionPublic","type":"object"},"HTTPValidationError":{"properties":{"code":{"const":"invalid_request","description":"Stable error code, also sent as the Otari-Error-Code header.","title":"Code","type":"string"},"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"title":"Detail","type":"array"}},"title":"HTTPValidationError","type":"object"},"ValidationError":{"properties":{"ctx":{"title":"Context","type":"object"},"input":{"title":"Input"},"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"title":"Location","type":"array"},"msg":{"title":"Message","type":"string"},"type":{"title":"Error Type","type":"string"}},"required":["loc","msg","type"],"title":"ValidationError","type":"object"}}},"paths":{"/api/v1/organizations/me/guardrail-definitions":{"get":{"description":"List the guardrails the caller's organization has defined.\n\nOrganization owners and admins only. A stored vendor credential is never\nreturned: each one comes back as ``***`` under its own name, which is what a\nform resubmits to keep it.\n\n``build_state`` answers for the worker that served this request, so a read\ntaken moments after a write may still report ``pending`` on a sibling that\nhas not caught up.","operationId":"organization-guardrail-definitions-list_organization_guardrail_definitions","parameters":[{"description":"Number of records to skip","in":"query","name":"skip","required":false,"schema":{"default":0,"description":"Number of records to skip","minimum":0,"title":"Skip","type":"integer"}},{"description":"Maximum number of records to return","in":"query","name":"limit","required":false,"schema":{"default":100,"description":"Maximum number of records to return","maximum":1000,"minimum":1,"title":"Limit","type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrganizationGuardrailDefinitionsPublic"}}},"description":"Successful Response"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}},"description":"Validation Error"}},"summary":"List Organization Guardrail Definitions","tags":["organization-guardrail-definitions"]}}}}
```

## Create Organization Guardrail Definition

> Define a guardrail this deployment will build and call itself. Organization owners and admins only.\
> \
> \`\`guardrail\_name\`\` must be one the built-in guardrail catalog lists\
> (\`\`GET /api/v1/tool-settings/guardrails/catalog\`\`), and\
> \`\`create\_kwargs\`\` must satisfy that guardrail's constructor as the catalog\
> describes it: no argument it does not declare, nothing it types as a live\
> object rather than configuration, and every required argument no environment\
> variable can supply. Arguments the catalog marks secret are encrypted at\
> rest.\
> \
> A definition on its own changes no request. Mandate it through\
> \`\`/api/v1/organizations/me/guardrails\`\` for it to run.\
> \
> The definition is saved first and built second, so a guardrail this\
> deployment cannot construct is still stored and answers \`\`build\_state:\
> "failed"\`\` rather than refusing the write. Why it failed is not reported: a\
> vendor library may put the arguments it was handed, which are your\
> credentials, into its own error message. The reason is in the gateway's log.

```json
{"openapi":"3.1.0","info":{"title":"otari","version":"0.33.0"},"security":[{"ApiKeyAuth":[]},{"XApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"description":"Enter your API key here (sent as Otari-Key header).","in":"header","name":"Otari-Key","type":"apiKey"},"XApiKeyAuth":{"description":"Anthropic-native clients send credentials here (no Bearer prefix).","in":"header","name":"x-api-key","type":"apiKey"}},"schemas":{"OrganizationGuardrailDefinitionCreate":{"description":"Request body for defining a guardrail Otari will build and call itself.\n\n``create_kwargs`` carries both halves of the form: the plain arguments and\nthe vendor credentials. Which is which is the catalog's answer, not this\nschema's, so a credential lands in the encrypted map whatever it is called\nand a caller cannot move one into the plain column by naming it oddly.\n\nPer-call arguments are not offered. This row says what a guardrail is built\nwith; what travels with each check is the mandate's ``validate_kwargs``.","properties":{"create_kwargs":{"additionalProperties":true,"description":"Constructor arguments for the guardrail. Every argument the catalog marks secret is encrypted at rest and never returned; the rest are stored and returned as sent","title":"Create Kwargs","type":"object"},"enabled":{"default":true,"description":"False stops the guardrail everywhere it is mandated","title":"Enabled","type":"boolean"},"guardrail_name":{"description":"The any-guardrail class to build, as the built-in guardrail catalog names it","maxLength":128,"minLength":1,"title":"Guardrail Name","type":"string"},"name":{"description":"The organization's own label for this definition, unique within the organization","maxLength":128,"minLength":1,"title":"Name","type":"string"}},"required":["name","guardrail_name"],"title":"OrganizationGuardrailDefinitionCreate","type":"object"},"OrganizationGuardrailDefinitionPublic":{"description":"The API-facing shape. Carries the names of the stored secrets and none of their values.","properties":{"build_state":{"description":"Whether the worker that answered this request holds a guardrail built from this version of the definition. built means it does and the check runs; failed means that worker tried these exact arguments and could not build them, so every mandate pointing here is unevaluable; pending means it holds nothing for this version yet, which is the answer right after a write and on any worker that has not caught up within the refresh interval; disabled means the definition is switched off and nothing is built on purpose. It answers for one worker, so two reads can disagree while a write propagates. Why a build failed is never reported here: the reason is in the gateway's log","enum":["built","failed","pending","disabled"],"title":"Build State","type":"string"},"create_kwargs":{"additionalProperties":true,"description":"The constructor arguments the catalog does not mark secret, as they were stored. Returned in clear: the secrets were taken out of this map by flag, and a form has to round-trip an endpoint or a project id","title":"Create Kwargs","type":"object"},"create_secrets":{"additionalProperties":{"type":"string"},"description":"The secret constructor arguments this definition holds, each as ***. Sending one back unchanged keeps the stored value; sending a new one rotates it, and leaving one out clears it","title":"Create Secrets","type":"object"},"created_at":{"title":"Created At","type":"string"},"enabled":{"title":"Enabled","type":"boolean"},"guardrail_name":{"title":"Guardrail Name","type":"string"},"id":{"format":"uuid","title":"Id","type":"string"},"name":{"title":"Name","type":"string"},"organization_id":{"format":"uuid","title":"Organization Id","type":"string"},"secrets_decryptable":{"description":"False when the stored secrets cannot be read with the current OTARI_SECRET_KEY, in which case create_secrets is empty and the definition needs its credentials sent again","title":"Secrets Decryptable","type":"boolean"},"updated_at":{"title":"Updated At","type":"string"}},"required":["id","organization_id","name","guardrail_name","create_kwargs","create_secrets","secrets_decryptable","enabled","build_state","created_at","updated_at"],"title":"OrganizationGuardrailDefinitionPublic","type":"object"},"HTTPValidationError":{"properties":{"code":{"const":"invalid_request","description":"Stable error code, also sent as the Otari-Error-Code header.","title":"Code","type":"string"},"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"title":"Detail","type":"array"}},"title":"HTTPValidationError","type":"object"},"ValidationError":{"properties":{"ctx":{"title":"Context","type":"object"},"input":{"title":"Input"},"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"title":"Location","type":"array"},"msg":{"title":"Message","type":"string"},"type":{"title":"Error Type","type":"string"}},"required":["loc","msg","type"],"title":"ValidationError","type":"object"}}},"paths":{"/api/v1/organizations/me/guardrail-definitions":{"post":{"description":"Define a guardrail this deployment will build and call itself. Organization owners and admins only.\n\n``guardrail_name`` must be one the built-in guardrail catalog lists\n(``GET /api/v1/tool-settings/guardrails/catalog``), and\n``create_kwargs`` must satisfy that guardrail's constructor as the catalog\ndescribes it: no argument it does not declare, nothing it types as a live\nobject rather than configuration, and every required argument no environment\nvariable can supply. Arguments the catalog marks secret are encrypted at\nrest.\n\nA definition on its own changes no request. Mandate it through\n``/api/v1/organizations/me/guardrails`` for it to run.\n\nThe definition is saved first and built second, so a guardrail this\ndeployment cannot construct is still stored and answers ``build_state:\n\"failed\"`` rather than refusing the write. Why it failed is not reported: a\nvendor library may put the arguments it was handed, which are your\ncredentials, into its own error message. The reason is in the gateway's log.","operationId":"organization-guardrail-definitions-create_organization_guardrail_definition","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrganizationGuardrailDefinitionCreate"}}},"required":true},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrganizationGuardrailDefinitionPublic"}}},"description":"Successful Response"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}},"description":"Validation Error"}},"summary":"Create Organization Guardrail Definition","tags":["organization-guardrail-definitions"]}}}}
```

## Update Organization Guardrail Definition

> Change a definition's name, guardrail, build arguments, or enabled flag.\
> \
> Organization owners and admins only. Omitted fields are left as they are.\
> \`\`create\_kwargs\`\` replaces the arguments whole when sent, an argument sent as\
> \`\`\*\*\*\`\` keeps the value stored under that name, and omitting the field\
> entirely leaves the stored credentials untouched and unread.\
> \
> The guardrail is rebuilt afterwards and the response reports the outcome in\
> \`\`build\_state\`\`, so repairing a credential shows the definition running\
> again in the same response, and \`\`enabled: false\`\` stops it here rather than\
> on the next refresh.

```json
{"openapi":"3.1.0","info":{"title":"otari","version":"0.33.0"},"security":[{"ApiKeyAuth":[]},{"XApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"description":"Enter your API key here (sent as Otari-Key header).","in":"header","name":"Otari-Key","type":"apiKey"},"XApiKeyAuth":{"description":"Anthropic-native clients send credentials here (no Bearer prefix).","in":"header","name":"x-api-key","type":"apiKey"}},"schemas":{"OrganizationGuardrailDefinitionUpdate":{"description":"Partial update. Only the fields the caller sets are applied.\n\n``create_kwargs`` replaces the arguments whole when sent, and an argument the\ncatalog marks secret keeps its stored value where the caller echoes back the\n``***`` a read gave them. Omitting it leaves both columns untouched *and\nreads neither*, which is what lets an admin on a deployment whose\n``OTARI_SECRET_KEY`` has moved still flip ``enabled`` and repair the row by\ntyping the credential again.\n\nChanging ``guardrail_name`` without sending ``create_kwargs`` re-splits the\nstored arguments under the new class, because the plain/secret split is the\nold class's answer and would otherwise go stale.","properties":{"create_kwargs":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"description":"Replaces the constructor arguments whole. An argument sent as *** keeps the value stored under that name; a secret left out is cleared. Omit the field to leave the stored arguments alone, and {} to clear them","title":"Create Kwargs"},"enabled":{"title":"Enabled","type":"boolean"},"guardrail_name":{"maxLength":128,"minLength":1,"title":"Guardrail Name","type":"string"},"name":{"maxLength":128,"minLength":1,"title":"Name","type":"string"}},"title":"OrganizationGuardrailDefinitionUpdate","type":"object"},"OrganizationGuardrailDefinitionPublic":{"description":"The API-facing shape. Carries the names of the stored secrets and none of their values.","properties":{"build_state":{"description":"Whether the worker that answered this request holds a guardrail built from this version of the definition. built means it does and the check runs; failed means that worker tried these exact arguments and could not build them, so every mandate pointing here is unevaluable; pending means it holds nothing for this version yet, which is the answer right after a write and on any worker that has not caught up within the refresh interval; disabled means the definition is switched off and nothing is built on purpose. It answers for one worker, so two reads can disagree while a write propagates. Why a build failed is never reported here: the reason is in the gateway's log","enum":["built","failed","pending","disabled"],"title":"Build State","type":"string"},"create_kwargs":{"additionalProperties":true,"description":"The constructor arguments the catalog does not mark secret, as they were stored. Returned in clear: the secrets were taken out of this map by flag, and a form has to round-trip an endpoint or a project id","title":"Create Kwargs","type":"object"},"create_secrets":{"additionalProperties":{"type":"string"},"description":"The secret constructor arguments this definition holds, each as ***. Sending one back unchanged keeps the stored value; sending a new one rotates it, and leaving one out clears it","title":"Create Secrets","type":"object"},"created_at":{"title":"Created At","type":"string"},"enabled":{"title":"Enabled","type":"boolean"},"guardrail_name":{"title":"Guardrail Name","type":"string"},"id":{"format":"uuid","title":"Id","type":"string"},"name":{"title":"Name","type":"string"},"organization_id":{"format":"uuid","title":"Organization Id","type":"string"},"secrets_decryptable":{"description":"False when the stored secrets cannot be read with the current OTARI_SECRET_KEY, in which case create_secrets is empty and the definition needs its credentials sent again","title":"Secrets Decryptable","type":"boolean"},"updated_at":{"title":"Updated At","type":"string"}},"required":["id","organization_id","name","guardrail_name","create_kwargs","create_secrets","secrets_decryptable","enabled","build_state","created_at","updated_at"],"title":"OrganizationGuardrailDefinitionPublic","type":"object"},"HTTPValidationError":{"properties":{"code":{"const":"invalid_request","description":"Stable error code, also sent as the Otari-Error-Code header.","title":"Code","type":"string"},"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"title":"Detail","type":"array"}},"title":"HTTPValidationError","type":"object"},"ValidationError":{"properties":{"ctx":{"title":"Context","type":"object"},"input":{"title":"Input"},"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"title":"Location","type":"array"},"msg":{"title":"Message","type":"string"},"type":{"title":"Error Type","type":"string"}},"required":["loc","msg","type"],"title":"ValidationError","type":"object"}}},"paths":{"/api/v1/organizations/me/guardrail-definitions/{definition_id}":{"patch":{"description":"Change a definition's name, guardrail, build arguments, or enabled flag.\n\nOrganization owners and admins only. Omitted fields are left as they are.\n``create_kwargs`` replaces the arguments whole when sent, an argument sent as\n``***`` keeps the value stored under that name, and omitting the field\nentirely leaves the stored credentials untouched and unread.\n\nThe guardrail is rebuilt afterwards and the response reports the outcome in\n``build_state``, so repairing a credential shows the definition running\nagain in the same response, and ``enabled: false`` stops it here rather than\non the next refresh.","operationId":"organization-guardrail-definitions-update_organization_guardrail_definition","parameters":[{"in":"path","name":"definition_id","required":true,"schema":{"format":"uuid","title":"Definition Id","type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrganizationGuardrailDefinitionUpdate"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrganizationGuardrailDefinitionPublic"}}},"description":"Successful Response"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}},"description":"Validation Error"}},"summary":"Update Organization Guardrail Definition","tags":["organization-guardrail-definitions"]}}}}
```

## Delete Organization Guardrail Definition

> Drop a definition and the credentials it holds.\
> \
> Organization owners and admins only. Use \`\`enabled: false\`\` instead to stop\
> the guardrail everywhere while keeping both.

```json
{"openapi":"3.1.0","info":{"title":"otari","version":"0.33.0"},"security":[{"ApiKeyAuth":[]},{"XApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"description":"Enter your API key here (sent as Otari-Key header).","in":"header","name":"Otari-Key","type":"apiKey"},"XApiKeyAuth":{"description":"Anthropic-native clients send credentials here (no Bearer prefix).","in":"header","name":"x-api-key","type":"apiKey"}},"schemas":{"Message":{"description":"A human-readable acknowledgment for an operation with nothing to return.","properties":{"message":{"description":"What happened.","title":"Message","type":"string"}},"required":["message"],"title":"Message","type":"object"},"HTTPValidationError":{"properties":{"code":{"const":"invalid_request","description":"Stable error code, also sent as the Otari-Error-Code header.","title":"Code","type":"string"},"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"title":"Detail","type":"array"}},"title":"HTTPValidationError","type":"object"},"ValidationError":{"properties":{"ctx":{"title":"Context","type":"object"},"input":{"title":"Input"},"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"title":"Location","type":"array"},"msg":{"title":"Message","type":"string"},"type":{"title":"Error Type","type":"string"}},"required":["loc","msg","type"],"title":"ValidationError","type":"object"}}},"paths":{"/api/v1/organizations/me/guardrail-definitions/{definition_id}":{"delete":{"description":"Drop a definition and the credentials it holds.\n\nOrganization owners and admins only. Use ``enabled: false`` instead to stop\nthe guardrail everywhere while keeping both.","operationId":"organization-guardrail-definitions-delete_organization_guardrail_definition","parameters":[{"in":"path","name":"definition_id","required":true,"schema":{"format":"uuid","title":"Definition Id","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Message"}}},"description":"Successful Response"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}},"description":"Validation Error"}},"summary":"Delete Organization Guardrail Definition","tags":["organization-guardrail-definitions"]}}}}
```

## Test Organization Guardrail Definition

> Run a definition's guardrail over some text and return its verdict.\
> \
> Organization owners and admins only. The guardrail is the one the worker\
> that answered already holds built, so this tests what is running rather\
> than building it again. Nothing is stored and no mandate is involved;\
> \`\`validate\_kwargs\`\` stands in for what a mandate would pass with each\
> check.\
> \
> A definition this worker does not hold built answers 409, and its\
> \`\`build\_state\`\` says why. A vendor call that fails answers 502, and the\
> reason is in the gateway's log only: a vendor library may put the\
> credentials it was handed into its own message.

```json
{"openapi":"3.1.0","info":{"title":"otari","version":"0.33.0"},"security":[{"ApiKeyAuth":[]},{"XApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"description":"Enter your API key here (sent as Otari-Key header).","in":"header","name":"Otari-Key","type":"apiKey"},"XApiKeyAuth":{"description":"Anthropic-native clients send credentials here (no Bearer prefix).","in":"header","name":"x-api-key","type":"apiKey"}},"schemas":{"OrganizationGuardrailDefinitionTest":{"additionalProperties":false,"description":"Text to run one definition's guardrail over, as a request would.","properties":{"text":{"description":"The input to check, as a request's user text would reach it","maxLength":10000,"minLength":1,"title":"Text","type":"string"},"validate_kwargs":{"additionalProperties":true,"description":"Per-check arguments, as a mandate's validate_kwargs would hand them to this guardrail","title":"Validate Kwargs","type":"object"}},"required":["text"],"title":"OrganizationGuardrailDefinitionTest","type":"object"},"OrganizationGuardrailDefinitionTestResult":{"description":"The guardrail's own verdict on the text, in the fields a request's check reports.","properties":{"explanation":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The vendor's reason, when it gives one","title":"Explanation"},"score":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"The vendor's score, when it gives one","title":"Score"},"valid":{"description":"False when the guardrail flagged the text","title":"Valid","type":"boolean"}},"required":["valid","explanation","score"],"title":"OrganizationGuardrailDefinitionTestResult","type":"object"},"HTTPValidationError":{"properties":{"code":{"const":"invalid_request","description":"Stable error code, also sent as the Otari-Error-Code header.","title":"Code","type":"string"},"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"title":"Detail","type":"array"}},"title":"HTTPValidationError","type":"object"},"ValidationError":{"properties":{"ctx":{"title":"Context","type":"object"},"input":{"title":"Input"},"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"title":"Location","type":"array"},"msg":{"title":"Message","type":"string"},"type":{"title":"Error Type","type":"string"}},"required":["loc","msg","type"],"title":"ValidationError","type":"object"}}},"paths":{"/api/v1/organizations/me/guardrail-definitions/{definition_id}/test":{"post":{"description":"Run a definition's guardrail over some text and return its verdict.\n\nOrganization owners and admins only. The guardrail is the one the worker\nthat answered already holds built, so this tests what is running rather\nthan building it again. Nothing is stored and no mandate is involved;\n``validate_kwargs`` stands in for what a mandate would pass with each\ncheck.\n\nA definition this worker does not hold built answers 409, and its\n``build_state`` says why. A vendor call that fails answers 502, and the\nreason is in the gateway's log only: a vendor library may put the\ncredentials it was handed into its own message.","operationId":"organization-guardrail-definitions-test_organization_guardrail_definition","parameters":[{"in":"path","name":"definition_id","required":true,"schema":{"format":"uuid","title":"Definition Id","type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrganizationGuardrailDefinitionTest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrganizationGuardrailDefinitionTestResult"}}},"description":"Successful Response"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}},"description":"Validation Error"}},"summary":"Test Organization Guardrail Definition","tags":["organization-guardrail-definitions"]}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.otari.ai/otari/for-integrators/api-reference/organization-guardrail-definitions.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
