Skip to main content
tenet-client standalone: pure Python + httpx + pydantic — no framework dependency. Two integration shapes: the @judged decorator for drop-in gating, and evaluate() / evaluate_phase() when you own the dispatch loop. If your harness is LangChain, use the middleware instead — it handles retry nudges, verdict caching, and session threading you’d otherwise rebuild.

@judged — gate a function

Options: tool_name (defaults to the function name), check_pre / check_post, fail_open (default False — keep it that way for side-effectful functions), policy, input_builder / output_builder to shape what the judge sees, and metadata.

Direct evaluation — you own the loop

If your harness already has a tool-dispatch choke point, call the judge there:
The dispatch loop is the natural place to set surface — the judge reads it to frame the ask, and the tool name already tells you which recruiting action this is. evaluate_async() is the same call shape for async harnesses. Both return a CloudJudgeResponse. For verdict → action mapping without writing branches, use evaluate_phase(policy=..., phase=...) — it returns (JudgeVerdict, JudgeAction) with your policy already applied.

Multi-turn context

A single tool call can look benign while the conversation isn’t. Send the session and prior turns:
Without prior_user_turns, the judge sees each call cold — “ones who can start immediately” judged alone misses what it’s filtering.

Gotchas

  • @judged judges under the client’s surface — there’s no per-call override on the decorator path. Fine when every decorated tool is the same action kind; for mixed toolsets (screening + drafting + outreach), use the dispatch-loop pattern above with surface= per call. See Surfaces.
  • One client per process. The client holds the access token cache and connection pool. Construct at startup, warmup(), reuse everywhere. close() / aclose() on shutdown.
  • fail_open=True is per-function, deliberate, and logged — never the default. A guardrail that silently disappears under load isn’t a guardrail.
  • Timeout is 3.0s by default. A judge call can exceed it; the SDK raises JudgeUnavailableError on timeout. If you’d rather wait than fail, raise timeout= — size it from the latency_ms your traffic sees.