---
title: "Create Organization Guardrail"
method: POST
path: "/v1/organizations/me/guardrails"
tags: ["organization-guardrails"]
---

# Create Organization Guardrail

`POST /v1/organizations/me/guardrails`

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.

## Request body

- OrganizationGuardrailCreate — 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 `entities.WorkspaceMcpServer` and `entities.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_workspaces` boolean — True runs this in every workspace of the organization, including one created later; false runs it only in the workspaces named by workspace_ids
  - `credential` string, nullable — 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
  - `enabled` boolean — False stops the guardrail everywhere without discarding it
  - `mode` 'block' | 'monitor' — block rejects a flagged request with 403; monitor annotates the response and forwards it
  - `on_unavailable` 'block' | 'monitor' — What a block-mode entry does when the guardrails service cannot be reached at all
  - `profile` string, required — Profile name configured on the guardrails service, unique within the organization
  - `url` string, nullable — Guardrails endpoint for this entry; null uses the deployment's guardrails_url
  - `validate_kwargs` object, nullable — Extra kwargs forwarded to the guardrails service /validate call
  - `workspace_ids` string[] — Workspaces this guardrail runs in. Must be empty when applies_to_all_workspaces is true

## Response `201`

Successful Response

- OrganizationGuardrailPublic — The API-facing shape. Never carries the credential, only whether one is set.
  - `applies_to_all_workspaces` boolean, required
  - `created_at` string, required
  - `enabled` boolean, required
  - `has_credential` boolean, required
  - `id` string, uuid, required
  - `mode` string, required
  - `on_unavailable` string, required
  - `organization_id` string, uuid, required
  - `profile` string, required
  - `updated_at` string, required
  - `url` string, nullable, required
  - `validate_kwargs` object, nullable, required
  - `workspace_ids` string[], required

## Other responses

- `422` — Validation Error

## Changes

- **2026-08-24** `cf308338ce74` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/mozilla-ai/apis/otari/changes/v1/organizations/me/guardrails/post.md)

---

[API](https://skmtc.dev/mozilla-ai/apis/otari.md) · [All operations](https://skmtc.dev/mozilla-ai/apis/otari/llms.txt) · [OpenAPI document](https://skmtc.dev/mozilla-ai/apis/otari/revisions/80c117c36f36?raw)
