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

# Tool context

> How to pass tool data on a judge call — context.tool_input, tool_description, tool-role messages — and why the facts of a call move a verdict where the tool's name does not.

**`context`**: the request field carrying what the judge can't see for itself — the tool you're about to call, the arguments you're about to call it with, what came back. When a model runs, the entire dict is serialized into its prompt, so everything in it is evidence the judge reasons over, not a routing hint it files away. Not every request needs a judge call — read [where to put content you need judged](#the-operational-fast-pass) before you decide where it goes.

Send it whenever you judge a tool call (`phase="tool_pre"` / `"tool_post"`). Without it the judge scores the request as written, and a request that doesn't say why a restricted action is lawful is genuinely ambiguous — so it routes to a human.

## What the judge sees

The whole `context` dict reaches the judge as text — extra application-specific keys are fine and often useful. And `role: "tool"` messages are treated as **untrusted** content where user-role messages are the operator's request: that distinction is what lets the judge read an instruction buried in retrieved content as an injection attempt instead of as the operator's own request. [Safety bundle](https://docs.tenetlabs.com/concepts/multi-verdict.md#the-safety-bundle).

## Facts change outcomes; names do not

The tool's *name* buys nothing: `context.tool_name` on its own doesn't move a verdict. The parameters and the description do, and `tool_input` works with no `tool_name` at all.

That's the design. The judge isn't accepting a claim that a tool is compliant; it's reading `stage: post_offer, consent_on_file: true` and evaluating whether *that* describes something lawful. **Send facts, not claims.**

## The fields

| Field | Put here | What it does |
| - | - | - |
| `context.tool_input` | The parameters you're about to call with | Highest-value field — the facts the judge evaluates |
| `context.tool_description` | What the tool does and what it requires | Gives the judge the tool's constraints in its own words |
| `context.tool_name` | The tool identifier | Useful in your own traces; **does not** move a verdict on its own |
| `context.tool_output` | What the tool returned (`tool_post`) | Context for the judge — send content you need judged as a `role: "tool"` message, per [the operational fast-pass](#the-operational-fast-pass) |
| `messages[{role: "tool"}]` | Content retrieved from a candidate or third party | Treated as untrusted — this is the injection surface |
| `phase` | `tool_pre` before the call, `tool_post` after | Tells the judge whether it's authorizing or reviewing |
| `surface` | `resume_triage`, `candidate_outreach`, … | Selects the policy set ([Surfaces](https://docs.tenetlabs.com/concepts/surfaces.md)) |

`context.recruiter_prompt` and `context.candidate_content` still matter on every call — [what else the judge needs in the request](https://docs.tenetlabs.com/concepts/surfaces.md#what-else-the-judge-needs-in-the-request).

> [!NOTE]
>
> With `tenet-client`, pass the lawful-basis facts in `context=` and the ask in `tool_input`: `tool_input={"recruiter_prompt": user_ask}, context={"stage": "post_offer", "consent_on_file": True}`. They land at the top level of the wire `context`, which the judge reads. A dict `tool_input` also rides the top-level `tool_input` field, which isn't rendered to the judge — so anything else the judge must read goes in `context` too.

## The operational fast-pass

Deterministic guards run on every request. Behind them, a purely operational request can return `include` with no judge call (the `ops_fast_pass` [path](https://docs.tenetlabs.com/concepts/decisions.md#decision-paths)).

On a tool call the thing under judgment usually isn't the ask — it's the arguments: the message body you're about to send, the draft you're about to post. Put it where the judge reads it:

* **Content the call will produce** → prose in `context.tool_input`.
* **Content you retrieved** → a `role: "tool"` message.
* **Facts about the call** — role, stage, consent flags → `context` keys.

With `tenet-client`, a dict `tool_input` also rides the top-level `tool_input` field. That field isn't rendered to the judge, so put prose the judge must read in `context=` as well.

> [!WARNING]
>
> **At `tool_post`, send content you need judged as a `role: "tool"` message**, not only in `context.tool_output`. That marks it untrusted and puts it in front of the judge.

## Or say it in the request text

If the harness would rather put the basis in the prompt than in `context`, that works. Say what the action is for in the request itself — the role, the process stage, the consent or policy basis — and the judge evaluates it on the merits, the same way it evaluates facts in `tool_input`.

This isn't background-check-specific. The judge scores the request as written, so any tool call touching restricted data or a protected class should say what it's for — for the same reason a well-formed audit log does.

## What a caller can't assert

A caller-asserted field is never an exemption on its own. The engine re-validates it, and an assertion it can't verify can only **tighten** a guardrail, never **loosen** one.

That's by design: a field that could exempt a call could be set by anything calling the API. `tool_name` is a hint, not a credential, and neither it nor `intent` exempts a call. The same rule is what scopes caller-asserted `intent` to the one phase where the engine can check it — see the [read-intent contract](https://docs.tenetlabs.com/concepts/read-intent.md#read-intent-ownership).

The distinction worth holding onto:

* **Stating the basis in the request or in `tool_input`** hands the judge a claim it evaluates on the merits. Works.
* **Asserting compliance through a field** asks the judge to accept a conclusion. Not accepted, by design.

## Before and after

```json Bare — route_to_human theme={null}
{
  "surface": "resume_triage",
  "phase": "tool_pre",
  "messages": [
    {"role": "user", "content": "Can you run a background check on Jane?"}
  ],
  "context": {
    "recruiter_prompt": "Can you run a background check on Jane?"
  }
}
```

```json Enriched — include theme={null}
{
  "surface": "resume_triage",
  "phase": "tool_pre",
  "messages": [
    {"role": "user", "content": "Can you run a background check on Jane?"}
  ],
  "context": {
    "recruiter_prompt": "Can you run a background check on Jane?",
    "tool_name": "run_background_check",
    "tool_description": "FCRA-compliant pre-employment screening. Requires signed disclosure and candidate consent before execution.",
    "tool_input": {
      "candidate_id": "cand-4417",
      "role": "delivery driver",
      "stage": "post_offer",
      "consent_on_file": true
    }
  }
}
```

The bare call stalls the agent and pages a human for a routine action. The enriched one proceeds — and the request itself states *why* it was lawful, which is the better audit artifact regardless of the verdict.

## Cautions

> [!WARNING]
>
> **Never put secrets, credentials, or tokens in `context`.** It is serialized into a model prompt.
>
> Two different things end up in `tool_input`, and they have different rules. **The content the call will produce** — the message body you're about to send, the job-ad draft you're about to post — belongs there: it's what the judge evaluates. **The basis for the call** belongs there as facts — role, stage, consent flags — not as raw personal records. Candidate prose goes in `context.candidate_content`, where the [PII layer](https://docs.tenetlabs.com/concepts/multi-verdict.md#pii-redaction-posture) detects it: a PII span detected anywhere in the request is swept out of `tool_input` too, at any depth, but a span that appears *only* inside `tool_input` is not detected today, so it is not redacted.

* **Don't send tool output as a `user` message.** Use `role: "tool"`. Sent as `user`, retrieved content reads as the operator's own instruction — exactly the confusion an injection attack relies on.
* **Keep `tool_output` to what's being judged.** Everything in `context` is packed into the judged payload, so a large retrieval blob is the main driver of judge latency.

## Verifying a change

Read `verdict`. If it routes, read `findings[0].evidence_span` — the judge writes a specific, natural-language account of what it found missing. Use that, not `route_reason`, which is a machine-readable category rather than an explanation.

> [!NOTE]
>
> Verdicts on marginal phrasings carry run-to-run variation. Sample a case several times before treating it as a regression test.

## Links

* [Surfaces](https://docs.tenetlabs.com/concepts/surfaces.md) — choosing the surface, and the other fields the judge needs
* [Read-intent & wire contract](https://docs.tenetlabs.com/concepts/read-intent.md) — how far a caller-asserted signal goes
* [How the Judge decides](https://docs.tenetlabs.com/concepts/decisions.md) — the verdict vocabulary
* [API overview](https://docs.tenetlabs.com/api-reference/introduction.md) — the full request envelope


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