Organization guardrails
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.
Enter your API key here (sent as Otari-Key header).
Number of records to skip
0Maximum number of records to return
100Successful Response
Validation Error
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"
]
}
]
}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.
Enter your API key here (sent as Otari-Key header).
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.
True runs this in every workspace of the organization, including one created later; false runs it only in the workspaces named by workspace_ids
falseBearer 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
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
False stops the guardrail everywhere without discarding it
trueblock rejects a flagged request with 403; monitor annotates the response and forwards it
monitorPossible values: What a block-mode entry does when the guardrails service cannot be reached or gives no verdict
blockPossible values: Profile name configured on the guardrails service, unique within the organization
Guardrails endpoint for this entry; null uses the deployment's guardrails_url
Workspaces this guardrail runs in. Must be empty when applies_to_all_workspaces is true
Successful Response
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.
Validation Error
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"
]
}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.
Enter your API key here (sent as Otari-Key header).
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.
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
Successful Response
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.
Validation Error
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"
]
}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.
Enter your API key here (sent as Otari-Key header).
Successful Response
A human-readable acknowledgment for an operation with nothing to return.
What happened.
Validation Error
DELETE /api/v1/organizations/me/guardrails/{guardrail_id} HTTP/1.1
Otari-Key: YOUR_API_KEY
Accept: */*
{
"message": "text"
}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.
Enter your API key here (sent as Otari-Key header).
Text to run one mandate's check over, as a request would.
The input to check, as a request's user text would reach it
Successful Response
The guardrails service's verdict on the text, in the fields a request's check reports.
The service's reason, when it gives one
The service's score, when it gives one
False when the guardrail flagged the text, null when it gave no verdict
Validation Error
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?
