> ## Documentation Index
> Fetch the complete documentation index at: https://neuraltrust-92b43583-develop.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Policies

> Configure rate limits, budgets, caching, tool governance, and guardrails globally or per consumer

A **policy** attaches behavior to a gateway's traffic. Each policy configures one built-in
plugin with settings, runs at one or more lifecycle **stages**, and can apply to the whole
gateway or selected consumers.

## Policies screen

Open **Agent Gateway** → **Policies**.

| Tab          | Purpose                                                                                                           |
| ------------ | ----------------------------------------------------------------------------------------------------------------- |
| **Policies** | Search configured policies, filter by protocol (**LLM** / **MCP**), pause or resume them, and open their details. |
| **Catalog**  | Browse plugins by category (guardrails first). **Add policy** starts create.                                      |

### Create or edit

1. **Catalog** → pick a plugin, or **New policy**.
2. Set **Name** (catalog types use a fixed prefix where required).
3. **Scope**
   * **Mode:** **Enforce** · **Observe** · **Throttle** (when the plugin supports it).
   * **Coverage:** **Gateway-wide** or **Targeted** (pick consumers).
4. Fill **Configuration** (dedicated form or schema-driven fields).
5. Save. Use **Pause** / **Resume** / **Delete** from the detail panel without losing history of attachments.

### Attach from a consumer

Open a [consumer](/trustgate/concepts/consumers) → **Policies** → **Add Policy**, or
**Clone policies** from another consumer. Global policies still apply automatically.

## Catalog (UI plugins)

### Traffic control

| Policy                | UI / slug               | Docs                                                                         |
| --------------------- | ----------------------- | ---------------------------------------------------------------------------- |
| Rate Limiter          | `rate_limiter`          | [Rate limiting & budgets](/trustgate/policies/rate-limiting#rate-limiter)    |
| Request size          | `request_size_limiter`  | [Request size](/trustgate/policies/request-size)                             |
| Per-Tool Rate Limiter | `per_tool_rate_limiter` | [Tool governance](/trustgate/policies/tool-governance#per-tool-rate-limiter) |

### Quota

| Policy     | UI / slug            | Docs                                                                    |
| ---------- | -------------------- | ----------------------------------------------------------------------- |
| LLM Budget | `token_rate_limiter` | [Rate limiting & budgets](/trustgate/policies/rate-limiting#llm-budget) |

### Prompt management

| Policy             | UI / slug            | Docs                                                                              |
| ------------------ | -------------------- | --------------------------------------------------------------------------------- |
| Prompt Template    | `prompt_template`    | [Prompt management](/trustgate/policies/prompt-model-controls#prompt-template)    |
| Prompt Compression | `prompt_compression` | [Prompt management](/trustgate/policies/prompt-model-controls#prompt-compression) |

### Tool governance

| Policy         | UI / slug        | Docs                                                                  |
| -------------- | ---------------- | --------------------------------------------------------------------- |
| Tool Injection | `tool_injection` | [Tool governance](/trustgate/policies/tool-governance#tool-injection) |

### Guardrails

| Policy               | UI / slug              | Docs                                                                                                     |
| -------------------- | ---------------------- | -------------------------------------------------------------------------------------------------------- |
| TrustGuard           | `trustguard`           | [Guardrails](/trustgate/policies/guardrails) · [TrustGuard gateway integration](/integrations/trustgate) |
| OpenAI Moderation    | `openai_moderation`    | [Guardrails](/trustgate/policies/guardrails)                                                             |
| Azure Content Safety | `azure_content_safety` | [Guardrails](/trustgate/policies/guardrails)                                                             |
| Bedrock Guardrail    | `bedrock_guardrail`    | [Guardrails](/trustgate/policies/guardrails)                                                             |
| Regex Replace        | `regex_replace`        | [Guardrails](/trustgate/policies/guardrails#regex-replace)                                               |

> **TrustGuard in the UI.** Adding the TrustGuard policy walks you through selecting or
> creating an Agent Runtime **collector**. Connection details are injected by the platform;
> you do not paste base URLs by hand in normal SaaS use.

The live **Catalog** tab is authoritative for what you can add in your tenant.

## Stages

| Stage         | When                                                             |
| ------------- | ---------------------------------------------------------------- |
| Pre-request   | Before the request is forwarded upstream.                        |
| Pre-response  | After the upstream responds, before returning to the client.     |
| Post-response | After the response is returned (cache populate, budget accrual). |

## Mode

| Mode         | Behavior                                          |
| ------------ | ------------------------------------------------- |
| **Enforce**  | Reject, transform, or block violations (default). |
| **Throttle** | Delay rather than reject (rate/budget plugins).   |
| **Observe**  | Record violations without enforcing them.         |

## Ordering

Lower **priority** runs earlier. Same-priority policies may run in parallel when enabled.
Global policies are the baseline; targeted policies refine per consumer.
