Overview
Prompt Guardrails is available in Bifrost v2.0.0 and above.
ALLOWlets the request or response continue.BLOCKreturns a guardrail intervention with the judge’s reason (an LLM judge) or the profile name (a decision model judge).
Prompt Guardrails is a blocking guardrail. It does not redact or transform content. For deterministic credential and pattern checks, use Secrets Detection or Custom Regex.
How It Works
At runtime:- A guardrail rule matches an LLM request or MCP tool execution.
- Bifrost extracts text from the rule’s selected
input,output, orbothphase. - Prompt Guardrails sends that text and the configured natural-language policy to the selected judge model.
- An LLM judge returns a JSON
ALLOWorBLOCKdecision with a short reason. A decision model judge returns the probability that the text violates the policy, and Bifrost blocks when it reaches the profile’sblock_threshold. - Bifrost continues processing or returns a guardrail intervention.
When to Use Prompt Guardrails
Prompt Guardrails is a good fit when a policy depends on meaning or context:- Block requests asking the model to impersonate a company employee.
- Prevent responses from making definitive medical diagnoses.
- Restrict discussion of unreleased product information.
- Enforce a customer-specific communication or content policy.
You can attach multiple profiles to one rule for layered protection.
Judge Model Requirements
The selected judge provider must already be configured and enabled in Bifrost. An LLM judge model must support Chat Completions or the Responses API; a decision model judge has its own requirements, covered in Decision Model Judges. For an LLM judge, Bifrost prefers Chat Completions and switches to the Responses API when the provider requires it. An LLM judge request sends only the system prompt, the evaluated content, and the output-token limit. It does not sendresponse_format or sampling parameters such as temperature, so models without structured-output support, including self-hosted models, can be used as judges. The system prompt instructs the judge to return the JSON decision, and Bifrost validates the reply strictly.
Model-catalog metadata is not required. When the catalog describes the selected model, the UI shows its advertised capabilities as hints, but Verify is the authoritative check because it calls the model.
Reasoning models spend output tokens on reasoning before they write the decision. If verification reports that the judge returned no text decision, increase
max_output_tokens.Decision Model Judges
Setjudge_type to decision to judge with a decision model instead of an LLM. Decision models answer a typed question with a calibrated probability rather than generated text, so they are typically faster and cheaper per evaluation than an LLM judge, and the blocking point is a number you tune instead of a prompt you rewrite.
For each evaluation, Bifrost sends one predicate question on the /v1/decisions path: its instructions ask whether the text violates the policy, and its criteria define true as a violation and false as text that is unrelated to the policy or only breaks some other policy. How clear a violation must be is left to block_threshold. The extracted text is the input. Bifrost reads the answer’s probability and:
- Blocks when the probability is at or above
block_threshold(default0.9). - Allows when it is below.
Only native decision models can judge. A chat model returns
unsupported_operation, and the compat setting convert_decision_to_responses does not apply to judge requests, so a decision profile never falls back to emulating the decision through a chat model. Use an LLM judge for chat models.
Creating or verifying a decision profile with prompt_template or max_output_tokens, or an LLM profile with block_threshold, is rejected. A profile without judge_type is an LLM judge, so existing profiles are unchanged.
A refusal, a missing answer, or an answer without a probability is a judge error. Like every other judge error, it is logged and the guardrail fails open; see Decisions and Failure Behavior.
Configuration
- Web UI
- API
- config.json
- Helm

- Go to Guardrails > Providers.
- Select Prompt Guardrails.
- Click Add Configuration.
- Enter a descriptive Name.
- Choose the Judge Type: LLM or Decision Model.
- Select the Judge Provider and Judge Model. With Decision Model, only providers that serve decision models are listed.
- Enter the natural-language policy in Rule.
- For a decision model, set the Block Threshold.
- Optionally expand Additional Configuration to change the timeout and, for an LLM judge, the system prompt or output-token limit.
- Turn on Enabled if the profile should run as soon as it is attached.
- Click Verify and Save. Bifrost runs a live judge request first and saves the profile only if it passes.
- Go to Guardrails > Configuration and attach the profile to a guardrail rule.
When you edit an existing profile, Re-verify runs the live check without saving, and Verify and Save saves your changes after they pass verification. A change you already checked with Re-verify is saved without a second check. Each judge type keeps its own provider and model, so switching the judge type and back restores them.
Configuration Fields
The default system prompt treats the configured rule as the complete policy. It blocks only clear rule violations and allows unrelated, ambiguous, or uncertain content. If you customize the prompt, preserve
{{rule}}; Bifrost always sends the evaluated content separately and appends the required JSON output format to every system prompt, so a custom template does not need to describe the response shape.
Prompt Policy vs. Guardrail Rule
Prompt Guardrails uses two different kinds of rules:
The guardrail rule also owns
input, output, or both, sampling, execution timeout, maximum turns, streaming replay settings, and the linked profile IDs.

What Verify Checks
Verify performs a real internal judge request with the selected provider and model. It checks:- Configuration-field validation.
- Provider configuration and model reachability.
- Chat Completions or Responses API support for an LLM judge, or decisions support for a decision model judge.
- The judge model’s ability to return a valid JSON
ALLOWorBLOCKdecision, or a violation probability. For a decision model, the result names the probability and whether it would block at the configured threshold.
"test". It does not test whether your policy makes the correct decision on real application content.
Decisions and Failure Behavior
An LLM judge returns:BLOCK, Bifrost returns a guardrail intervention containing the judge’s short reason. For ALLOW, processing continues normally. A decision model judge has no reason to return, so its intervention names the profile, and the violation probability and threshold are recorded in the guardrail log.
If the judge request times out, the provider rejects it, the response cannot be parsed, or a decision model refuses or returns no probability, Bifrost logs the provider failure and continues the application request or response. Prompt Guardrails therefore fails open on judge/runtime errors. Monitor guardrail logs and alerts if the policy protects a security-critical boundary.
Streaming and MCP
Prompt Guardrails can be attached to LLM and MCP guardrail rules:- For LLM input rules, it evaluates extracted request text before the model call.
- For LLM output rules, it evaluates extracted response text.
- For MCP input rules, it evaluates text extracted from tool arguments before execution.
- For MCP output rules, it evaluates text extracted from a successful tool result before it is returned.
Cost, Latency, and Logs
Each evaluated input or output phase makes an additional request to the judge: a chat or Responses request for an LLM judge, a decisions request for a decision model judge. Multiple matching rules or Prompt Guardrails profiles can produce multiple judge calls for one application request. Judge calls add:- Provider latency, bounded by the configured timeout.
- Prompt and completion token usage.
- Judge-model cost when pricing is available in the model catalog.
Writing Effective Policies
Write one narrow, testable policy per profile. For example:- State exactly what must be blocked and what closely related content is allowed.
- Test clear allow, clear block, ambiguous, and prompt-injection examples.
- Keep deterministic checks in Secrets Detection or Custom Regex.
- Use rule sampling when full coverage is not required and judge cost is significant.
- Use descriptive profile names so logs identify the policy without opening its configuration.
- Review judge reasons and false positives before expanding traffic coverage.
Troubleshooting
For shared rule configuration, CEL variables, and provider management, see the Guardrails overview.

