API reference
Base URL: https://api.inpolicy.ai/api/v1/agent
Authentication: Authorization: Bearer inp_live_… on every request.
Rate limit: 120 req/min per key by default; configurable per key up to 1,200. Calls made with a signed-in user token (OAuth / MCP) are limited to 120 req/min per user. Separately, requests from one source IP to the governance routes are capped at 3,600 req/min, counted across all those routes and before the key is checked, so the cap also applies to requests with a bad key.
All Agent Governance endpoints are mounted under /api/v1/agent. The tenant is resolved from the API key. You never pass a tenant id in a request body.
Response format
Section titled “Response format”Every successful response is wrapped in an envelope; the shapes on this page are what’s inside data:
{ "success": true, "data": { "decision": "allow", "safe": true, "...": "..." } }The TypeScript SDK unwraps it for you. If you call the API directly (Python, curl, a generated client), read response.data.
Every governance POST returns 200. DELETE /conversation/:sessionId returns 204.
Errors are not wrapped. They look like:
{ "statusCode": 403, "timestamp": "2026-11-04T18:22:01.120Z", "path": "/api/v1/agent/governance/post-inference", "method": "POST", "message": "post_inference_checking is disabled for this API key. Enable it in the dashboard.", "error": "Forbidden", "correlationId": "…", "trace_id": "…"}error is the HTTP reason phrase (Bad Request, Payment Required, Bad Gateway, …). code is present only on errors that set one, such as TENANT_TOKEN_BUDGET_EXCEEDED on a 402 and RATE_LIMIT_EXCEEDED on a 429. A 400 lists every problem with the request in message; a nested field is named by its path, for example messages.0.content is required. Quote trace_id when you contact support.
Errors
Section titled “Errors”| Status | Meaning |
|---|---|
400 |
Bad request (validation error). message says what to fix. See Request limits. |
401 |
Missing / invalid / revoked API key. |
402 |
The workspace has used its monthly detection budget, so the message was not checked. The body carries code: "TENANT_TOKEN_BUDGET_EXCEEDED" and budget: { capCents, usedCents, periodEnd }. Checks resume at budget.periodEnd; contact InPolicy to raise the limit. Lookups (pre-inference, turns without checkOutput, conversation state) keep working. |
403 |
The key lacks the scope the route needs (API key missing required scope: governance:check, also for a conversation/turn with checkOutput: true), or a feature gate is disabled on the key. Retrying will not help. |
404 |
Resource not found (e.g. unknown sessionId on GET /conversation). |
409 |
On conversation/turn: the idempotencyKey was already used for a different request in this session, or another turn for the same session is still being saved (retry it). DELETE /conversation can also get the second while a turn is being saved. |
429 |
Rate limit exceeded. Wait the number of seconds in Retry-After. The body carries code: "RATE_LIMIT_EXCEEDED" and retryAfterSeconds; a 429 from the key’s or user’s limit also carries limit and windowSeconds, and one from the per-IP cap does not. |
5xx |
Upstream error. GET and DELETE are safe to retry with exponential backoff. A check that returned 5xx may already have run, so re-sending it checks (and counts) the message again. To retry a conversation/turn, wait for the first call to finish or fail, then re-send it with the same idempotencyKey. |
Every response the rate limiter counts carries X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset (seconds until the per-minute window resets; on a 429 it equals Retry-After). On an authenticated response they describe your key’s (or signed-in user’s) limit. On a response refused before the per-key limiter runs (a 401, or a 403 for a missing scope), they describe the per-IP cap. A 429 from the per-IP cap carries only Retry-After, with retryAfterSeconds in the body.
Request limits
Section titled “Request limits”A request that breaks one of these gets a 400, and nothing is checked or charged:
| Field | Rule |
|---|---|
sessionId (body and path) |
Letters, digits and . _ : @ + = -, 1 to 200 characters. /, #, ?, %, spaces and other characters are refused, on every route (on post-inference too, where sessionId is optional). Hash or base64url-encode an id that has them. Message: sessionId may use only letters, digits and . _ : @ + = - (1 to 200 characters). |
output, fullText, turn.content, prompt (pre-inference) |
A JSON string (a number, object, array or boolean gets <field> must be text), at most 100,000 characters, and not empty or only whitespace. Split longer text into separate checks. |
policyAreaIds |
Optional. If sent, a list of 1 to 50 ids of policy areas in your workspace. Omit it to check against every policy area; an empty list is refused, and unknown ids are named in the error. An area that exists but has no published policies is accepted and checks against nothing (allow, checked: true). |
recentMessages (pre-inference) |
At most 50 strings of up to 20,000 characters each. |
recentContext, priorHistory |
At most 100 strings of up to 50,000 characters each. |
isFinal, checkOutput, isUpdate |
JSON booleans. A string such as "false", or 0 / 1, is refused. |
lastCheckedOffset |
A whole number, 0 or more. On check-output/stream it must not be greater than the length of fullText counted in Unicode code points (in JavaScript, fullText.length is too large for text with emoji: send the watermark the last call returned). finalize checks the whole text and does not use it. |
country |
An ISO 3166-1 alpha-2 code such as "GB". |
channel |
A short name such as support_chat: it starts with a lower-case letter, then lower-case letters, digits, _ or -, at most 40 characters. |
replyId (streaming) |
Same rule as sessionId: letters, digits and . _ : @ + = -, 1 to 200 characters. Use a new one for every reply. |
idempotencyKey |
Same rule as sessionId: letters, digits and . _ : @ + = -, 1 to 200 characters. |
toolName |
A JSON string (a number, object, array or boolean is refused), 1 to 200 characters. |
Field names (e.g. keys in tool-call arguments or endUserContext.attributes) |
Well-formed text: a name containing an unpaired UTF-16 surrogate is refused. In a value, one is replaced with U+FFFD and the request is checked. |
Every call that reaches the governance API is recorded for your workspace’s usage, without any message content: the endpoint, the number of characters checked, the outcome (clean, flagged, blocked or unchecked), the number of violations and the model cost. Calls refused before that are not recorded and do not use the key’s rate-limit quota (every request, these included, counts toward the per-IP cap): a missing, invalid or revoked key (401), a key without the scope the route needs (403, including a conversation/turn with checkOutput: true from a key without governance:check), and rate-limited calls (429). Other refused calls are recorded as failed calls and count toward the key’s rate limit, for example a 400, or a 403 because post_inference_checking or tool_call_governance is disabled on the key.
A message checked is one call to post-inference, check-output/finalize, check-tool-call, or conversation/turn with checkOutput: true. A streamed reply counts once: at finalize, or, if you don’t call finalize, at the check-output/stream call marked isFinal: true, whichever comes first for the same reply. A reply is identified by its replyId (the SDK sends a new one for every reply); without a replyId, the same fullText in the same session within an hour is one reply. Send the same replyId on the isFinal chunk and on finalize: if one carries a replyId and the other does not, they count as two messages. Send one or the other (sending both checks the tail twice, but the reply still counts once). The counted row records the whole reply’s length, in Unicode code points (post-inference and conversation/turn rows count UTF-16 code units), and every violation its chunks found. Its other check-output/stream chunks are recorded but are not counted as messages. A conversation/turn replayed from its idempotencyKey is recorded with no cost and counts nothing. Checks that did not run, failed calls and lookups are not counted as messages.
Workspace admins see the month’s usage on Settings → API keys (by key, with signed-in MCP users as one row) and can download it as a CSV, one row per day and key. Analytics → API shows, per key: policy lookups (pre-inference, and conversation/turn without checkOutput; not counted as messages), output checks and tool-call checks, with how many were warned, blocked or not checked.
Checks that did not run
Section titled “Checks that did not run”post-inference, check-output/stream, check-output/finalize, check-tool-call and conversation/turn with checkOutput: true return 200 even when the check itself could not run, for example because detection timed out or the model was unavailable. Every one of those responses carries:
| Field | Meaning |
|---|---|
checked |
false when the check did not run. An unchecked result has no violations and is not a clean result. |
uncheckedReason |
"timeout", "unavailable" or "error" when checked is false; otherwise null. |
When checked is false, decision, safe (and allow on check-tool-call) follow the key’s on_check_error setting: "allow" (the default) returns decision: "allow" and safe: true so the message keeps moving, and "block" returns decision: "block" and safe: false. So decision: "allow" with checked: false does not mean the message is clean: read checked before you act on decision, and log unchecked results on your side either way. On check-output/stream an unchecked segment has decision: null (on an isFinal chunk, block if an earlier chunk of the reply already blocked) and leaves watermark where it was, so the next call or finalize checks that text again.
POST /api/v1/agent/governance/conversation/turn
Section titled “POST /api/v1/agent/governance/conversation/turn”The primary surface. Record one turn in a conversation and get the updated policy state.
Request
{ "sessionId": "sess_abc", "turn": { "role": "user", "content": "I'm 16 — can I buy this?" }, "recentContext": ["prior turn content"], "priorHistory": null, "endUserContext": { "attributes": { "customer_tier": "basic", "region": "EU" } }, "tokenBudget": 600, "idempotencyKey": "turn-7a9c-...", "checkOutput": false, "ttlSeconds": null}| Field | Required | Description |
|---|---|---|
sessionId |
✅ | Stable caller-chosen conversation id (letters, digits and . _ : @ + = -, 1 to 200 characters). |
turn.role |
✅ | user | assistant | tool. system is rejected. |
turn.content |
✅ | The turn’s text content, at most 100,000 characters. |
recentContext |
— | Last 2–3 prior turns for disambiguation. Not stored. |
priorHistory |
— | Bootstrap history; only used on the first call per session. |
endUserContext.attributes |
— | Sending endUserContext satisfies a key’s subjectBinding: "required". To scope policies, use country and the key’s teams. Processed for the request only; not written to persistent storage. |
policyAreaIds |
— | Scope retrieval to specific policy areas of your workspace (1 to 50 ids, such as cmw5eqsyv000jcam0633nmink; list them with GET /api/v1/agent/policy-areas, scope policy_areas:read). Omit it for every area. An area with no published policies checks against nothing: the result is allow with checked: true, and it counts as a message. |
tokenBudget |
— | Approx tokens for injectionBlock. Default 600. Range [50, 4000]. |
idempotencyKey |
— | Re-sending the same request with the same key within 5 min returns the same response without checking or counting it again. The same key with a different request in this session returns 409. Every field must match for a replay: turn, checkOutput, messages, channel, authorType, authorRole, audience, recentContext, country, teams, policyAreaIds (in any order), ttlSeconds, tokenBudget, priorHistory and endUserContext. Keys belong to their session. Same characters as sessionId, 1 to 200. |
checkOutput |
— | true runs an output check on the turn. Only valid when turn.role === "assistant". Needs the governance:check scope and post_inference_checking: "allowed" on the key. |
ttlSeconds |
— | How long this conversation lasts without a turn, in seconds, range [300, 604800]. It sticks: later turns that omit it keep it, and a later value replaces it. Without it, the key’s conversation_ttl_seconds applies, else 4 hours. Every turn restarts the clock, and there is no limit on a conversation’s total length. |
Turns on one session are applied one at a time, each with its own increasing turnIndex. A turn that waits more than 5 seconds for another turn on the same session gets 409 with another turn for this session is in progress; retry it.
Response (200)
{ "sessionId": "sess_abc", "turnIndex": 3, "diff": { "newlyApplicable": [ /* ApplicablePolicy[] */ ], "newlyReleased": [], "stillActive": [ /* ApplicablePolicy[] */ ], "bindingEvents": [ { "turnIndex": 3, "policyId": "pol_123", "event": "binding_started", "ts": "2026-04-24T12:00:00Z" } ] }, "activePolicies": [ /* ApplicablePolicy[] */ ], "injectionBlock": "## Applicable Company Policies\n\nFollow these policies when responding:\n- [Refund approvals] (ENFORCED, severity 4.0): Do not promise or confirm a refund until it has been approved.\n", "tokenEstimate": 184, "postInferenceCheck": null, "traceId": null}ApplicablePolicy:
{ "id": "pol_123", "title": "No customer PII in external AI tools", "summary": "Mask customer emails, names and account IDs in AI tools.", "text": "Mask customer emails, names and account IDs in AI tools. This applies to any external AI assistant.", "severity": 4, "enforcement": "fix" | "warning" | "audit" | null, "tier": "enforced_humans_and_agents" | "enforced_agents_only" | "documentation_only" | "not_yet_enforced" | null, "citationRef": "Policy 4.2", "tags": ["pii"]}text is the full rule (capped at 2,000 characters); summary is its first sentence. See Injection block.
enforcement is a legacy signal and is null for policies authored after tier replaced it. tier is the replacement signal — prefer it when present.
Latency: p50 ~100 ms, p95 ~500 ms regardless of input size (pre-inference is bounded by top-K retrieval, not prompt length). See Latency expectations.
GET /api/v1/agent/governance/conversation/:sessionId
Section titled “GET /api/v1/agent/governance/conversation/:sessionId”Read-only snapshot of conversation state. No mutation, no TTL reset.
Response (200)
{ "sessionId": "sess_abc", "turnCount": 7, "activePolicies": [ /* ApplicablePolicy[] */ ], "injectionBlock": "...", "bindingLog": [ /* BindingEvent[] */ ], "updatedAt": "2026-04-24T12:00:00Z"}Returns 404 if the session has expired (no turn for its TTL) or never existed.
DELETE /api/v1/agent/governance/conversation/:sessionId
Section titled “DELETE /api/v1/agent/governance/conversation/:sessionId”End a conversation and delete its conversation state, including the responses held for its idempotencyKeys, so a conversation restarted on the same sessionId starts fresh. Returns 204 whether or not the conversation existed (never 404), so calling it twice is safe. While a turn for the same session is being saved it can return 409 with another turn for this session is in progress; retry it.
POST /api/v1/agent/governance/check-tool-call
Section titled “POST /api/v1/agent/governance/check-tool-call”Gate a proposed agent tool call. Requires tool_call_governance: "allowed" on the API key; returns 403 otherwise.
The tool name and arguments are checked against your workspace’s policies, scoped by the key’s teams and the request’s country, the same way an output is. policyAreaIds is not supported here and is ignored. The conversation’s state is not consulted: sessionId is required but need not match a conversation you recorded, and an unknown or ended session is still checked. intent (proposed, the default, or executed) is accepted but does not change the result yet.
Request
{ "sessionId": "sess_abc", "toolName": "send_email", "arguments": { "to": "competitor@acme.com", "subject": "Q3 roadmap" }, "intent": "proposed"}Response (200)
{ "allow": false, "riskScore": 0.91, "violations": [ { "policyId": "pol_conf_01", "policyTitle": "No roadmap details to competitors", "matchedText": "competitor@acme.com", "explanation": "Recipient domain matches listed competitor.", "severity": 4, "confidence": 0.95, "enforcementType": "warning" } ], "suggestedArguments": null, "checked": true, "uncheckedReason": null, "traceId": null}policyTitle is null when the policy has no title. allow: false happens when at least one violation has confidence ≥ 0.7 AND severity ≥ 4, and its policy is not deliberately exempted from agents (a DOCUMENTATION_ONLY or NOT_YET_ENFORCED tier with a recorded rationale). Any other violation returns allow: true with the violations surfaced for audit. If the check did not run, see Checks that did not run: with on_check_error: "block" that is allow: false with checked: false and no violations, so check checked before you read violations[0].
POST /api/v1/agent/governance/pre-inference
Section titled “POST /api/v1/agent/governance/pre-inference”Legacy single-shot surface. Returns applicable policies + injection block for one prompt.
Prefer POST /conversation/turn for multi-turn agents. Same shape plus incremental diff.
Request
{ "sessionId": "sess_abc", "prompt": "Draft a reply to our Acme account exec", "recentMessages": [], "context": { "surface": "email" }, "endUserContext": null, "policyAreaIds": null, "tokenBudget": 600, "isUpdate": false}Response (200)
{ "sessionId": "sess_abc", "cacheHit": false, "applicablePolicies": [ /* ApplicablePolicy[] */ ], "injectionBlock": "## Applicable Company Policies\n\nFollow these policies when responding:\n- [Refund approvals] (ENFORCED, severity 4.0): Do not promise or confirm a refund until it has been approved.\n", "rationaleRequired": false, "tokenEstimate": 184, "traceId": null}Despite the “same shape” framing above, this is not identical to conversation/turn’s response: the policy list here is applicablePolicies, not activePolicies, there’s no diff or turnIndex field, and two fields appear that conversation/turn doesn’t return — cacheHit (whether policy retrieval for this sessionId, text and scope, including policyAreaIds, was served from cache) and rationaleRequired (whether the caller must supply a rationale before proceeding, per the API key’s settings).
POST /api/v1/agent/governance/post-inference
Section titled “POST /api/v1/agent/governance/post-inference”Check a model output for policy violations. Requires post_inference_checking: "allowed" on the API key.
Request
{ "output": "Sure, here's the refund for John Smith (john@acme.com)...", "sessionId": "sess_abc", "messages": [ { "role": "customer", "content": "Can I get a refund for order 1182?" } ], "channel": "support_chat", "authorType": "ai_agent", "authorRole": "Customer support agent", "audience": "external", "policyAreaIds": null, "traceId": "trc_from_pre_inference"}The conversation fields are optional. Message text is never stored; when a check finds something, the finding records the channel and author type next to the policy (see Privacy). Send them whenever you have them: without them a reply is judged on its own, with no question to answer and no audience.
| Field | Meaning |
|---|---|
messages |
Earlier messages, oldest first (max 50). role is customer (the outside party the reply goes to), agent (your side, human or AI) or internal (a colleague). |
channel |
Where the text is sent, as a short name: support_chat, sms, email (starts with a lower-case letter, then lower-case letters, digits, _ or -, at most 40). Never a person or address. |
authorType |
human or ai_agent. |
authorRole |
The author’s role, e.g. Customer support agent. |
audience |
external (goes to a customer) or internal (colleagues only; rules that apply only to outside audiences are skipped). |
prompt |
Legacy: the message the output answers, used when messages is not sent. |
The same fields are accepted on check-output/stream, check-output/finalize and conversation/turn (with checkOutput: true; there recentContext is used when messages is not sent).
Response (200)
{ "decision": "block", "safe": false, "riskScore": 0.72, "violations": [ { "policyId": "pol_pii_01", "policyTitle": "Mask customer personal data", "matchedText": "for John Smith (john@acme.com)", "explanation": "Names the customer and gives their email address in a support reply.", "severity": 4, "confidence": 0.88, "enforcementType": "fix", "enforcementText": "for your order" } ], "suggestedRedaction": "Sure, here's the refund for your order...", "policyCitations": ["pol_pii_01"], "checked": true, "uncheckedReason": null, "traceId": "trc_..."}Act on decision:
decision |
When | What to do |
|---|---|---|
block |
A finding with confidence ≥ 0.7 and severity ≥ 4 whose policy is not deliberately exempted from agents. |
Don’t send. Send suggestedRedaction if it is not null; otherwise regenerate with the explanations as guidance, or route to a person. |
warn |
Findings with confidence ≥ 0.7 that don’t block. |
Send, or show the author the finding first. |
allow |
No finding clears the confidence bar. | Send. |
A violation’s enforcementType is fix or warning (never audit). It says what InPolicy offers for the finding, not the policy’s own setting:
fix:enforcementTextis a compliant rewrite ofmatchedText(or of the sentence it sits in), ready to use.warning: advice only.enforcementTextexplains what to change; there is no rewrite.
suggestedRedaction is the whole output with every finding’s rewrite put in place, and it is safe to send as is. It is null unless every finding that clears the confidence bar is a fix whose rewrite applies cleanly: at every copy of its matchedText, without repeating the surrounding words, and leaving no flagged text (nor a name or address inside it) anywhere in the result. So one warning finding, for example personal data flagged as a warning, makes it null. It is also null when a rewrite of a phrase is more than two words longer than the phrase, or has more [placeholders] than the phrase has names, addresses, numbers and other identifying parts (it was written for more than the flagged words); when a copy of matchedText sits inside a longer word; and when the flagged text appears again with different spacing, such as a line break inside a name. When it is null, regenerate or route to a person. A rewrite written for the whole sentence replaces the words it repeats around matchedText.
When checked is false, decision is the key’s on_check_error setting, not a verdict on the text (see Checks that did not run).
safe is the older verdict: false when any finding clears the confidence bar, whatever its severity. It is kept for existing integrations; new ones should use decision.
POST /api/v1/agent/governance/check-output/stream
Section titled “POST /api/v1/agent/governance/check-output/stream”Incremental check on accumulated output as the LLM streams. Requires post_inference_checking: "allowed" on the API key. Caller posts repeatedly with the full text so far; the server detects on the new portion plus a small overlap. See Streaming output checks for the full walkthrough.
Request
{ "sessionId": "sess_abc", "fullText": "Sure, here is the refund for John Smith (john@acme.com). It should reach your card within five working days.", "lastCheckedOffset": 0, "isFinal": false, "replyId": "msg_8812"}replyId (optional) names the reply: send the same one on every chunk of a reply and on its finalize, and a new one for every reply. Two replies in one session with different replyIds are separate messages even when their text is the same, and a new replyId starts with nothing found. A replyId used again is the same reply: it is counted once, and it keeps what the earlier reply found, its decision included. Without a replyId, start every reply at lastCheckedOffset: 0: a chunk at offset 0 starts a new reply.
Response (200)
{ "sessionId": "sess_abc", "newViolations": [ { "policyId": "policy_pii", "matchedText": "John Smith (john@acme.com)", "explanation": "Names the customer and gives their email address in a support reply.", "severity": 4.5, "confidence": 0.92, "enforcementType": "fix", "enforcementText": "the account holder", "offset": 29 } ], "watermark": 108, "isComplete": false, "riskScore": 0.92, "decision": "block", "checked": true, "uncheckedReason": null, "traceId": "trc_…"}Pass watermark back as lastCheckedOffset on the next call. A lastCheckedOffset greater than the length of fullText gets a 400 and nothing is checked (finalize does not use the offset, so it never gets this 400). The offset is trusted only as far as the reply’s record shows was checked. An offset past the highest watermark this reply’s checked chunks returned is checked from that watermark. A reply with nothing on record, or whose text before that watermark is not the text that was checked (for example a second reply in a session without a replyId that opens at an offset above 0), is checked from 0. Sending back the watermark you were given is never affected. offset and watermark count Unicode code points, not UTF-16 code units: in JavaScript, text with emoji or other characters outside the Basic Multilingual Plane needs converting (the SDK does it for you).
Each violation is reported once per reply: a span found again on a later chunk is not repeated for the same policy, and offset points at the occurrence in the newly checked text. Two copies of the same phrase found by one check are both reported, each with its own offset. A chunk re-sent after it was checked (a retry after a timeout, for example) does not report its violations again; the isFinal chunk’s decision still counts them, and finalize returns every violation in the reply.
On an incremental chunk, decision (allow / warn / block) and riskScore are for that segment’s new violations, and decision is null when the segment was deferred or not checked. An incremental chunk with fewer than 80 new characters is deferred: it returns no violations, decision: null and the watermark unchanged, and the next call checks that text. Close the reply with finalize, or with a last chunk marked isFinal: true, which checks any tail below the chunk threshold (even when nothing new is left) and counts the reply. On the isFinal chunk, decision is for the whole reply, the worst of every chunk (for example warn when an earlier chunk warned and the tail is clean), and riskScore is the highest of the reply’s checked chunks; newViolations still lists only the tail’s new ones. A retried isFinal chunk returns the same decision. If the isFinal chunk was not checked, decision is null (apply your on_check_error), unless an earlier chunk already blocked: then it is block with checked: false. With a replyId, re-sending a chunk at lastCheckedOffset: 0 keeps what the reply already found. Start each new reply at lastCheckedOffset: 0, with a new replyId if you send one.
POST /api/v1/agent/governance/check-output/finalize
Section titled “POST /api/v1/agent/governance/check-output/finalize”End-of-stream verdict for the full output — same response shape as POST /post-inference. Requires post_inference_checking: "allowed" on the API key.
Request — same shape as check-output/stream, with isFinal: true. Send the same replyId as the reply’s chunks so it counts once; a finalize without the replyId its chunks carried (or with one they did not) counts as a second message.
Response (200) — same shape as POST /post-inference above (safe, riskScore, violations, suggestedRedaction, policyCitations, checked, uncheckedReason, traceId).
API key scopes
Section titled “API key scopes”A new key gets governance:read, governance:check, policies:read, policies:ack and feedback:write. Management scopes are opt-in.
| Scope | Grants |
|---|---|
governance:read |
conversation/turn, pre-inference, conversation state GET/DELETE. A turn with checkOutput: true also needs governance:check. |
governance:check |
post-inference, check-output/stream, check-output/finalize, check-tool-call |
policies:read |
List and read policies (GET /agent/policies) |
policies:write |
Create and update policies, bulk upsert |
policies:publish |
Publish policies |
policies:delete |
Delete policies |
divisions:read / divisions:write |
Read / manage divisions |
policy_areas:read / policy_areas:write |
Read / manage policy areas |
documents:write |
Upload policy documents |
webhooks:write |
Register and manage webhooks |
policies:ack |
Reserved: recording policy acknowledgements |
feedback:write |
Reserved: feedback on findings |
A key without a scope the route needs gets 403 with API key missing required scope: <scope>.
A key with subjectBinding: "required" must send endUserContext on pre-inference and conversation/turn; requests without it get 400.
API key settings (feature gates)
Section titled “API key settings (feature gates)”Set via the InPolicy dashboard on the API key. A new key starts with both checks allowed (on by default) and on_check_error: "allow". Keys created before this default keep their stored settings.
| Setting | Values | Effect |
|---|---|---|
post_inference_checking |
"disabled" | "allowed" |
post-inference, both streaming routes and checkOutput: true on conversation/turn. Set "disabled" to turn them off; they then return 403. |
tool_call_governance |
"disabled" | "allowed" |
check-tool-call. Set "disabled" to turn it off; it then returns 403. |
on_check_error |
"allow" | "block" |
What safe / allow say when a check did not run. See Checks that did not run. |
conversation_ttl_seconds |
number | null |
TTL for this key’s conversations when a turn sends no ttlSeconds. Default 4h. Range [300, 604800]. |
Acts as team. On the key’s settings in the dashboard (or teamIds when creating or updating a key) you can choose teams for the key to act as. Its checks then use those teams’ team-scoped policies plus the policies that apply to everyone, the same set a person on those teams gets in the browser extension. Choose none and every active policy applies. A signed-in user calling the API through OAuth / MCP is scoped by their own teams.
Country. Policies can be scoped to countries. With an API key, send country with each request: an ISO 3166-1 alpha-2 code such as "GB", usually where the end user you are serving is. Country-scoped policies then apply only when country is one of their countries, and policies with no countries always apply. Omit it and no country filter is applied, so every country-scoped policy applies. country is accepted on pre-inference, post-inference, conversation/turn, check-tool-call and both streaming routes. A signed-in user calling through OAuth / MCP is scoped by the country on their profile, as in the browser extension, and a country they send is ignored (it must still be a valid code). A code that is not ISO 3166-1 alpha-2 (for example "UK") is rejected with 400.
Cookie PreferencesDo Not Sell or Share My Personal Information