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
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: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:prior_user_turns, the judge sees each call cold — “ones who can start immediately” judged alone misses what it’s filtering.
Gotchas
@judgedjudges under the client’ssurface— 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 withsurface=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=Trueis 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
JudgeUnavailableErroron timeout. If you’d rather wait than fail, raisetimeout=— size it from thelatency_msyour traffic sees.
Links
- Surfaces — the tool → surface map
- Policies
- tenet-client reference
- API Reference — call the wire protocol directly