Skip to main content
Guardrails are an enterprise-only feature and require the enterprise Bifrost image.
Credential and endpoint fields in guardrail provider config blocks support "env.VAR_NAME" strings (e.g. "env.AWS_SECRET_KEY"). Bifrost resolves the value from the process environment at startup. See the Environment Variable Support section for the complete per-provider field list.
Guardrails are configured under guardrails_config in config.json. The configuration has two parts:
  • guardrail_providers - the backend that performs the check. Rules link to providers by id.
  • guardrail_rules - CEL expressions that control when and where providers are invoked.

Providers

Runs entirely in-process with no external dependency. Patterns use RE2 syntax. Supports optional per-pattern flags: i (case-insensitive), m (multiline), s (dot-all). Each pattern can detect_only, block, or redact.
The Web UI’s PII Detection template is also a regex provider configuration. See Custom Regex for the full examples, and Guardrail Redaction for redaction mode behavior.

Provider Fields


Environment Variable Support

Any field marked env.* supported accepts a bare "env.VAR_NAME" string in addition to a literal value. Bifrost resolves the variable from the process environment at startup. Fields marked plain only must be a literal value (boolean, number, array, or string).

AWS Bedrock

Azure Content Safety

Microsoft Presidio

Azure AI Language PII

Google Model Armor

CrowdStrike AIDR

Patronus AI

Gray Swan

Lakera Guard

Repello Argus

Regex

Secrets

Prompt Guardrails


Rules

Rules are CEL expressions that fire when their condition matches. Set target to "llm" or "mcp" to select the request boundary the rule guards. The target defaults to "llm" when omitted. For block-capable streaming output rules, stream_replay_event_interval_ms sets the delay between consecutive buffered events after the response is allowed. It defaults to 0, which sends all buffered events immediately; the dashboard initializes it to 25 when pacing is enabled. When multiple matched block-capable rules specify different positive values, Bifrost uses the largest interval. All targets expose these request identity variables: LLM rules additionally expose: MCP rules additionally expose: Target-specific variables are isolated. For example, model is unavailable to MCP rules, and mcp_tool is unavailable to LLM rules.

Rule Fields

max_turns_to_send, evaluation_mode, and stream_replay_event_interval_ms configure LLM conversation and streaming behavior. They do not change MCP tool execution behavior.

Full Example