> ## Documentation Index
> Fetch the complete documentation index at: https://docs.llmgrid.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Guardrails

> Configure, apply, and monitor guardrails to govern model inputs, outputs, and tool execution across the platform.

## Overview

The **Guardrails** page provides a centralized interface for configuring governance, safety, and compliance rules that apply to model requests and tool calls. Guardrails allow you to **inspect**, **block**, **modify**, or **log** inputs and outputs at different stages of the request lifecycle, without requiring application code changes.

Guardrails are first‑class platform resources and integrate seamlessly with routing, virtual keys, agents, prompts, MCP tools, and observability.

***

## Supported Guardrail Providers

The UI supports a broad and extensible set of guardrail providers, enabling provider‑agnostic governance and incremental adoption.

### Available Providers

* **Presidio PII** – Detects and optionally redacts personally identifiable information
* **Bedrock Guardrail** – Policy‑based moderation and safety enforcement
* **Lakera** – Prompt risk and security threat detection
* **Gray Swan Guardrail** – Content safety and misuse detection
* **Noma Security** – AI security posture and threat protection
* **Pangea Guardrail** – Policy enforcement and data protection checks
* **Pillar Guardrail** – Governance and compliance controls
* **Guardrails AI** – Open and extensible guardrail framework
* **AIM Guardrail** – Safety and alignment checks
* **IBM Guardrails Detector** – Enterprise risk and compliance detection
* **Aporia AI** – AI trust, safety, and monitoring
* **EnkryptAI** – Security attacks and misuse detection
* **Azure Content Safety – Prompt Shield** – Prompt injection and abuse protection
* **Azure Content Safety – Text Moderation** – Content moderation and classification
* **PANW Prisma AIRS** – Security and policy enforcement for AI traffic
* **Google Cloud Model Armor** – Model protection and content controls
* **LiteLLM Content Filter** – Built‑in lightweight content filtering
* **Lasso Guardrail** – Prompt safety and validation
* **Javelin Guardrails** – Runtime safety and compliance
* **OpenAI Moderation** – Content safety classification

Multiple providers can be used together within the same tenant and evaluated side‑by‑side using the **Test Playground**.

***

## Creating a Guardrail

Select **Add New Guardrail** to create a guardrail using a guided, step‑based flow.

### Step 1: Basic Info

* **Guardrail Name**\
  A human‑readable name used to identify the guardrail.
* **Guardrail Provider**\
  Select the provider that powers this guardrail.
* **Mode**\
  Defines **when** the guardrail runs during the request lifecycle.
* **Always On**\
  Controls whether the guardrail is enforced tenant‑wide.

***

## Guardrail Execution Modes

Execution mode determines enforcement behavior, latency impact, and scope.

### pre\_call (Recommended)

* Runs **before** the LLM call
* Evaluates **input only**
* Can block or modify requests
* Best for prompt safety, PII detection, and input validation

***

### during\_call

* Runs **in parallel** with the LLM call
* Response is held until evaluation completes
* Balances enforcement with latency sensitivity

***

### post\_call

* Runs **after** the LLM call
* Evaluates **output only**
* Ideal for output moderation and compliance checks

***

### logging\_only

* Runs only on logging callbacks
* Does **not** block or modify requests or responses
* Used for monitoring, audits, and analysis

***

### pre\_mcp\_call

* Runs **before MCP tool execution**
* Validates tool inputs and parameters
* Prevents unsafe or non‑compliant tool usage

***

## Always‑On vs Scoped Guardrails

### Always On

When enabled, the guardrail is enforced automatically for all eligible requests.

**Common use cases**

* Organization‑wide safety policies
* Compliance enforcement
* Mandatory data protection

***

### Scoped Guardrails

When **Always On** is disabled, guardrails can be selectively applied via:

* Virtual keys
* Teams or organizations
* Specific routes
* Playground testing

This enables controlled rollout and experimentation.

***

## Step 2: Provider Configuration

Each provider exposes its own configuration options, managed entirely through the UI.

Typical configuration options include:

* Detection categories
* Enforcement thresholds
* Redaction or blocking behavior
* Policy or ruleset selection

The UI abstracts provider complexity and avoids raw configuration files.

***

## Guardrails List & Lifecycle Management

From the main Guardrails list, administrators can:

* View all configured guardrails
* See provider and execution mode at a glance
* Track creation details
* Edit guardrails as policies evolve
* Remove obsolete guardrails

***

## Test Playground

The **Test Playground** tab allows safe validation of guardrails without impacting production traffic.

### Capabilities

* Test sample inputs and outputs
* Observe enforcement decisions
* Compare multiple guardrails
* Validate provider behavior safely

***

## Integration Across the Platform

Guardrails integrate natively with:

* **Virtual Keys** – Enforce per‑key policies
* **Router Settings** – Apply regardless of routing strategy
* **Agents & Prompts** – Ensure derived calls remain compliant
* **MCP Servers** – Secure tool execution
* **Usage & Logs** – Monitor enforcement outcomes

***

## Observability & Auditing

All guardrail activity contributes to platform observability:

* Logged enforcement decisions
* Audit trails for compliance
* Debugging and incident investigation
* Safe monitoring using `logging_only` mode

***

## Common Use Cases

* Detect and block sensitive data in prompts
* Prevent unsafe or disallowed requests
* Moderate model outputs before delivery
* Enforce organization‑wide content policies
* Monitor risk patterns without blocking traffic
* Gradually roll out stricter enforcement

***

## Best Practices

* Start new guardrails in `logging_only` mode
* Use `pre_call` for strict input validation
* Keep always‑on guardrails minimal and well‑tested
* Apply scoped guardrails during experimentation
* Validate changes using the Test Playground
* Review logs regularly to fine‑tune policies

***

## Related Sections

* **Virtual Keys** – Apply scoped enforcement
* **Router Settings** – Ensure consistent governance
* **Agents** – Govern agent‑initiated requests
* **Prompts** – Standardize safe interactions
* **Usage & Logs** – Monitor guardrail activity
