> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.fabricgateway.ai/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.fabricgateway.ai/_mcp/server.

# Control traffic with plugins

> Secure, transform, observe, and control the cost of LLM, MCP, and HTTP API traffic with plugins.

Plugins are where you configure how Fabric AI Gateway handles traffic. They can authenticate callers, protect sensitive data, transform requests and responses, observe LLM usage, and control traffic across LLM, MCP, and HTTP API routes.

Some behavior is provided by system plugins. For example, creating a connection with **Gateway auth** set to **Gateway key** adds Key Auth to the new route. Other plugins are configured as plugin instances that you attach to a scope.

## Start with a capability

* **Authenticate callers:** Key Auth requires a gateway key on a route. Fabric adds it when you create a connection with **Gateway auth** set to **Gateway key**. See [Authenticate requests with Key Auth](/configure/authentication/key-auth).
* **Protect sensitive data:** PII Redaction detects and redacts configured personal data in LLM and MCP traffic.
* **Transform requests and responses:** Transformer can rewrite headers, query parameters, bodies, and cookies on supported routes, including LLM, MCP, and imported HTTP APIs.
* **Observe LLM traffic:** Use [Analytics and traces](/use/monitor) to review usage, cost, latency, errors, and individual requests.
* **Control cost:** Set spending budgets and token-based limits, and use adaptive model routing. See [Control spend with budgets](/configure/access-and-limits/budgets).

Plugins run in an ordered *policy chain*, where they can inspect, allow, deny, or rewrite traffic at different points in the request lifecycle. The catalog below lists built-in plugins by category and the following sections show how to configure them.

## Browse plugins by category

The catalog groups plugins into the following categories: **Auth**, **Governance**, **Observability**, **Routing**, **Traffic**, and **Transform**.

| Category          | Plugin                    | What it does                                                                                                                                                                                                                                |
| ----------------- | ------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Auth**          | **JWT Auth**              | Authenticates bearer JWTs and projects the verified identity into request context.                                                                                                                                                          |
| **Auth**          | **Key Auth**              | Authenticates API keys and projects the matched consumer identity into request context. Fabric adds it to a route when you create a connection with **Gateway auth** set to **Gateway key**.                                                |
| **Governance**    | **Access Control**        | Enforces configured access rules using the resolved caller, route, connection, and request context.                                                                                                                                         |
| **Governance**    | **Agent Approval**        | Requires an approval token or IAM scope before an agent action is allowed.                                                                                                                                                                  |
| **Governance**    | **Agent Scope Gate**      | Checks agent and OAuth scopes against the route or MCP tool requirements.                                                                                                                                                                   |
| **Governance**    | **Agent Static Deny**     | Blocks agent traffic that matches configured static deny rules.                                                                                                                                                                             |
| **Governance**    | **Deny All**              | Rejects every request at an attached scope.                                                                                                                                                                                                 |
| **Governance**    | **Killswitch**            | Immediately blocks traffic for configured tenant, connection, route, or MCP tool scopes.                                                                                                                                                    |
| **Governance**    | **MCP HTTP bridge**       | Serves a REST connection on an MCP route as MCP tools compiled from its OpenAPI spec.                                                                                                                                                       |
| **Governance**    | **PII Redaction**         | Detects and redacts configured PII in LLM and MCP traffic. Attach it to routes that handle sensitive data, such as Social Security or phone numbers.                                                                                        |
| **Governance**    | **Provider Passthrough**  | Passes a route request directly to its configured provider.                                                                                                                                                                                 |
| **Governance**    | **Tool Search**           | Adds semantic discovery meta-tools for an MCP tool catalog. Instead of showing a model every tool definition, it shows three tools (search, get, and execute) that find the others, so the model sees only what it needs, when it needs it. |
| **Governance**    | **Validator**             | Validates configured request and response fields through policy rules.                                                                                                                                                                      |
| **Governance**    | **LLM budget**            | Enforces UTC calendar spending limits using synchronized provider pricing, Redis counters, and control-plane checkpoints.                                                                                                                   |
| **Governance**    | **LLM Observability**     | Records token usage, the response model, and the finish reason for each LLM request.                                                                                                                                                        |
| **Governance**    | **Agent Audit**           | Emits an audit record for each completed or failed agent action.                                                                                                                                                                            |
| **Observability** | **Access Log**            | Records completed gateway requests for operational auditing and diagnostics.                                                                                                                                                                |
| **Observability** | **Token Counter**         | Counts LLM token usage after a request completes.                                                                                                                                                                                           |
| **Routing**       | **LLM Model Router**      | Routes a `<provider>/<model>` request to the connections that serve that model, in order, until one answers.                                                                                                                                |
| **Routing**       | **Adaptive Model Router** | Selects an LLM model and reasoning effort per request using configurable heuristics, classifiers, or structured decision signals.                                                                                                           |
| **Routing**       | **LLM Router**            | Chooses which of the route's connections handles each LLM request, and fails over when one fails.                                                                                                                                           |
| **Traffic**       | **LLM Rate Limit**        | Enforces LLM request and token-based limits.                                                                                                                                                                                                |
| **Traffic**       | **Rate Limit**            | Enforces request-rate limits for the attached scope.                                                                                                                                                                                        |
| **Transform**     | **Secret Injector**       | Resolves configured secrets and injects them into outbound request headers or query parameters.                                                                                                                                             |
| **Transform**     | **Transformer**           | Transforms configured request and response fields through policy obligations.                                                                                                                                                               |

The **Transformer** and **Validator** plugins are the most versatile. Both can run in the request and response phases and can read nearly every available field. Transformer can change headers, query parameters, body, status, and cookies. Validator only adds a marker header. They can do so only when scoped globally, to a connection, or to a route.

## Add a plugin instance

A plugin in the catalog doesn't do anything on its own. To apply it to traffic, create a *plugin instance* that attaches the plugin to a scope and configures it.

To add a plugin instance, do the following:

1. In the sidebar, select **Plugins**.
2. On the **All** tab, find the plugin you want, such as **Transformer** or **Rate Limit**. Use **Search plugins** or the filters to narrow the list.
3. Next to the plugin, click **Use**. The **New plugin instance** form opens.
4. Enter a **Name** for the instance. Names must be unique. Reusing an existing name replaces that instance. You can't change the name after you create the instance.
5. Select a **Scope kind**, such as **global** or **route**. Some plugins can be scoped only to a route. If you choose a scope narrower than global, also select one or more **Scope name** values, such as specific routes. Fabric creates one instance for each.
6. Under **Configuration**, configure the plugin using its dedicated form, or click **Edit as JSON** to provide raw configuration. **Edit as JSON** isn't available for Rate Limit, Passthrough, or Adaptive Model Router.
7. Optionally, expand **Match conditions and status** and add **Match conditions** to limit when the instance runs:
   * **Path prefix**
   * **Methods**
   * **Only run for consumer**
   * **Only run for consumer group**
8. Under **Status**, confirm that **Enabled** is on. Fabric saves disabled instances but skips them at request time, so you can stage a configuration without activating it.
9. Click **Save**.

To review the plugins that you've already set up, select the **Configured** tab.

### Example: Rewrite a header with the Transformer plugin

The following example adds a transform that sets an `X-Api-Key` header on every matching request.

1. Add a plugin instance and select **Transformer** as the plugin.
2. Under **Transforms**, set the following values:
   * **Phase**: `Request`
   * **Operation**: `set`
   * **Target**: `Header`
   * **Name**: `X-Api-Key`
   * **Value**: `prod`
3. Review the **Compiled policy (Rego)** panel. This panel is a read-only preview of the OPA policy that the control plane compiles from your transform and ships to the data plane's sidecar.
4. Click **Save**.

### Example: Rate limit an MCP route

The following example limits traffic to a specific MCP route.

1. Add a plugin instance and select **Rate Limit** as the plugin.
2. Set **Scope kind** to **route** and **Scope name** to the route you want to limit, for example `linear-mcp`.
3. Under **Configuration**, set **Count by** to one of the following:
   * **Consumer**: One counter per authenticated caller. Requires authentication on the route.
   * **Credential**: One counter per API key. Fabric fills this counter only when Key Auth is in use.
   * **Global**: One counter for every request. This is the only option that works without authentication.
4. Set **Limit**, the number of requests allowed per window. This field is required.
5. Set **Window (seconds)**. The default is `60`.
6. Click **Save**.

To see how a plugin's execution appears in request traces, see [Inspect traces](/use/monitor/traces).

## Guides for specific plugins

| Guide                                                                     | Use it to                                                       |
| ------------------------------------------------------------------------- | --------------------------------------------------------------- |
| [Authenticate requests with Key Auth](/configure/authentication/key-auth) | Require a gateway key on a route.                               |
| [Route LLM requests across models and providers](/configure/routing)      | Pick a model for each request, and fail over between providers. |

## Next steps

* To review how your plugins affect traffic, see [Monitor gateway traffic](/use/monitor).
* To connect another provider, see [Manage connections and routes](/configure/connections).