Skip to main content

Policies & Guardrails

Policies are named checks that run against every request at the policy stage of the pipeline (see Request Pipeline). Each policy runs in either enforce or log-only mode.

Built-in policies

PolicyWhat it does
pii_redactRedacts personally identifiable information (emails, phone numbers, etc.) from the outgoing request before it reaches a provider.
secrets_scanScans the response for accidentally-echoed secrets (API keys, tokens) and blocks or strips them.
topic_guardBlocks requests that match disallowed topic categories — for example legal, medical, or self-harm content, configurable per org.
injectionScores the request for prompt-injection patterns; requests above the configured threshold are blocked.
model_allowRestricts which models a team is permitted to call — useful for keeping regulated data on a specific approved model.
jailbreak_lmA lightweight classifier that flags jailbreak attempts. Ships in log-only mode by default.

Enforce vs. log-only

  • enforce — a policy hit blocks the request and returns HTTP 446.
  • log-only — a policy hit is recorded (visible in the audit log and analytics) but the request proceeds. Useful for evaluating a new policy's false-positive rate before turning it on in enforce mode.

Selecting policies per request

Policies are applied via the x-op-policy header, comma-separated:

x-op-policy: pii_redact,topic_guard

If the header is omitted, the team's configured default policy set applies.

Setting org-wide defaults

Default policies, their mode, and their thresholds are configured per organization at /api/v1/organizations/current/policy, and can be seeded from a starting template — see Compliance Templates for the Healthcare, Finance, and Government presets.

Viewing policy activity

Policy hits are queryable via /api/v1/analytics/policy and exportable via /api/v1/analytics/policy/export for compliance reporting.