# Error reports for failed requests

> Which traces a failed request leaves (an error report, an audit event, a log line, a count for the alerts), the built-in rules, and how an administrator refines them under Configuration → Diagnostics → Error trace policy.

## Why every failure leaves a trace

When something fails in your control plane, support asks for the **error report**: the package that shows what happened on a machine we cannot reach. Every failure you can see therefore leaves a report you can find and send. Its id is in the answer the control plane gave, in the message on the page (with an **Open error report** link) and in the list under **Error reports**. When the same failure repeats, the repeats join the first report and raise its count; they never fill the list with copies.

Not every failed request should write a report, though. Anyone who can reach the control plane over the network can send it a request, and an agent working through the MCP endpoint corrects its calls from the answers it gets. The **error trace policy** decides, for each failed request, which traces it leaves.

## What the policy decides

A failed request leaves up to four traces:

| Trace | What it is |
|---|---|
| Error report | The report support asks for, listed under **Error reports**. Repeats join one report. |
| Audit event | A line in the **Audit** log: who (or which address) sent the request, what was refused and why. A request that was refused before it signed in is recorded with its source address. A credential is never recorded. |
| Log line | A line in the control plane's own log, at the level the rule names (or none). |
| Metric | A count the alert rules read, so a burst of refused requests raises an alert (see the **control-plane-requests** group in the alert reference). |

Every answer still carries its reason and the next step, whatever the policy decides. The policy only decides which traces stay behind.

## Rules

The policy is an ordered list of rules. A failed request is compared with the rules from the top, and the **first rule that matches decides**. A rule matches on four things:

| Field | Matches | Values |
|---|---|---|
| Caller | Who sent the request | `ui` (someone signed in to the control plane's pages), `api` (a control plane API key used against the API), `mcp` (a control plane API key used through the MCP endpoint, including every tool an agent calls), `*` for anyone |
| Authentication | Whether the request signed in | `authenticated`, `unauthenticated` (no credential at all), `rejected` (a credential that is not valid: an unknown, expired or revoked control plane API key, a wrong password, a session that has ended), `*` |
| Status | The answer's HTTP status | One code (`403`), several separated by commas (`401,403`), a class (`4xx` for refusals, `5xx` for failures), `*` |
| Path | The request's address on the control plane | A pattern in which `*` stands for anything (`/api/v1/inference-nodes/*`), or `*`. For an agent's tool call, the address of the command the tool runs |

A request that did not sign in counts as the caller its address belongs to: addresses under `/mcp` are `mcp`, addresses under `/api/` are `api`, everything else `ui`.

## The built-in rules

The control plane always applies these four rules last, after every rule you add:

| Caller | Authentication | Status | Path | Error report | Audit | Log level | Metric |
|---|---|---|---|---|---|---|---|
| `*` | `unauthenticated` | `*` | `*` | off | on | info | on |
| `*` | `rejected` | `*` | `*` | off | on | warning | on |
| `mcp` | `authenticated` | `4xx` | `*` | off | on | info | on |
| `*` | `authenticated` | `*` | `*` | on | on | warning | on |

- Everything someone signed in meets writes an error report: a page's failure is something the operator will meet again, and an API client's failure is what someone writes to support about.
- An agent's refused call (4xx) writes none: guessing an argument and correcting it from the refusal is how an agent works. An agent's call the control plane **fails** (5xx) is reported.
- A request that did not sign in, or signed in with a credential that is not valid, writes no report, because anyone on the network could fill the list. It is recorded in the audit log with its source address instead.

The built-in rules come with the control plane and improve with its releases; they are shown on the Configuration page as **Default**, and cannot be edited there.

## Changing the policy

Under **Configuration → Diagnostics → Error trace policy**, an administrator sees the whole list in the order it applies: the rules you added, then the built-in ones. **Edit rules** adds, removes, reorders and changes your rules; the built-in rules stay below them. Saving replaces your whole list at once, and every change is recorded in the audit log with the rules before and after it. Every control-plane backend instance applies it within a few seconds.

A control plane API key can read and change the policy too, through `POST /api/v1/settings/error-trace-policy/get` and `.../update`, and an agent through the MCP endpoint (`settings_read` and `settings_change`). Changing it needs an administrator.

### Rules that cannot be saved

A rule that could never match is a mistake, so the control plane refuses to save the list and names each problem beside its rule:

- a status that is not a code, a list of codes, a class or `*`, or that names no failure (a status below 400);
- a path that does not start with `/` (and is not `*`);
- a rule that a rule above it already matches completely, so it would never decide anything. Move it above that rule, or remove it.

### Rules that give something up

You may write any rule, including one that gives up a trace the built-in rules keep. The control plane saves it, and shows a warning beside it on the Configuration page for as long as the rule exists:

| The rule | The warning |
|---|---|
| Writes error reports for requests that did not sign in, or with a credential that is not valid | This rule writes an error report for requests from anyone who can reach the control plane. Anyone on the network can then create error reports. |
| Writes no error report when the control plane fails a signed-in request (5xx) | This rule writes no error report when the control plane fails. Whoever meets the failure has no report to send to support. |
| Writes no error report for the control plane's own pages | The control plane's own pages only send what they were built to send. A failure there is a defect the operator will meet again; without a report, support cannot see it. |
| Writes no audit event for credentials that are not valid | Attempts with a revoked or unknown credential leave no trace. |

### Examples

- **An integration you are still building** keeps sending a request to one command that is refused, and you do not want a report for each new mistake: add `api`, `authenticated`, `4xx`, `/api/v1/inference-services/*`, error report off. Remove the rule when the integration is done.
- **You want a report for every refused agent call** while you investigate one agent: add `mcp`, `authenticated`, `4xx`, `*`, error report on. Repeats still join one report per distinct refusal.
