> 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.

# Agent Audit plugin

> Reference for the Agent Audit plugin, which writes an audit event for each request from a caller with an agent identity.

The Agent Audit plugin writes one audit event for each request from a caller with an agent identity, whether the request was allowed or refused. The event is an `agent.decision` log line at `INFO` level on the data plane. The plugin never changes a request or response, and it passes every value through the gateway's secret redaction first.

A caller has an agent identity when [JWT Auth](/reference/plugins/jwt-auth), Postman API key auth, or API key to access token identified it. Users identified that way are recorded without `emit_for_humans`. Callers identified by Key Auth are recorded only with `emit_for_humans` on.

## Where it runs

|             |                                                                                                                                               |
| ----------- | --------------------------------------------------------------------------------------------------------------------------------------------- |
| Protocols   | The console offers it for MCP routes. The gateway itself runs it on any protocol, so a `global` instance also applies to HTTP and LLM routes. |
| Scope kinds | `global`, `route`, on MCP routes                                                                                                              |
| Phase       | After the response, or after a failed forward                                                                                                 |

## Configuration

| Field             | Type    | Default | Description                                  |
| ----------------- | ------- | ------- | -------------------------------------------- |
| `emit_for_humans` | boolean | `false` | Also records callers with no agent identity. |
| `include_request` | boolean | `true`  | Adds `method` and `path` to the event.       |
| `include_scopes`  | boolean | `true`  | Adds the caller's scopes to the event.       |

Each event has `event`, `timestamp`, `protocol`, `decision` (`allow` or `deny`), and `forwarded`. It also has the caller's principal, user, and session IDs, the `route` and `service`, and on MCP `tools/call` the `mcp_tool`.

## Example

```json
{
  "name": "audit-agents",
  "plugin_id": "agent-audit",
  "scope": { "kind": "global" },
  "config": { "include_scopes": true }
}
```

## Related guides

* [Monitor a data plane](/run/monitor)