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

# Read-intent & wire contract

> The top-level intent field, the tool_post-only read-intent safety contract, and the X-Tenet-Api-Version header the SDK sends to /decide.

**A caller can tell the judge that a call is a read.** The `/decide` body carries an optional top-level `intent` field, and the engine treats it as its **highest-precedence** intent signal. Below: what goes on the wire, what the engine does with it today, who owns the read taxonomy, and why a caller's read only counts at one phase.

Current contract version: **0.4** (stamped as `X-Tenet-Api-Version: 0.4`).

## The `intent` field

A caller-asserted classification of the turn or tool call, emitted as a top-level field on the `/decide` body:

| Value | Meaning | On the wire |
| - | - | - |
| `read` | Non-actuating lookup | Emitted |
| `action` | Mutating / actuating | Emitted |
| `unknown` | No assertion (the default) | **Omitted** |
| *unset* / `null` | No assertion | **Omitted** |

`unknown` / `null` are byte-identical to not sending the field — the engine defaults absent → `unknown`. An out-of-vocab value raises `ValueError` at the client boundary rather than shipping a bad signal.

### What the engine does with it today

The engine classifies every request's intent — caller assertion first, then `phase`, `tool_name`, and `tool_input` — and records the result on the [decision trace](https://docs.tenetlabs.com/concepts/traces.md). The current judge doesn't read that classification, so `intent` doesn't change a verdict today: a `read` assertion neither fast-passes a call nor loosens anything.

Send it anyway where you can do it correctly. It costs nothing, it puts your read/write taxonomy on every trace, and the ownership rules below keep it accurate.

## Read intent ownership

Assert `intent="read"` **only at `phase == "tool_post"`**. A read describes a tool call that has already run: at `agent_input` there is no tool call, and at `tool_pre` the call hasn't executed. The assertion doesn't change a verdict today; the rule keeps the signal accurate.

The `tenet-langchain` middleware applies the phase rule for you: it stamps `intent` only at `tool_post`, and never at `agent_input` or `tool_pre`, whatever `read_tools` / `intent_resolver` say. `tenet-client`'s `intent=` parameter sends what you pass, so apply the same rule yourself. Send-side rules:

1. **Emit `intent="read"` only at `tool_post`** — never at `agent_input` or `tool_pre`, even when the tool name is in `read_tools`.
2. **Emit `tool_name` on every judged tool call** — it is one of the inputs the engine classifies intent from.
3. **Declare the read/mutating taxonomy once** at middleware construction ([`read_tools=` / `intent_resolver=`](https://docs.tenetlabs.com/sdk/tenet-langchain#read-intent)) and resolve intent from that single audited source — never blanket `intent="read"` onto an actuating tool.

## The `X-Tenet-Api-Version` header

Every `/decide` request — sync, async, and streaming — carries `X-Tenet-Api-Version: 0.4`. It declares the send-side contract the SDK is speaking. You don't set it; the client stamps it automatically.

## Rule ID normalization

The wire carries, per finding, both:

* `rule_ids` — engine **codes** (e.g. `EEO-AGE-PROXY-01`) that display / topic mappers key on, and
* `risk_labels` — human phrases (e.g. `"age discrimination"`).

`JudgeVerdict.from_cloud_response` populates each finding's singular `rule_id` by **preferring `rule_ids` (codes)** and falling back to `risk_labels` only when no codes are present. Read the whole normalized list with the `JudgeVerdict.finding_labels` accessor:

```python theme={null}
verdict = JudgeVerdict.from_cloud_response(resp)
verdict.finding_labels                      # ["EEO-AGE-PROXY-01", ...] — normalized, in order
[f["rule_id"] for f in verdict.findings]    # equivalent
```

## Setting `intent`

| Path | How |
| - | - |
| `tenet-langchain` (recommended) | Declare the taxonomy once — [`read_tools=` / `intent_resolver=`](https://docs.tenetlabs.com/sdk/tenet-langchain#read-intent) on the middleware. The middleware resolves and stamps intent for you, `tool_post`-scoped. |
| `tenet-client` | The first-class [`intent=`](https://docs.tenetlabs.com/sdk/tenet-client#evaluation-parameters) parameter on `evaluate` / `evaluate_async` / `evaluate_stream` / `evaluate_stream_to_response` / `evaluate_phase[_async]`. |

## Links

* [tenet-langchain — `read_tools` / `intent_resolver`](https://docs.tenetlabs.com/sdk/tenet-langchain#read-intent)
* [tenet-client — the `intent` parameter](https://docs.tenetlabs.com/sdk/tenet-client#evaluation-parameters)
* [Surfaces — choosing the surface per call](https://docs.tenetlabs.com/concepts/surfaces.md)
* [Multi-verdict responses — `findings[]` and `rule_ids`](https://docs.tenetlabs.com/concepts/multi-verdict)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.