Govern documentation
Five quick sections to get you running in 10 minutes.
Quickstart
1. Sign in at govern.inversify.live → an org is auto-created.
2. Generate an API key on the API Keys page (`inv_govern_...`).
3. POST to `/api/v1/evaluate` with a framework key, or build a graph and POST to `/api/v1/route/{id}/evaluate`.Route concepts
A Route is a directed graph of nodes. Trigger → (any of: Redact, Classify, Judge, Decide, Webhook) → End. The engine walks the graph, threading a working envelope (text, scores, decision) between nodes. Decide nodes set the final decision based on configurable allow/warn thresholds.
Frameworks
Govern ships with 5 preset frameworks (read-only): NIST_AI_RMF, EU_AI_ACT, OWASP_LLM_TOP_10, ANTHROPIC_AUP, ISO_42001. Each framework is a list of controls. A control has an `id`, `name`, an LLM `prompt`, and a `weight`. Custom frameworks (Pro+) let you add your own.
API reference
Auth: `Authorization: Bearer inv_govern_...`
Rate limit: 200 req/min/key (configurable per plan).
POST /api/v1/evaluate — { input, frameworkKey, model? }
POST /api/v1/route/{id}/evaluate — { input, context? }
GET /api/v1/routes
POST /api/v1/routes
PATCH/DELETE /api/v1/routes/{id}
GET /api/v1/frameworks
POST /api/v1/frameworks — { key, name, controls } (Pro+)
PATCH/DELETE /api/v1/frameworks/{key}
GET /api/v1/evaluations
GET /api/v1/evaluations/{id}
Optional `Idempotency-Key` header on POST /v1/evaluate*. Cached for 24h keyed on (org, key, inputHash).Webhook signature
Govern signs outbound webhook bodies with HMAC-SHA256. Header: `X-Govern-Signature: t=<ms>,v1=<hex>` Verify: hex(HMAC-SHA256(routeWebhookSecret, "<t>.<rawBody>")) === <v1>. Reject if `Math.abs(Date.now() - t) > 300000` (5-minute window).
Image and PDF inputs
The `input` field accepts a string OR an object:
{ "input": { "text": "...", "images": ["data:image/...;base64,...", "https://..."], "pdfUrls": ["https://..."] } }
Up to 10 images and 5 PDFs per evaluation. PDFs are fetched server-side and text-extracted; combined text + image content is then judged. For frameworks that score image content (CSAM_SAFETY), Govern uses a vision-capable model (gpt-4o, gpt-4.1).
Images are SHA256-hashed for the audit trail. The original bytes are NOT retained — keep your own copies.CSAM safety + reporting
The CSAM_SAFETY preset framework scores six controls covering grooming language, exploitation indicators, sexualized minor imagery, real-vs-synthetic minor depiction, age-ambiguous + suggestive content, and solicitation.
When CSAM_SAFETY triggers, the response payload carries an `escalation` block:
{
"decision": "BLOCK",
"scores": { ... },
"escalation": {
"recommended": "report",
"framework": "CSAM_SAFETY",
"guidance": "...",
"cyberTiplineUrl": "https://report.cybertip.org/",
"statuteRef": "18 U.S.C. § 2258A — ..."
}
}
**Govern is not a registered electronic service provider under § 2258A.** Govern detects and scores; YOU are the legal reporter. Route the escalation block to your incident pipeline and submit reports via the NCMEC CyberTipline as required by your operations.Replay an evaluation
Re-run any past evaluation against the current route OR a different framework:
POST /api/v1/evaluations/{id}/replay
{ "useCurrentRoute": true }
Or override the framework:
POST /api/v1/evaluations/{id}/replay
{ "frameworkKeys": ["NIST_AI_RMF"] }
Replays count against your monthly cap and link to the source via `parentId`.Node + Python SDKs
Both SDKs wrap the public API with idempotency, exponential-backoff retries, and typed responses.
Node:
npm install @inversify/govern
const client = new Govern({ apiKey: "inv_govern_..." });
const r = await client.evaluate({ input: "...", frameworkKey: "OWASP_LLM_TOP_10" });
Python:
pip install inversify-govern
from inversify_govern import Govern
client = Govern(api_key="inv_govern_...")
r = client.evaluate(input="...", framework_key="OWASP_LLM_TOP_10")