For the complete documentation index, see llms.txt. This page is also available as Markdown.

Organization guardrails

List Organization Guardrails

get

List the guardrails the caller's organization mandates.

Organization owners and admins only, unlike the pricing overrides next door that any member may read: these rows name the endpoints this gateway connects to and say which of them carry a credential. A credential is never returned, only whether one is set.

Authorizations
Otari-KeystringRequired

Enter your API key here (sent as Otari-Key header).

Query parameters
skipintegerOptional

Number of records to skip

Default: 0
limitinteger · min: 1 · max: 1000Optional

Maximum number of records to return

Default: 100
Responses
200

Successful Response

application/json
countintegerRequired
get/api/v1/organizations/me/guardrails
GET /api/v1/organizations/me/guardrails HTTP/1.1
Otari-Key: YOUR_API_KEY
Accept: */*
{
  "count": 1,
  "data": [
    {
      "applies_to_all_workspaces": true,
      "created_at": "text",
      "definition_id": "123e4567-e89b-12d3-a456-426614174000",
      "enabled": true,
      "has_credential": true,
      "id": "123e4567-e89b-12d3-a456-426614174000",
      "mode": "text",
      "on_unavailable": "text",
      "organization_id": "123e4567-e89b-12d3-a456-426614174000",
      "profile": "text",
      "updated_at": "text",
      "url": "text",
      "validate_kwargs": {
        "ANY_ADDITIONAL_PROPERTY": "anything"
      },
      "workspace_ids": [
        "123e4567-e89b-12d3-a456-426614174000"
      ]
    }
  ]
}

Create Organization Guardrail

post

Mandate a guardrail across the organization. Organization owners and admins only.

The guardrail runs on every request from the workspaces it is scoped to, in addition to whatever the caller asked for, with the stricter of the two settings applying to a profile both name. Set applies_to_all_workspaces for it to cover workspaces created later; otherwise a new workspace inherits nothing and the entry runs only in the workspaces workspace_ids lists.

Authorizations
Otari-KeystringRequired

Enter your API key here (sent as Otari-Key header).

Body

Request body for mandating a guardrail across an organization.

credential is never stored as sent: it is encrypted with OTARI_SECRET_KEY and only the ciphertext is kept, the same convention tools.WorkspaceMcpServer and providers.ProviderCredential use. It is sent to the endpoint as Authorization: Bearer when the guardrail runs, so it authenticates this gateway to the guardrails service the entry names. A guardrail vendor's own key is not this: the guardrails service builds its guardrails from the operator's YAML and holds those itself.

A credential therefore requires url. The deployment's guardrails_url is not necessarily encrypted (the shipped compose file makes it a same-host http:// sidecar) and this row cannot see what it is set to, so an entry that fell back to it could not promise the bearer was sent over https. See _require_url_for_credential.

on is not offered. This plane mandates input-direction checks, which is the only direction the request path enforces (services.guardrails.run_input_guardrails); an organization that could store an output-direction mandate would be storing one nothing runs.

applies_to_all_workspacesbooleanOptional

True runs this in every workspace of the organization, including one created later; false runs it only in the workspaces named by workspace_ids

Default: false
credentialstring · max: 8192 · nullableOptional

Bearer credential for this entry's endpoint. Requires url to be set, and https: an entry with no endpoint of its own falls back to the deployment's guardrails_url, which is commonly a same-host http sidecar. Encrypted at rest, never returned

definition_idstring · uuid · nullableOptional

A guardrail definition of this organization for Otari to build and run itself, instead of calling a profile on a guardrails service. Mutually exclusive with url and credential, which name a service

enabledbooleanOptional

False stops the guardrail everywhere without discarding it

Default: true
modestring · enumOptional

block rejects a flagged request with 403; monitor annotates the response and forwards it

Default: monitorPossible values:
on_unavailablestring · enumOptional

What a block-mode entry does when the guardrails service cannot be reached or gives no verdict

Default: blockPossible values:
profilestring · min: 1 · max: 128Required

Profile name configured on the guardrails service, unique within the organization

urlstring · max: 2048 · nullableOptional

Guardrails endpoint for this entry; null uses the deployment's guardrails_url

workspace_idsstring · uuid[] · max: 500Optional

Workspaces this guardrail runs in. Must be empty when applies_to_all_workspaces is true

Responses
201

Successful Response

application/json

The API-facing shape. Never carries the credential, nor a credential-shaped parameter.

validate_kwargs is the second place a credential lives on this row, and the one with no column of its own: a guardrail class can take a vendor key as a parameter, so the form offers a box for it and whatever is typed there is stored as plain JSON. It is masked the way org_provider_keys.client_args is, by the name of the entry rather than by what the guardrail catalog says about it, so the mask still applies when the guardrails service is down and no catalog can be read.

applies_to_all_workspacesbooleanRequired
created_atstringRequired
definition_idstring · uuid · nullableRequired
enabledbooleanRequired
has_credentialbooleanRequired
idstring · uuidRequired
modestringRequired
on_unavailablestringRequired
organization_idstring · uuidRequired
profilestringRequired
updated_atstringRequired
urlstring · nullableRequired
workspace_idsstring · uuid[]Required
post/api/v1/organizations/me/guardrails
POST /api/v1/organizations/me/guardrails HTTP/1.1
Otari-Key: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 164

{
  "applies_to_all_workspaces": true,
  "credential": "sk-guardrails-...",
  "mode": "block",
  "profile": "prompt-injection",
  "url": "https://guardrails.internal.example/validate"
}
{
  "applies_to_all_workspaces": true,
  "created_at": "text",
  "definition_id": "123e4567-e89b-12d3-a456-426614174000",
  "enabled": true,
  "has_credential": true,
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "mode": "text",
  "on_unavailable": "text",
  "organization_id": "123e4567-e89b-12d3-a456-426614174000",
  "profile": "text",
  "updated_at": "text",
  "url": "text",
  "validate_kwargs": {
    "ANY_ADDITIONAL_PROPERTY": "anything"
  },
  "workspace_ids": [
    "123e4567-e89b-12d3-a456-426614174000"
  ]
}

Update Organization Guardrail

patch

Change a guardrail's profile, endpoint, credential, modes, or scope.

Organization owners and admins only. Omitted fields are left as they are; workspace_ids replaces the scope whole when sent, and url and credential are cleared by sending an empty string rather than null.

Authorizations
Otari-KeystringRequired

Enter your API key here (sent as Otari-Key header).

Path parameters
guardrail_idstring · uuidRequired
Body

Partial update. Only the fields the caller sets are applied.

credential and url have three states rather than two, which is what a write-only field and its nullable partner need: omit to leave the stored value alone, send "" to clear it, send a value to replace it. An explicit null also leaves them alone, matching WorkspaceMcpServerUpdate: a client that serializes its whole form back, with an empty credential box it never filled in, must not destroy a credential it was never shown.

workspace_ids replaces the scope whole when sent; [] clears it.

definition_id diverges: an explicit null clears it. The rule above protects a field the client was never shown, and this one is returned on every read, so a form sending null is sending back a field it was given rather than an empty box it never filled in. Omitting it still leaves the link alone.

applies_to_all_workspacesbooleanOptional
credentialstring · max: 8192 · nullableOptional
definition_idstring · uuid · nullableOptional

The organization's own definition this mandate runs. Unlike url and credential, an explicit null clears the link; omit the field to leave it as it is

enabledbooleanOptional
modestring · enumOptionalPossible values:
on_unavailablestring · enumOptionalPossible values:
profilestring · min: 1 · max: 128Optional
urlstring · max: 2048 · nullableOptional
workspace_idsstring · uuid[] · max: 500 · nullableOptional
Responses
200

Successful Response

application/json

The API-facing shape. Never carries the credential, nor a credential-shaped parameter.

validate_kwargs is the second place a credential lives on this row, and the one with no column of its own: a guardrail class can take a vendor key as a parameter, so the form offers a box for it and whatever is typed there is stored as plain JSON. It is masked the way org_provider_keys.client_args is, by the name of the entry rather than by what the guardrail catalog says about it, so the mask still applies when the guardrails service is down and no catalog can be read.

applies_to_all_workspacesbooleanRequired
created_atstringRequired
definition_idstring · uuid · nullableRequired
enabledbooleanRequired
has_credentialbooleanRequired
idstring · uuidRequired
modestringRequired
on_unavailablestringRequired
organization_idstring · uuidRequired
profilestringRequired
updated_atstringRequired
urlstring · nullableRequired
workspace_idsstring · uuid[]Required
patch/api/v1/organizations/me/guardrails/{guardrail_id}
PATCH /api/v1/organizations/me/guardrails/{guardrail_id} HTTP/1.1
Otari-Key: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 104

{
  "credential": "sk-guardrails-...",
  "mode": "monitor",
  "url": "https://guardrails.internal.example/validate"
}
{
  "applies_to_all_workspaces": true,
  "created_at": "text",
  "definition_id": "123e4567-e89b-12d3-a456-426614174000",
  "enabled": true,
  "has_credential": true,
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "mode": "text",
  "on_unavailable": "text",
  "organization_id": "123e4567-e89b-12d3-a456-426614174000",
  "profile": "text",
  "updated_at": "text",
  "url": "text",
  "validate_kwargs": {
    "ANY_ADDITIONAL_PROPERTY": "anything"
  },
  "workspace_ids": [
    "123e4567-e89b-12d3-a456-426614174000"
  ]
}

Delete Organization Guardrail

delete

Stop mandating a guardrail, discarding its credential and scope.

Organization owners and admins only. Use enabled: false instead to stop it everywhere while keeping both.

Authorizations
Otari-KeystringRequired

Enter your API key here (sent as Otari-Key header).

Path parameters
guardrail_idstring · uuidRequired
Responses
200

Successful Response

application/json

A human-readable acknowledgment for an operation with nothing to return.

messagestringRequired

What happened.

delete/api/v1/organizations/me/guardrails/{guardrail_id}
DELETE /api/v1/organizations/me/guardrails/{guardrail_id} HTTP/1.1
Otari-Key: YOUR_API_KEY
Accept: */*
{
  "message": "text"
}

Test Organization Guardrail

post

Post some text to the guardrails service a mandate names and return its verdict.

Organization owners and admins only. Uses the mandate's own endpoint and credential, or the deployment's guardrails URL when it names none, and faces the same safety check a request does. Nothing is stored. validate_kwargs replaces the stored arguments for this call, a *** in it keeps the value stored under that name, and omitting it sends the stored arguments.

A mandate that runs a configured guardrail answers 409: test that guardrail through /api/v1/organizations/me/guardrail-definitions. So does one with nowhere to send the check. A service that cannot be reached, or answers something malformed, answers 502, and the reason is in the gateway's log only.

Authorizations
Otari-KeystringRequired

Enter your API key here (sent as Otari-Key header).

Path parameters
guardrail_idstring · uuidRequired
Body

Text to run one mandate's check over, as a request would.

textstring · min: 1 · max: 10000Required

The input to check, as a request's user text would reach it

Responses
200

Successful Response

application/json

The guardrails service's verdict on the text, in the fields a request's check reports.

explanationstring · nullableRequired

The service's reason, when it gives one

scorenumber · nullableRequired

The service's score, when it gives one

validboolean · nullableRequired

False when the guardrail flagged the text, null when it gave no verdict

post/api/v1/organizations/me/guardrails/{guardrail_id}/test
POST /api/v1/organizations/me/guardrails/{guardrail_id}/test HTTP/1.1
Otari-Key: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 72

{
  "text": "text",
  "validate_kwargs": {
    "ANY_ADDITIONAL_PROPERTY": "anything"
  }
}
{
  "explanation": "text",
  "score": 1,
  "valid": true
}

Last updated

Was this helpful?