Docs
GovAI Functions 2.0
GovAI Functions 2.0
[!summary]
Read-only flight-recorder APIs that package decision intelligence for operators, counsel, and executives — without replacing the immutable ledger verdict from compliance-summary.
Summary#
GovAI Functions 2.0 extends the append-only AI decision flight recorder (Postgres-backed trace events with hash-chain integrity) with richer event_type values, a structured govai_functions_v2 rollup inside trace export, and HTTP read APIs for packaged decision intelligence.
Compliance verdict flow
Prerequisites that must be satisfied before VALID is returned.
HTTP route catalog
Core audit API surface — normative shapes in OpenAPI.
Metadata & readiness
GET /healthLiveness after successful startup.GETGET /readyPostgres, migrations, ledger writability (503 when not ready).GETGET /statusPolicy version, environment, runtime diagnostics.GET
Ledger & compliance
POST /evidenceAppend hash-chained evidence event.POSTGET /compliance-summaryAuthoritative VALID / INVALID / BLOCKED verdict.GETGET /bundle-hashCI digest gate: events_content_sha256.GETGET /api/export/:run_idMachine-readable audit export.GET
Preview runtime
POST /v1/runtime/evaluatePreview policy evaluation (does not replace compliance-summary).POST
API endpoints#
/api/functions/v2/{run_id}/flight-packAPIFlight pack
Full operational picture — base trace export plus governance operating system rollup.
Auth Bearer session or enterprise JWT; permission ai_decision_trace_read
/api/functions/v2/{run_id}/executive-summaryAPIExecutive summary
Short leadership view — model, compliance-summary ref, integrity, optional executive brief.
Auth Bearer session or enterprise JWT; permission ai_decision_trace_read
/api/functions/v2/{run_id}/legal-evidence-manifestAPILegal evidence manifest
Indexed legal evidence references for counsel or regulatory packs.
Auth Bearer session or enterprise JWT; permission ai_decision_trace_read
/api/functions/v2/{run_id}/governance-scorecardAPIGovernance scorecard
Deterministic readiness score from telemetry (not a substitute for compliance-summary).
Auth Bearer session or enterprise JWT; permission ai_decision_trace_read
Authentication and permissions#
[!summary]
Enterprise read routes use session or enterprise JWT — separate from audit API keys used for evidence ingestion and compliance-summary.
Enterprise read routes require:
Authorization: Bearer <token>— dashboard session bearer or compatible enterprise JWT- Optional
x-govai-team-idwhen your deployment uses team scope - Permission
ai_decision_trace_read
These routes are separate from audit API keys used for POST /evidence and GET /compliance-summary with GOVAI_API_KEY.
Try this locally#
Validate and gate Functions 2.0 packs
Run the offline pack validator and the repo gate before promoting schema or sample packs.
Next stepContinue
Example API request#
/api/functions/v2/{run_id}/executive-summaryAPIEnterpriseFetch executive summary for a run
Leadership-facing rollup with compliance-summary reference and integrity status.
Auth Bearer session or enterprise JWT; ai_decision_trace_read
Example response
Error handling#
| Status | Meaning |
|---|---|
401 / 403 | Missing bearer, invalid token, or insufficient permission |
404 | Unknown run_id or no trace data for the team scope |
400 | Invalid path or query (Rust service returns stable JSON body) |
Event ingestion uses POST /api/ai-decision-traces/{run_id}/events. Invalid payloads return 400 with a stable error body from the Rust service.
Best practices#
- Always gate releases with
GET /compliance-summaryfor the authoritative verdict (VALID,INVALID, orBLOCKED). - Use flight-pack for deep dives; use executive-summary for stakeholder updates.
- Bind ledger tenant to team before writing traces on hosted deployments.
- Validate offline packs with
scripts/validate_govai_functions_v2_pack.pybefore CI promotion.
Clients#
- OpenAPI:
api/govai-http-v1.openapi.yaml(enterprise tier) - Python:
GovAIClient.get_functions_v2_*inpython/govai/client.py - TypeScript:
@govai/functions-sdkintypescript-sdk/(GovaiFunctionsV2Clientfor v2 routes)
Hosted platform#
On govbase.dev, the same routes are available on the GovAI audit origin when enterprise authentication is configured.