JudgePolicy maps verdicts to actions — you own what happens on allow, review, block, and failure. Defaults are fail-closed.
JudgePolicy: verdict → JudgeAction. The judge decides what the risk is; your policy decides what to do about it. The SDK ships safe defaults — block becomes a tool error, review proceeds with a tenet_review marker until you wire a HITL pause, unavailable raises — and every handler is overridable per tool and per phase.
Each handler receives a JudgeContext (phase, tool_name, tool_input, tool_output, session_id, metadata) and returns a JudgeAction.
Actions
Action
Effect
Reach for it when
JudgeAction.allow()
Proceed unchanged
—
JudgeAction.block(message=...)
Stop the call; surface message
Hard stops where the agent shouldn’t retry
JudgeAction.tool_error(message)
Tool returns an error the model can read
Default for blocks — the agent self-corrects
JudgeAction.retry_nudge(guidance)
Tool error + explicit guidance on how to reformulate
You want the agent to fix the call, not abandon it
JudgeAction.human_review()
Marks the action for HITL — passthrough, does not pause
Tagging only; for a real pause, your callback must suspend the run itself — see below
JudgeAction.override_input(payload)
Replace tool args, then run
Redaction: strip the violating field, keep the call
JudgeAction.override_output(payload)
Replace tool output
Sanitize retrieved content before it hits model context
JudgeAction.raise_error(err)
Propagate an exception
Fail-closed paths
retry_nudge is the action that makes guardrails feel like a collaborator instead of a wall: the model gets told what to change (“remove the age constraint and re-run the search”), retries, and usually succeeds. retry_nudge_from_verdict(verdict) builds the guidance from the judge’s own findings. The middleware escalates to a hard tool_error after 3 consecutive nudges (configurable) so a stubborn model can’t loop.
A production policy
# Python — a recruiting agent: nudge on block, pause on review,# fail open only for read-only tools.READ_ONLY = {"get_job_description", "lookup_candidate_status"}policy = JudgePolicy( on_block=lambda ctx, v: JudgeAction.retry_nudge_from_verdict(v), on_review=on_review_pause, # a real HITL pause — see "Human in the loop" below on_unavailable=lambda ctx, err: ( JudgeAction.allow(metadata={"judge_skipped": True}) # log it — don't lose the signal if ctx.tool_name in READ_ONLY else JudgeAction.raise_error(err) ), # send_email must never fail open, never nudge — block outright per_tool={ "send_email": JudgePolicy( on_block=lambda ctx, v: JudgeAction.block(message=v.safe_message or v.reason), on_unavailable=lambda ctx, err: JudgeAction.raise_error(err), ), },)
per_tool and per_phase are full nested policies — the most specific handler wins.
Fail open vs. fail closed
The tradeoff: fail-closed protects compliance at the cost of availability; fail-open inverts it. Don’t pick one globally — pick per tool:
Side effects (send, write, post): fail closed. A missed email is recoverable; a discriminatory one is not.
Read-only lookups: fail open is defensible — but tag the action’s metadata so skipped evaluations are visible in your logs, not silent.
Never fail open on agent_output if the response reaches an end user.
Human in the loop
A review verdict is a recommendation, not a pause. To actually stop and ask a human, your on_review callback suspends the run itself — in a LangGraph harness, with interrupt():
# Python — LangGraph HITL. interrupt() raises on the first pass and# returns on resume, so reaching the return means the human approved.from langgraph.types import interruptdef on_review_pause(ctx, verdict): interrupt({ "reason": verdict.reason, "risk_labels": [f.get("rule_id") for f in verdict.findings or []], "tool_name": ctx.tool_name, }) return JudgeAction.allow() # only reached after the human resumes
The middleware caches the verdict before dispatching your callback, so the interrupt() exception doesn’t lose it — on resume, the same verdict is reused instead of re-judging. Pair with turn_approval=True so one approval covers repeat hits in the same turn.
Two requirements for interrupt()-based review: your agent needs a checkpointer (resume requires persisted graph state — an in-memory checkpointer loses paused turns on restart, so don’t ship that to multi-worker production), and resume requests must carry the same thread_id as the paused turn.
The full wiring — rendering the review over SSE, reading the judge’s streamed context inside the callback, resume semantics — is in the HITL guide.
on_caveat
Reserved — the current judge doesn’t return a top-level include_with_caveats verdict or the caveat field. The default handler allows, and a caveat is never dispatched through on_review.
on_unresolved
With resolution_detection on (the middleware default), the judge classifies whether a tool’s output actually resolved the request. on_unresolved fires when it didn’t — the hook for “the search returned nothing because the only compliant interpretation was empty,” where you may want to inform the user rather than let the agent spin.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Tenet Labs","description":"Tenet Labs documentation — Tenet Guardrails (hosted guardrails for agent tool calls, served by the Judge API) and PII Engine (Enterprise), de-identification that runs in your own AWS account.","colors":{"primary":"#254BB0","light":"#7B9AEB","dark":"#1A3A8F"},"logo":{"light":"https://mintcdn.com/tenetlabs/Ux15lHnF6gElpQTR/logo/light.svg?fit=max\u0026auto=format\u0026n=Ux15lHnF6gElpQTR\u0026q=85\u0026s=ad2a07649adcf4d8be428b5187f69dd3","dark":"https://mintcdn.com/tenetlabs/Ux15lHnF6gElpQTR/logo/dark.svg?fit=max\u0026auto=format\u0026n=Ux15lHnF6gElpQTR\u0026q=85\u0026s=63483a7e8bc79fe2d8552c527fb1f187","href":"https://tenetlabs.com"},"favicon":"https://mintcdn.com/tenetlabs/f83ct0NG_FFBa-fQ/favicon.svg?fit=max\u0026auto=format\u0026n=f83ct0NG_FFBa-fQ\u0026q=85\u0026s=cb379042881580f3b646d44dc107ca17","navbar":{"links":[{"href":"mailto:team@tenetlabs.com","label":"Support"}],"primary":{"type":"button","label":"Get API keys","href":"https://platform.tenetlabs.com"}},"footer":{"socials":{"github":"https://github.com/tenetlabsdev"}},"fonts":{"heading":{"family":"DM Sans"},"body":{"family":"IBM Plex Sans"}},"contextual":{"options":["copy","view","chatgpt","claude","perplexity","mcp","add-mcp","cursor","vscode","windsurf"],"display":"header"},"styling":{"latex":false},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"tenetlabs","hasAudioNarration":false,"actualSubdomain":"tenetlabs","customDomains":["docs.tenetlabs.com"],"gitSource":{"type":"github","owner":"tenetlabsdev","repo":"docs","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":"","_id":"6b10eb819ffae5051c4157e3"},"feedback":{"agentFeedback":true},"entitlements":{"AI_CHAT":{"status":"DISABLED"}},"buildId":"6b0c81caf742bc3f276814f0","clientVersion":"0.0.4450","searchFilterCounts":[{"language":"default","tag":"Documentation","count":42},{"language":"default","tag":"PII Engine (Enterprise)","count":30},{"language":"default","tag":"Tenet Guardrails","count":29},{"language":"default","tag":"API Reference","count":16},{"language":"default","tag":"Concepts","count":10},{"language":"default","tag":"Getting Started","count":9},{"language":"default","tag":"Guides","count":7},{"language":"default","tag":"Operate","count":7},{"language":"default","tag":"Judge API","count":7},{"language":"default","tag":"PII Engine API","count":7}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":true,"enableContextualStarterQuestions":false,"enableAskAiSearchBar":true,"deflection":{"enabled":true,"email":"team@tenetlabs.com","showHelpButton":true}},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"starter-pricing","enabled":true,"variant":{"name":"treatment","enabled":true,"payload":{"type":"string","value":"treatment"},"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"auth-vite-origin","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"starterQuestions":[{"_id":"6a29da138cafb8a43c371463","deploymentId":"6a14c5b5c81d589b95bf2b49","questionText":"How do I add guardrails to my agent?","status":"active","generatedBy":"manual","createdAt":"2026-06-10T21:41:39.491Z","updatedAt":"2026-06-10T21:41:39.491Z","__v":0}],"googleFontsInlined":true},"customCss":[]}
{"page":{"pagePath":"guides/policies","slug":"/guides/policies","pageMetadata":{"title":"Policies","description":"JudgePolicy maps verdicts to actions — you own what happens on allow, review, block, and failure. Defaults are fail-closed.","href":"/guides/policies"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"JudgePolicy maps verdicts to actions — you own what happens on allow, review, block, and failure. Defaults are fail-closed.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,em:`em`,li:`li`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,Heading,Table,Warning}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Table)_missingMdxReference(`Table`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsxs(_components.p,{children:[_jsx(_components.strong,{children:_jsx(_components.code,{children:`JudgePolicy`})}),`: verdict → `,_jsx(_components.code,{children:`JudgeAction`}),`. The judge decides `,_jsx(_components.em,{children:`what the risk is`}),`; your policy decides `,_jsx(_components.em,{children:`what to do about it`}),`. The SDK ships safe defaults — block becomes a tool error, review proceeds with a `,_jsx(_components.code,{children:`tenet_review`}),` marker until you wire a `,_jsx(_components.a,{href:`/guides/hitl`,children:`HITL pause`}),`, unavailable raises — and every handler is overridable per tool and per phase.`]}),`\n`,_jsx(Heading,{level:`2`,id:`the-shape`,children:`The shape`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`11`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`11`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` tenet_client `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` JudgePolicy, JudgeAction`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`policy `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` JudgePolicy(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` on_allow`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:`...`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# (ctx, verdict) -> JudgeAction default: allow`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` on_caveat`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:`...`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# (ctx, verdict) -> JudgeAction default: allow + tenet_caveat marker — NON-BLOCKING advisory`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` on_review`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:`...`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# (ctx, verdict) -> JudgeAction default: allow + tenet_review marker — does NOT pause`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` on_block`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:`...`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# (ctx, verdict) -> JudgeAction default: tool_error(safe_message or a fixed message, plus reason)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` on_unresolved`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:`...`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# (ctx, verdict) -> JudgeAction default: retry_nudge_from_verdict`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` on_unavailable`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:`...`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# (ctx, error) -> JudgeAction default: raise_error (fail-closed)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` on_timeout`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:`...`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# (ctx, error) -> JudgeAction default: raise_error (fail-closed)`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`Each handler receives a `,_jsx(_components.code,{children:`JudgeContext`}),` (`,_jsx(_components.code,{children:`phase`}),`, `,_jsx(_components.code,{children:`tool_name`}),`, `,_jsx(_components.code,{children:`tool_input`}),`, `,_jsx(_components.code,{children:`tool_output`}),`, `,_jsx(_components.code,{children:`session_id`}),`, `,_jsx(_components.code,{children:`metadata`}),`) and returns a `,_jsx(_components.code,{children:`JudgeAction`}),`.`]}),`\n`,_jsx(Heading,{level:`2`,id:`actions`,children:`Actions`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Action`}),_jsx(_components.th,{children:`Effect`}),_jsx(_components.th,{children:`Reach for it when`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`JudgeAction.allow()`})}),_jsx(_components.td,{children:`Proceed unchanged`}),_jsx(_components.td,{children:`—`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`JudgeAction.block(message=...)`})}),_jsxs(_components.td,{children:[`Stop the call; surface `,_jsx(_components.code,{children:`message`})]}),_jsx(_components.td,{children:`Hard stops where the agent shouldn’t retry`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`JudgeAction.tool_error(message)`})}),_jsx(_components.td,{children:`Tool returns an error the model can read`}),_jsx(_components.td,{children:`Default for blocks — the agent self-corrects`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`JudgeAction.retry_nudge(guidance)`})}),_jsx(_components.td,{children:`Tool error + explicit guidance on how to reformulate`}),_jsx(_components.td,{children:`You want the agent to fix the call, not abandon it`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`JudgeAction.human_review()`})}),_jsxs(_components.td,{children:[`Marks the action for HITL — `,_jsx(_components.strong,{children:`passthrough, does not pause`})]}),_jsx(_components.td,{children:`Tagging only; for a real pause, your callback must suspend the run itself — see below`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`JudgeAction.override_input(payload)`})}),_jsx(_components.td,{children:`Replace tool args, then run`}),_jsx(_components.td,{children:`Redaction: strip the violating field, keep the call`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`JudgeAction.override_output(payload)`})}),_jsx(_components.td,{children:`Replace tool output`}),_jsx(_components.td,{children:`Sanitize retrieved content before it hits model context`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`JudgeAction.raise_error(err)`})}),_jsx(_components.td,{children:`Propagate an exception`}),_jsx(_components.td,{children:`Fail-closed paths`})]})]})]}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`retry_nudge`}),` is the action that makes guardrails feel like a collaborator instead of a wall: the model gets told `,_jsx(_components.em,{children:`what`}),` to change (“remove the age constraint and re-run the search”), retries, and usually succeeds. `,_jsx(_components.code,{children:`retry_nudge_from_verdict(verdict)`}),` builds the guidance from the judge’s own findings. The middleware escalates to a hard `,_jsx(_components.code,{children:`tool_error`}),` after 3 consecutive nudges (configurable) so a stubborn model can’t loop.`]}),`\n`,_jsx(Heading,{level:`2`,id:`a-production-policy`,children:`A production policy`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`20`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`20`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# Python — a recruiting agent: nudge on block, pause on review,`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# fail open only for read-only tools.`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:`READ_ONLY`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"get_job_description\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"lookup_candidate_status\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`policy `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` JudgePolicy(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` on_block`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`lambda`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` ctx`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`v`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: JudgeAction.retry_nudge_from_verdict(v),`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` on_review`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`on_review_pause, `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# a real HITL pause — see \"Human in the loop\" below`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` on_unavailable`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`lambda`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` ctx`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`err`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: (`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` JudgeAction.allow(`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`metadata`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"judge_skipped\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`True`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}) `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# log it — don't lose the signal`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` if`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ctx.tool_name `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`in`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:` READ_ONLY`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` else`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` JudgeAction.raise_error(err)`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ),`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` # send_email must never fail open, never nudge — block outright`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` per_tool`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"send_email\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: JudgePolicy(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` on_block`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`lambda`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` ctx`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`v`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: JudgeAction.block(`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`message`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`v.safe_message `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`or`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` v.reason),`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` on_unavailable`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`lambda`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` ctx`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`err`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: JudgeAction.raise_error(err),`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ),`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`per_tool`}),` and `,_jsx(_components.code,{children:`per_phase`}),` are full nested policies — the most specific handler wins.`]}),`\n`,_jsx(Heading,{level:`2`,id:`fail-open-vs-fail-closed`,children:`Fail open vs. fail closed`}),`\n`,_jsx(_components.p,{children:`The tradeoff: fail-closed protects compliance at the cost of availability; fail-open inverts it. Don’t pick one globally — pick per tool:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Side effects (send, write, post): fail closed.`}),` A missed email is recoverable; a discriminatory one is not.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Read-only lookups: fail open is defensible`}),` — but tag the action’s `,_jsx(_components.code,{children:`metadata`}),` so skipped evaluations are visible in your logs, not silent.`]}),`\n`,_jsxs(_components.li,{children:[_jsxs(_components.strong,{children:[`Never fail open on `,_jsx(_components.code,{children:`agent_output`})]}),` if the response reaches an end user.`]}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`human-in-the-loop`,children:`Human in the loop`}),`\n`,_jsxs(_components.p,{children:[`A `,_jsx(_components.code,{children:`review`}),` verdict is a recommendation, not a pause. To actually stop and ask a human, your `,_jsx(_components.code,{children:`on_review`}),` callback suspends the run itself — in a LangGraph harness, with `,_jsx(_components.code,{children:`interrupt()`}),`:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`11`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`11`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# Python — LangGraph HITL. interrupt() raises on the first pass and`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# returns on resume, so reaching the return means the human approved.`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` langgraph.types `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` interrupt`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`def`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` on_review_pause`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`ctx`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`verdict`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`):`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` interrupt({`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"reason\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: verdict.reason,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"risk_labels\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: [f.get(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"rule_id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`for`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` f `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`in`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` verdict.findings `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`or`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` []],`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"tool_name\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: ctx.tool_name,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` })`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` return`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` JudgeAction.allow() `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# only reached after the human resumes`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`The middleware caches the verdict `,_jsx(_components.em,{children:`before`}),` dispatching your callback, so the `,_jsx(_components.code,{children:`interrupt()`}),` exception doesn’t lose it — on resume, the same verdict is reused instead of re-judging. Pair with `,_jsx(_components.code,{children:`turn_approval=True`}),` so one approval covers repeat hits in the same turn.`]}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[`Two requirements for `,_jsx(_components.code,{children:`interrupt()`}),`-based review: your agent needs a `,_jsx(_components.strong,{children:`checkpointer`}),` (resume requires persisted graph state — an in-memory checkpointer loses paused turns on restart, so don’t ship that to multi-worker production), and resume requests must carry the `,_jsxs(_components.strong,{children:[`same `,_jsx(_components.code,{children:`thread_id`})]}),` as the paused turn.`]})}),`\n`,_jsxs(_components.p,{children:[`The full wiring — rendering the review over SSE, reading the judge’s streamed context inside the callback, resume semantics — is in the `,_jsx(_components.a,{href:`/guides/hitl`,children:`HITL guide`}),`.`]}),`\n`,_jsx(Heading,{level:`2`,id:`on_caveat`,children:_jsx(_components.code,{children:`on_caveat`})}),`\n`,_jsxs(_components.p,{children:[`Reserved — the current judge doesn’t return a top-level `,_jsx(_components.code,{children:`include_with_caveats`}),` verdict or the `,_jsx(_components.code,{children:`caveat`}),` field. The default handler allows, and a caveat is `,_jsx(_components.strong,{children:`never`}),` dispatched through `,_jsx(_components.code,{children:`on_review`}),`.`]}),`\n`,_jsx(Heading,{level:`2`,id:`on_unresolved`,children:_jsx(_components.code,{children:`on_unresolved`})}),`\n`,_jsxs(_components.p,{children:[`With `,_jsx(_components.code,{children:`resolution_detection`}),` on (the middleware default), the judge classifies whether a tool’s output actually resolved the request. `,_jsx(_components.code,{children:`on_unresolved`}),` fires when it didn’t — the hook for “the search returned nothing because the only compliant interpretation was empty,” where you may want to inform the user rather than let the agent spin.`]}),`\n`,_jsx(Heading,{level:`2`,id:`links`,children:`Links`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:_jsx(_components.a,{href:`/guides/langchain`,children:`LangChain middleware — wiring a policy in`})}),`\n`,_jsx(_components.li,{children:_jsxs(_components.a,{href:`/guides/framework-free`,children:[`Framework-free — `,_jsx(_components.code,{children:`evaluate_phase`}),` with a policy`]})}),`\n`,_jsx(_components.li,{children:_jsx(_components.a,{href:`/concepts/decisions`,children:`How the Judge decides — verdict vocabulary`})}),`\n`]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Policies","description":"JudgePolicy maps verdicts to actions — you own what happens on allow, review, block, and failure. Defaults are fail-closed.","href":"/guides/policies"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"The shape","slug":"the-shape","depth":2,"children":[]},{"title":"Actions","slug":"actions","depth":2,"children":[]},{"title":"A production policy","slug":"a-production-policy","depth":2,"children":[]},{"title":"Fail open vs. fail closed","slug":"fail-open-vs-fail-closed","depth":2,"children":[]},{"title":"Human in the loop","slug":"human-in-the-loop","depth":2,"children":[]},{"title":"on_caveat","slug":"on_caveat","depth":2,"children":[]},{"title":"on_unresolved","slug":"on_unresolved","depth":2,"children":[]},{"title":"Links","slug":"links","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"subdomain":"tenetlabs","siteName":"Tenet Labs","title":"Policies - Tenet Labs","contextualStarterQuestions":[],"navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-11-11T22:51:54.051Z","originalFileLocation":"guides/policies.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"JudgePolicy maps verdicts to actions — you own what happens on allow, review, block, and failure. Defaults are fail-closed.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Tenet Labs\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/tenetlabs/KiptfhnHYoT5u1IQ/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/tenetlabs/KiptfhnHYoT5u1IQ/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/tenetlabs/KiptfhnHYoT5u1IQ/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/tenetlabs/KiptfhnHYoT5u1IQ/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/tenetlabs/KiptfhnHYoT5u1IQ/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/tenetlabs/KiptfhnHYoT5u1IQ/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/tenetlabs/KiptfhnHYoT5u1IQ/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/tenetlabs/KiptfhnHYoT5u1IQ/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/tenetlabs/KiptfhnHYoT5u1IQ/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Policies - Tenet Labs\">\u003cmeta data-mint-head property=\"og:description\" content=\"JudgePolicy maps verdicts to actions — you own what happens on allow, review, block, and failure. Defaults are fail-closed.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Tenet Labs\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.tenetlabs.com/guides/policies\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://tenetlabs.mintlify.site/_mintlify/api/og/v2?division=Guides\u0026amp;title=Policies\u0026amp;description=JudgePolicy+maps+verdicts+to+actions+%E2%80%94+you+own+what+happens+on+allow%2C+review%2C+block%2C+and+failure.+Defaults+are+fail-closed.\u0026amp;theme=391546b21e00cc0a494931a4\u0026amp;signature=31db18ce1ae3fd7d1555ef72abc8bb13fc99bb38a2cd59e4b051aa9542bd6c49\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Policies - Tenet Labs\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"JudgePolicy maps verdicts to actions — you own what happens on allow, review, block, and failure. Defaults are fail-closed.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://tenetlabs.mintlify.site/_mintlify/api/og/v2?division=Guides\u0026amp;title=Policies\u0026amp;description=JudgePolicy+maps+verdicts+to+actions+%E2%80%94+you+own+what+happens+on+allow%2C+review%2C+block%2C+and+failure.+Defaults+are+fail-closed.\u0026amp;theme=391546b21e00cc0a494931a4\u0026amp;signature=31db18ce1ae3fd7d1555ef72abc8bb13fc99bb38a2cd59e4b051aa9542bd6c49\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/tenetlabs/KiptfhnHYoT5u1IQ/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Tenet Labs\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#254BB0\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.tenetlabs.com/guides/policies\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/guides/policies.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.tenetlabs.com/#organization\",\"name\":\"Tenet Labs\",\"url\":\"https://docs.tenetlabs.com\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/tenetlabs/Ux15lHnF6gElpQTR/logo/light.svg?fit=max\u0026auto=format\u0026n=Ux15lHnF6gElpQTR\u0026q=85\u0026s=ad2a07649adcf4d8be428b5187f69dd3\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.tenetlabs.com#website\",\"name\":\"Tenet Labs\",\"url\":\"https://docs.tenetlabs.com\",\"publisher\":{\"@id\":\"https://docs.tenetlabs.com/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.tenetlabs.com/guides/policies#webpage\",\"url\":\"https://docs.tenetlabs.com/guides/policies\",\"name\":\"Policies\",\"description\":\"JudgePolicy maps verdicts to actions — you own what happens on allow, review, block, and failure. Defaults are fail-closed.\",\"dateModified\":\"2026-11-11T22:51:54.051Z\",\"isPartOf\":{\"@id\":\"https://docs.tenetlabs.com#website\"},\"breadcrumb\":{\"@id\":\"https://docs.tenetlabs.com/guides/policies#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.tenetlabs.com/guides/policies#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Guides\",\"item\":\"https://docs.tenetlabs.com/guides/langchain\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Policies\",\"item\":\"https://docs.tenetlabs.com/guides/policies\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.tenetlabs.com/guides/policies#article\",\"headline\":\"Policies\",\"name\":\"Policies\",\"description\":\"JudgePolicy maps verdicts to actions — you own what happens on allow, review, block, and failure. Defaults are fail-closed.\",\"url\":\"https://docs.tenetlabs.com/guides/policies\",\"mainEntityOfPage\":{\"@id\":\"https://docs.tenetlabs.com/guides/policies#webpage\"},\"dateModified\":\"2026-11-11T22:51:54.051Z\",\"publisher\":{\"@id\":\"https://docs.tenetlabs.com/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.tenetlabs.com#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Tenet Labs\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"Tenet Labs\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/guides/policies.md","siteName":"Tenet Labs","nav":{"global":null,"products":[{"product":"Tenet Guardrails","icon":"gavel","description":"Guardrails for agent tool calls, decided by the Judge","tabs":[{"tab":"Documentation","groups":[{"group":"Getting Started","pages":[{"title":"Tenet Guardrails","href":""},{"title":"What is Tenet","href":"/what-is-tenet"},{"title":"Quickstart","href":"/quickstart"},{"title":"Authentication","href":"/authentication"},{"title":"Agent integration","href":"/agent-integration"}]},{"group":"Concepts","pages":[{"title":"Multi-verdict responses","href":"/concepts/multi-verdict"},{"title":"Read-intent \u0026 wire contract","href":"/concepts/read-intent"},{"title":"Surfaces","href":"/concepts/surfaces"},{"title":"Tool context","href":"/concepts/tool-context"},{"title":"How the Judge decides","href":"/concepts/decisions"},{"title":"Verdict Traces","href":"/concepts/traces"}]},{"group":"Guides","pages":[{"title":"LangChain middleware","description":"TenetJudgeMiddleware gates every tool call in a create_agent loop — one constructor argument, fail-closed defaults.","href":"/guides/langchain"},{"title":"Policies","href":"/guides/policies"},{"title":"Human-in-the-loop review","description":"Turn review verdicts into a real pause — interrupt the graph, render the review over SSE, resume on approval without re-judging.","href":"/guides/hitl"},{"title":"Severity and review rates","href":"/guides/tuning"},{"title":"Verdict-first streaming","href":"/guides/streaming"},{"title":"Voice guardrails","href":"/guides/voice"},{"title":"Framework-free integration","href":"/guides/framework-free"}]},{"group":"SDK Reference","pages":[{"title":"tenet-client","href":"/sdk/tenet-client"},{"title":"tenet-langchain","href":"/sdk/tenet-langchain"}]}]},{"tab":"API Reference","pages":[{"title":"API Reference","href":"/api-reference/introduction"}]},{"tab":"Changelog","pages":[{"title":"Changelog","href":"/changelog"}]}]},{"product":"PII Engine (Enterprise)","icon":"shield-halved","description":"De-identification that runs in your AWS account","pages":[{"title":"PII Engine (Enterprise)","href":"/pii-engine/overview"}]}]},"basePath":"","title":"Policies - Tenet Labs","deploymentId":"dpl_BEYRRXz1HkchnQ2yWX4JUQCbQT5Q","buildId":"dpl_BEYRRXz1HkchnQ2yWX4JUQCbQT5Q","dynamics":[],"chunks":[]}