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

# tenet-client

> Python SDK reference — TenetCloudJudgeClient, response models, policies, and the @judged decorator.

**`tenet-client`**: framework-agnostic Python client for the Judge API. Pure Python + `httpx` + `pydantic` — no LangChain dependency. Python 3.11–3.13.

```bash theme={null}
pip install tenet-client
```

## TenetCloudJudgeClient

```python theme={null}
TenetCloudJudgeClient(
    client_id: str | None = None,   # M2M — with client_secret, or pass api_key instead
    client_secret: str | None = None,
    judge_id: str = "hr-1",         # only "hr-1" is served today; other ids raise JudgeUnavailableError
    surface: str = "resume_triage", # client-default surface — override per call, see /concepts/surfaces
    timeout: float = 3.0,           # per-call HTTP timeout, seconds
    use_stream: bool = False,       # verdict-first SSE on async paths
    workflow: str | None = None,    # trace-only label; filters traces per integration
    *,
    api_key: str | None = None,     # API key from platform.tenetlabs.com; use instead of client_id/client_secret
    deadline: float | None = None,  # wall-clock bound on the whole call, seconds; see Deadlines and outages
    breaker: CircuitBreaker | None = None,  # opt-in outage breaker
)
```

Pass `api_key`, or `client_id` and `client_secret`. Passing both, neither, or a key that doesn't start with `sk_tenet_` raises `ValueError`. See [Authentication](https://docs.tenetlabs.com/authentication.md).

`TenetCloudJudgeClient.from_env()` reads the same options from `TENET_*` environment variables — the [full table](https://docs.tenetlabs.com/authentication.md#environment-variables) is in Authentication. Prefer `from_env()`; constructor args are for tests and multi-tenant processes.

### Methods

| Method | Returns | Notes |
| - | - | - |
| `evaluate(**kw)` | `CloudJudgeResponse` | Sync. The workhorse. |
| `evaluate_async(**kw)` | `CloudJudgeResponse` | Async twin. |
| `evaluate_stream(**kw)` | `AsyncIterator[CloudJudgeStreamEvent]` | Verdict-first SSE — [guide](https://docs.tenetlabs.com/guides/streaming.md). Async only. |
| `evaluate_stream_to_response(**kw)` | `CloudJudgeResponse` | Drains the stream, returns the aggregate. |
| `evaluate_phase(policy=..., **kw)` | `(JudgeVerdict, JudgeAction)` | Applies a [policy](https://docs.tenetlabs.com/guides/policies.md) for you. Sync; `evaluate_phase_async` for async. |
| `warmup()` / `warmup_async()` | `None` | Pre-mints the access token (no call to the judge); a no-op with `api_key`. Call at startup. |
| `close()` / `aclose()` | `None` | Releases the HTTP pool. Call at shutdown. |

### Evaluation parameters

All `evaluate*` methods take the same keyword-only parameters:

**phase** `str` *required*

Where in the agent loop: `"agent_input"` | `"tool_pre"` | `"tool_post"` | `"agent_output"`.

**tool\_name** `str`

Tool being gated. Used by per-tool policies and audit logs.

**tool\_input** `Any` (default: None)

Tool arguments (`tool_pre`) — any JSON-serializable value. The wire envelope's `context.recruiter_prompt` is derived from it: a `str` passes through verbatim; other shapes are JSON-serialized, which is *not* the user's words. To control what the judge reads — and to supply `context.candidate_content` when the action involves a resume — pass a dict carrying those keys: `tool_input={"recruiter_prompt": user_ask, "candidate_content": resume_text}`. [Why these fields matter](https://docs.tenetlabs.com/concepts/surfaces.md#what-else-the-judge-needs-in-the-request).

A dict `tool_input` is also sent as the top-level `tool_input` wire field, which isn't rendered to the judge — [where to put content you need judged](https://docs.tenetlabs.com/concepts/tool-context.md#the-operational-fast-pass). Any other facts the judge should read go in `context=`.

**context** `dict[str, Any] | None` (default: None)

Request-level facts for the judge to read — role, stage, consent flags, a job description, a scorecard — as a flat dict merged into the wire `context`. Only `recruiter_prompt` and `candidate_content` are read from `tool_input`; anything else the judge must read goes here. Keys must be strings and values JSON-serializable; the reserved keys `tool_input`, `tool_output`, `recruiter_prompt`, `candidate_content`, `tool_name`, `surface`, `phase`, `intent`, and `workflow` raise `ValueError` — use their own arguments. Per call; no client-level default. [Tool context](https://docs.tenetlabs.com/concepts/tool-context.md).

**tool\_output** `Any` (default: None)

Tool return value (`tool_post`). Sent as a `role: "tool"` message after the user's turn, which the judge reads as untrusted content — an instruction inside a tool result is treated as a possible injection, not as the user's request. It is never merged into `context`, so a tool's return value can't set a context key the judge reasons over (`role`, `candidate_content`, …). If you need a value from the output as context, pass it in `context=` yourself.

**retrieved\_content** `list[str] | None` (default: None)

Third-party text that isn't the judged tool's return value — resume bodies, candidate messages, fetched pages, other API responses. Each entry is sent as its own `role: "tool"` message, the same untrusted channel as `tool_output`.

**agent\_reply** `str | None` (default: None)

The agent's own reply, to check what it said before your user sees it. Only valid with `phase="agent_output"`; any other phase raises `ValueError`. Sent as the **last** message, `role: "assistant"`: the judge reviews that message and reads everything before it (the user's ask in `tool_input`, `retrieved_content`, `tool_output`) as context. Don't send the reply as `candidate_content` or `tool_output`. Those channels mean text someone else wrote and are judged as untrusted, so your agent's own next steps read as an injection. Pass the user's ask as well: the judge holds fewer lawful replies when it can see what the reply answers. Reply checks are enabled per account; contact Tenet to turn them on. Added in 0.7.6.

**user\_prompt** `str | None` (default: None)

What the user asked, sent separately from the tool's arguments. The judge reads it as the request. Passing a different value than a `recruiter_prompt` key inside `tool_input` raises `ValueError`. Added in 0.7.7. [The user's ask](#the-users-ask-user_prompt-and-candidate_content).

**candidate\_content** `str | None` (default: None)

Text written by the person the decision is about. Never the agent's reply, which is `agent_reply=`. Passing a different value than a `candidate_content` key inside `tool_input` raises `ValueError`. Added in 0.7.7.

**deadline** `float | None` (default: None)

Wall-clock bound on the whole call, in seconds. Overrides the client's `deadline`. Exceeding it raises `JudgeTimeoutError`. Added in 0.7.7. [Deadlines and outages](#deadlines-and-outages).

**record\_breaker** `bool` (default: True)

Pass `False` for calls that only observe, so they neither take the breaker's probe slot nor count toward it. Added in 0.7.7. [Deadlines and outages](#deadlines-and-outages).

**session\_id** `str | None`

Conversation ID. Groups evaluations into one audit trace. Max 199 chars.

**prior\_user\_turns** `list[str] | None`

Prior user messages, oldest first — gives the judge multi-turn context.

**resolution\_status** `str | None`

`"resolved"` | `"unresolved"` | `"error"` — whether the tool output settled the request.

**intent** `str | None` (default: None)

Caller-asserted classification of the call, emitted as the top-level `intent` wire field — the service's highest-precedence intent signal, recorded on the decision trace (the current judge doesn't change verdicts on it). `"read"` (non-actuating lookup) | `"action"` (mutating/actuating) | `"unknown"` (== `None` — omitted from the body). An out-of-vocab value raises `ValueError` at the client boundary. Present on `evaluate` / `evaluate_async` / `evaluate_stream` / `evaluate_stream_to_response` / `evaluate_phase[_async]`, and sets `CloudJudgeRequest.intent`. **Safety:** `"read"` is authoritative only at `phase="tool_post"`, where the tool's read-only nature is verifiable — see the [read-intent contract](https://docs.tenetlabs.com/concepts/read-intent.md). In `tenet-langchain`, prefer declaring the read taxonomy once with [`read_tools=`](https://docs.tenetlabs.com/sdk/tenet-langchain#read-intent) rather than passing `intent=` per call.

**surface** `str | None`

What kind of recruiting action this call checks: `"resume_triage"` | `"job_ad_drafting"` | `"candidate_ranking"` | `"interview_question_gen"` | `"candidate_outreach"`. Overrides the client default — set it **per call** from the user's current intent (a tool → surface map is usually enough); don't let one hardwired value judge all your traffic. [Surfaces](https://docs.tenetlabs.com/concepts/surfaces.md).

**workflow** `str | None` (default: None)

Trace-only label naming which of your integrations made the call — `"resume-screener"` vs `"recruiter-agent"` — so your account's traffic filters per workflow on the trace. Lowercase slug (`^[a-z0-9][a-z0-9._-]*$`), at most 64 chars; a bad value raises `ValueError` before the request is sent. Overrides the client / `TENET_WORKFLOW` default per call, the same resolution as `surface`. Never read by the judge and never affects the verdict — distinct from `surface`, which the judge reads. Sent only when set.

**trace\_id** `str | None`

Distributed-trace correlation. Also: `parent_span_id`, `metadata: dict`, `timeout: float`.

## CloudJudgeResponse

```python theme={null}
# Binary summary — any non-allow verdict is "block". To branch on
# allow / caveat / review / block, use JudgeVerdict (evaluate_phase) instead.
decision: "allow" | "block"
reason: str | None
latency_ms: int
judge_id: str
judge_version: str

# Merged top-level (most-restrictive across enforcing findings)
verdict: str | None        # "include" | "exclude" | "include_with_caveats" | "defer"
                           # | "route_to_human" | "pass" | "block" | "review"
severity: str | None       # "none" | "info" | "low" | "medium" | "high" | "critical"

# Route provenance — non-None only on a route_to_human verdict.
route_reason: str | None   # open set, e.g. "compliance_concern" | "data_boundary_restricted"
                           # | "infra_degraded" — see /concepts/decisions#route-provenance
degraded: bool | None      # True only when the judge couldn't answer (fail-closed)

# Advisory caveat — non-None only on an include_with_caveats verdict.
caveat: str | None         # neutral, render-inline note; the turn proceeds

# Per-domain findings — read for per-domain detail.
# See /concepts/multi-verdict.
findings: list[Finding]    # [{domain, verdict, severity, enforcement, rule_ids,
                           #   risk_labels, evidence_span, sub_domain?, sub_findings?}]

# Correlation key — populated on every path (sync and streaming)
decision_id: str | None    # 32-hex key; quote it when reporting a decision

# Streaming-surface fields (populated on stream paths)
canonical_id: str | None   # same value as decision_id; None on sync calls

# Reserved text fields — the current judge doesn't populate them, so they are
# None. On a block, fall back to `reason` (the finding's evidence_span).
safe_message: str | None
explanation: str | None
rewrite: str | None
```

Per-domain `rule_ids`, `risk_labels`, and `evidence_span` live on each `findings[]` entry. Code that branches only on `verdict.decision` (or the top-level `verdict` + `severity`) is safe by construction — the merge guarantees an enforcing domain's restrictive verdict shows up at the top level.

A `safety` finding decomposes into a per-detector `sub_findings` list of `SubFinding` (exported from the package): `sub_domain` (`"injection"` | `"exfil"`), `verdict`, `severity`, `enforcement`, `rule_ids`, `evidence_span`. Read it to attribute a safety block to the exact guard that fired — non-decomposing domains (EEO, PII, …) leave `sub_findings` empty.

```python theme={null}
safety = verdict.findings_by_domain.get("safety")
if safety is not None:
    for sf in safety.sub_findings:
        print(sf.sub_domain, sf.rule_ids, sf.verdict, sf.enforcement)
```

### Consuming multi-verdict findings

`tenet-client` ships parsing helpers so you don't hand-roll the array walks:

| Helper | Returns | Notes |
| - | - | - |
| `response.findings_by_domain` | `dict[str, Finding]` | Indexed lookup — `findings_by_domain["eeo"]`. |
| `response.eeo_finding` | `Finding` | `findings[0]` — always present. |
| `response.enforcing_findings` | `list[Finding]` | Findings whose `enforcement == "enforce"` — what the merge actually used. |
| `response.audit_only_findings` | `list[Finding]` | Findings whose `enforcement == "audit_only"` — wire-visible, not gating. |
| `response.blocked_by_domain(name)` | `bool` | `True` if that domain's finding produced a restrictive (`exclude`, `route_to_human`, `defer`) verdict — handles the missing-domain case. |
| `response.evidence_for(name)` | `str \| None` | That domain's `evidence_span`. |

```python theme={null}
verdict = judge.evaluate(
    phase="tool_pre",
    tool_name="search_resumes",
    tool_input={"query": "find recent grads", "candidate_content": resume},
    surface="resume_triage",
)

if verdict.blocked_by_domain("eeo"):
    log_compliance_event(
        rule_ids=verdict.eeo_finding.rule_ids,
        evidence=verdict.evidence_for("eeo"),
    )

for f in verdict.audit_only_findings:
    metrics.increment(f"tenet.audit_only.{f.domain}.{f.verdict}")
```

An integration that branches only on `verdict.decision` is still safe by construction — the merge rule guarantees an enforcing domain's restrictive verdict shows up on the top level. The helpers are for the cases where you want per-domain audit logs, domain-specific UX, or visibility into audit-only signals. Full rules: [Multi-verdict responses](https://docs.tenetlabs.com/concepts/multi-verdict.md).

## Policy types

`JudgePolicy`, `JudgeVerdict`, `JudgeContext`, and `JudgeAction` are covered in depth in [Policies](https://docs.tenetlabs.com/guides/policies.md). Quick shape:

* `JudgeVerdict.decision` is the four-way `allow | caveat | review | block` (built from `CloudJudgeResponse` via `from_cloud_response` — the exact native-verdict mapping is in [How the Judge decides](https://docs.tenetlabs.com/concepts/decisions.md#verdicts)). `caveat` is the non-blocking advisory tier (`include_with_caveats`) — it dispatches to `on_caveat`, never `on_review`. `JudgeVerdict` also surfaces `route_reason`, `degraded`, and the advisory `caveat` string when present.
* `JudgeVerdict.findings` is the per-domain identifiers promoted to dicts: `[{"rule_id": "EEO-AGE-PROXY-01"}, ...]` — read the whole normalized list with `JudgeVerdict.finding_labels`, or extract per-entry with `f["rule_id"]`. Each `rule_id` is the per-finding **code** (what `RiskLabelDisplay` / topic mappers key on), falling back to the `risk_labels` phrase only when no code is present. `JudgeVerdict.severity` drops the operator-only `info` level to `None`.
* `JudgeAction` factories: `allow`, `block`, `tool_error`, `retry_nudge`, `retry_nudge_from_verdict`, `human_review` (a passthrough marker — the callback itself must pause the run), `override_input`, `override_output`, `raise_error`.
* `JudgePolicy(per_tool={...}, per_phase={...})` nests full policies; most specific wins.

## The user's ask: `user_prompt=` and `candidate_content=`

Without these, the only way to tell the judge what the user asked was to tuck it inside `tool_input` under a magic key. At a tool phase, pass what the user asked separately from the tool's arguments. The judge reads the ask from `user_prompt=`; the arguments stay in `tool_input`:

```python theme={null}
verdict = judge.evaluate(
    phase="tool_pre",
    tool_name="update_stage",
    tool_input={"candidate_id": "c-7", "stage": "rejected"},
    context={},
    user_prompt="Reject Pam",
)
```

`candidate_content=` is text written by the person the decision is about (never
the agent's reply, which is `agent_reply=`). Passing a different value than a
`recruiter_prompt` / `candidate_content` key inside `tool_input` raises
`ValueError`.

> [!NOTE]
>
> These arguments change what the judge reads, so they can change verdicts. Try them in a test environment and compare before you turn them on in production.

## Support correlation and degraded answers

Every response carries `decision_id`, and so does the `JudgeVerdict` your policy callbacks receive (`verdict.decision_id`, `verdict.canonical_id`; `None` when the engine sent none). Log `verdict.decision_id` from `on_block` / `on_review` and you have the id support asks for. Never show it to the end user.

When the engine cannot reason about the content (for example a tripped breaker answers `route_to_human`), the response says so with `degraded` or `route_reason == "infra_degraded"`. `resp.is_degraded` and `verdict.is_degraded` fold both into one check. Treat a degraded answer as "no answer", not as a finding about the content.

A timeout raises `JudgeTimeoutError`, a subclass of `JudgeUnavailableError`, so existing `except JudgeUnavailableError` blocks keep working. With `evaluate_phase` / `evaluate_phase_async` (and `@judged` given a `policy`), a timeout reaches `JudgePolicy.on_timeout` and every other judge failure reaches `on_unavailable`. If you never set `on_timeout`, timeouts go to `on_unavailable`, so failing open with only `on_unavailable=...` still covers timeouts. Set `on_timeout` only when timeouts need different behaviour.

`judge.workflow` and `judge.judge_id` expose the client's configuration read-only.

## Deadlines and outages

`timeout` bounds each HTTP operation (the token mint, the request, each stream
read), so one call can take about twice that or more. `deadline` bounds the
whole call in wall-clock seconds: set it on the client (`deadline=2.0`, or
`TENET_JUDGE_DEADLINE_SECONDS`) or per call (`judge.evaluate(..., deadline=1.0)`;
the per-call value wins). Exceeding it raises `JudgeTimeoutError`, so it reaches
`on_timeout`. On `evaluate_stream` the deadline runs from the first call to
exhaustion, but only the client's own waits are bounded: a consumer that is slow
between events is never cancelled, and the next read raises. Unset means no
deadline.

A `CircuitBreaker` makes a sustained outage cost one probe per cooldown instead
of a full timeout per call:

```python theme={null}
from tenet_client import CircuitBreaker, JudgeAction, JudgePolicy, TenetCloudJudgeClient

judge = TenetCloudJudgeClient(
    api_key="sk_tenet_...",
    deadline=2.0,
    breaker=CircuitBreaker(failure_threshold=3, cooldown_s=60.0),
)
policy = JudgePolicy(on_unavailable=lambda ctx, err: JudgeAction.allow())  # fail open
verdict, action = judge.evaluate_phase(policy=policy, phase="agent_input", tool_input="...")
```

After three consecutive failures the breaker opens and calls raise
`JudgeCircuitOpenError` (a `JudgeUnavailableError`, so `on_unavailable` handles
it) without touching the network. After the cooldown one call is let through as
a probe; its success closes the breaker, its failure reopens it. A timeout, a
5xx, a 408 or 429, or a network error counts as a failure, and so does a response with `is_degraded`, which is
still returned to you. A timeout from a per-call `deadline` shorter than the
client's own says nothing about the judge and is not counted. The breaker is
process-local; one instance can be shared by several clients to trip them
together.

An HTTP 4xx other than 408 and 429 (a malformed request, a rejected key) is a
bug on your side, not a sick judge, so it neither opens the breaker nor closes
it; a probe that ends that way frees the slot and the breaker stays open for the
next probe. `JudgeUnavailableError.status_code` carries the HTTP status when
there was one. If the stream's verdict already arrived, a deadline that expires
afterwards still raises `JudgeTimeoutError` but is not counted as a failure.

Calls that only observe (a shadow check next to enforcing calls on the same
client) pass `record_breaker=False`: they reach the network only while the
breaker is closed, are rejected with `JudgeCircuitOpenError` while it is open or
half-open (they never take the probe slot), and record neither a success nor a
failure, so a fault seen only by observers cannot fail a real call.

## Check a piece of text

`check()` judges one phase and returns a `JudgeOutcome` instead of raising. It
is for code that just needs "may I send this?":

```python theme={null}
from tenet_client import VerdictCache

cache = VerdictCache()  # share one so a resumed tool does not pay twice
out = client.check(
    phase="tool_pre",
    tool_name="send_email",
    tool_input={"body": draft},
    context={},
    session_id=thread_id,
    fail_mode="closed",     # or "open": an outage may proceed
    cache=cache,
)
if out.proceeds:            # allow, or unavailable under fail_mode="open"
    send(draft, note=out.caveat)
elif out.kind == "review":  # ask a human; out.reason and out.rule_ids say why
    ...
else:                       # "block", or "unavailable" while failing closed
    ...
```

Any judge failure (timeout, open breaker, HTTP error, anything unexpected)
becomes `kind="unavailable"`; a wrong argument still raises. If the engine
answers without judging (`out.degraded`), the default treats it as unavailable
so `fail_mode` applies. Pass `degraded_as="verdict"` to map the engine's
fallback verdict instead, usually `review`, which asks a human rather than
sending unreviewed (open) or refusing with no override (closed). Degraded and
unavailable outcomes are never cached. `check_async` is the async twin.

`check()` validates its arguments against `TenetCloudJudgeClient.evaluate_async` itself, so a wrong argument raises `ValueError` even when your client is wrapped, mocked or traced.

## Decide per finding

The merged top-level verdict can be driven by a domain you do not act on (a `pii`
finding on a hiring flow), and `audit_only` findings never gated anything.
`classify_findings` reads the individual findings instead and maps them onto
your own tier names:

```python theme={null}
from tenet_client import classify_findings

resp = client.evaluate(phase="agent_output", agent_reply=draft)
tier = classify_findings(
    resp,
    tiers={"retry": "medium", "fail": "high"},  # highest tier reached wins
    domains=["eeo"],                            # None counts every domain
)  # "fail", "retry", "accept", or "unavailable" for a degraded answer
```

An unknown severity string ranks above `critical` (and logs a warning), so a
vocabulary change in the engine lands in your strictest tier rather than passing.
`summarize_findings` returns the counted findings, the top one, its `rule_ids`
and `evidence_span`, and `at_least("high")`.

## Record every decision

A `DecisionRecord` is one normalized line per judge decision (decision, native
verdict, outcome, severity, `rule_ids`, `decision_id`, trace and session ids).
A sink is any `Callable[[DecisionRecord], None]`; a sink that raises is logged
and never reaches your call.

```python theme={null}
import logging
from tenet_client.observability import langfuse_score_sink, logging_sink

sinks = [
    logging_sink(logging.getLogger("app.judge")),   # event "tenet_judge_decision"
    langfuse_score_sink(langfuse),                  # categorical score on the record's trace
]
```

The Langfuse sink writes a `tenet_judge` score whose value is the outcome and
whose comment is the record as JSON. It needs only an object with
`create_score`, so Langfuse is not a dependency, and it skips records that have
no trace id.

Pass them to `check` as `on_decision=sinks`: one record per call that reached the
judge (a cache hit emits none).

## Testing your integration

`tenet_client.testing` gives you a real client over an in-memory transport: no
network, no credentials, the token handshake answered for you. Build bodies with
`decide_response` / `finding`, and test your own policy callbacks through
`evaluate_phase`:

```python theme={null}
from tenet_client import JudgeAction, JudgePolicy
from tenet_client.testing import decide_response, mock_judge_client

def test_review_is_held_and_logged():
    logged = []

    def on_review(ctx, verdict):
        logged.append(verdict.decision_id)
        return JudgeAction.tool_error("held for review")

    judge = mock_judge_client(
        decide_response("route_to_human", rule_ids=["EEO-AGE-01"], decision_id="d" * 32)
    )
    _, action = judge.evaluate_phase(
        policy=JudgePolicy(on_review=on_review), phase="agent_input", tool_input="..."
    )
    assert action.kind == "tool_error" and logged == ["d" * 32]
```

`responses` can also be a sequence (answered in order, the last repeats) or a
callable that receives each parsed request body. Other options: `captured=[]`
collects every request body, `status=503` and `raises=httpx.ReadTimeout("slow")`
simulate outages, `delay_s=` simulates a slow judge, and `use_stream=True` is
served as a verdict-first stream.

## @judged

```python theme={null}
judged(
    client,                      # TenetCloudJudgeClient
    tool_name=None,              # defaults to function __name__
    check_pre=True, check_post=True,
    fail_open=False,             # keep False for side-effectful functions
    policy=None,                 # JudgePolicy override
    input_builder=None,          # (args, kwargs) -> what the judge sees at tool_pre
    output_builder=None,         # (result) -> what the judge sees at tool_post
    metadata=None,
)
```

Wraps sync or async functions. Raises `JudgeBlocked` (`.reason`, `.tool_name`, `.phase`, `.judge_id`) on block.

`@judged` sends the **client's** `surface` on every call — there's no per-call override on this path. If your tools span action kinds (screening vs. drafting vs. outreach), gate them with `evaluate(surface=...)` at your dispatch loop instead — [the tool → surface map](https://docs.tenetlabs.com/concepts/surfaces.md#choosing-a-surface-from-a-chat-or-agent-product).

## Local-server exports

The package also ships `TenetClient`, its request and response models (`EvaluateRequest`, `DetectResponse`, `RedactResponse`, …), and `TenetConnectionError` / `TenetViolationError` — these talk to a **local Tenet server** (PII detect/redact), a separate product from the cloud judge. If you're integrating `judge.tenetlabs.com`, ignore them; `TenetCloudJudgeClient` is your client.

## Exceptions

| Exception | Raised when |
| - | - |
| `JudgeUnavailableError` | Timeout, 5xx, auth failure, token mint failure, malformed response. Fail-closed signal — handle it deliberately. |
| `JudgeTimeoutError` | A timeout or an exceeded `deadline`. Subclass of `JudgeUnavailableError`. |
| `JudgeCircuitOpenError` | The `CircuitBreaker` is open; no network call was made. Subclass of `JudgeUnavailableError`. |
| `JudgeBlocked` | `@judged` function blocked at `tool_pre` or `tool_post`. |

## Links

* [Framework-free guide](https://docs.tenetlabs.com/guides/framework-free.md)
* [Surfaces — choosing `surface` per call](https://docs.tenetlabs.com/concepts/surfaces)
* [Policies](https://docs.tenetlabs.com/guides/policies.md)
* [Streaming](https://docs.tenetlabs.com/guides/streaming.md)
* [`tenet-client` on PyPI](https://pypi.org/project/tenet-client/)


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