Skip to content
GovernRoute
Developers

Governance in one line of code

Swap a base URL, add middleware or call the guard API. Python and TypeScript SDKs, OpenAI wire format, OpenTelemetry and policy-as-code — no rebuild, no lock-in.

Quickstart

From sign-up to governed traffic in four steps

  1. 1

    Register and get a workspace

    We create your organisation with QA → acceptance → performance → production environments.

  2. 2

    Create an application and key

    Scoped API keys (gateway, guard, ingest, apigw, mcp) bound to one environment. Rotate with a grace period.

  3. 3

    Connect your agent

    Swap the base URL, add the middleware or call the guard API. New agents start in observe mode.

  4. 4

    Review, then enforce

    Check findings and would-have-blocked counts, then switch to enforce and promote through your environments.

Examples

Pick the integration that fits each agent

Every path uses the same keys, policies, traces and audit trail. Combine them freely.

agent.py
import os
from openai import OpenAI

client = OpenAI(
    base_url="https://gateway.your-company.com/v1",
    api_key=os.environ["GOVERNROUTE_API_KEY"],
    default_headers={"X-GovernRoute-Agent": "support-bot"},
)

reply = client.chat.completions.create(
    model="default",  # a GovernRoute model route with failover
    messages=[{"role": "user", "content": prompt}],
)

Works with any OpenAI-compatible client — OpenAI SDKs, LangChain ChatOpenAI, LlamaIndex, Vercel AI SDK, CrewAI, curl, Java and Go.

Capability matrix

What each integration path can do

Integration paths and capabilities
PathObserveEnforce inputEnforce outputTool controlCode change
Inline gateway (OpenAI-compatible)base_url + key
SDK middleware (LangChain / LangGraph, ADK, any)1–3 lines
Existing LiteLLM proxyconfig only
OpenTelemetry (OTLP)env vars
MCP / tool gateway––wrap call_tool
Customer-hosted gatewaydeploy image

OpenTelemetry ingest is telemetry-only and labelled as such. Every new agent starts in observe mode.

Responses

One standard assessment on every decision

Modelled on familiar formats: the action field follows AWS Bedrock ApplyGuardrail, and flagged + categories follow OpenAI Moderation scores — so your code can map it directly.

Response headers

x-governroute-decision
allow · redact · block · review
x-governroute-mode
observe or enforce
x-governroute-trace-id
Joins your W3C traceparent
x-governroute-request-id
Look the request up in Activity
X-GovernRoute-Risk-Score
0–1 risk score on every gateway response

Denials are HTTP 403 with an OpenAI-style error body on the AI gateway, and RFC 9457 problem details everywhere else.

assessment.json
{
  "schema": "governroute.assessment/v1",
  "action": "BLOCKED",
  "decision": "block",
  "flagged": true,
  "risk_score": 0.92,
  "mode": "enforce",
  "categories": { "prompt_injection": 0.92 },
  "guardrails": [{
    "name": "Prompt-injection heuristics",
    "phase": "inbound",
    "decision": "block",
    "score": 0.92,
    "threshold": 0.7,
    "reason_code": "prompt_injection_suspected",
    "owasp": ["LLM01:2025", "ASI01:2026"],
    "latency_ms": 0.41
  }],
  "frameworks": ["ASI01:2026", "LLM01:2025"],
  "latency_ms": 1.37
}
customer-data-protection.yaml
apiVersion: governroute.io/v1
kind: Policy
metadata:
  name: Customer data protection
  category: data_protection
  severity: high
  owner: privacy-team
  frameworks: [OWASP-LLM:LLM02:2025, GDPR:Art.32]
spec:
  mode: enforce                     # observe | enforce
  appliesTo:
    environmentKinds: [acceptance, production]
  rules:
    - id: redact-pii
      guardrail: {template: pii_redaction}
      action: redact
      stages: [input, output]
    - id: ssn-hr-only
      guardrail: {name: SSN access by role}
      action: block
      minScore: 0.8
      failureMode: fail_closed
Policy-as-code

Policies live in Git, not in someone's head

Kubernetes-style documents you can review in pull requests, import with a dry run, export to another tenant and test before applying.

  • Import — JSON or multi-document YAML, all-or-nothing, with dry-run and conflict handling.
  • Test — evaluate sample input and output against a saved or unsaved policy; nothing is recorded as traffic.
  • Apply — compile into an immutable workflow version and assign it to an application, environment or workspace.
  • Templates — OWASP LLM Top 10 baseline, Customer data protection, Agent tool safety, Regulated environment.
SDKs

Python and TypeScript, with the same operations

Python and TypeScript SDKs provided with your workspace — fail-closed by default, RFC 9457 errors as typed exceptions.

Python helperEndpointPurpose
check_input · check_output · check_toolPOST /v1/guard/checkOne-call guard for any stage
guard_input · guard_output · guard_toolPOST /v1/guard/input | output | toolStage-specific guard checks
pre_llm · post_llm · guarded_completionPOST /v1/guardrails/pre-llm | post-llmPhase-checked evaluate API around your own model
restorePOST /v1/guardrails/restoreRestore tokenized values for the caller
retrievePOST /v1/retrievalsPermission-aware retrieval
store_memories · search_memoriesPOST /v1/memories | /searchGuarded agent memory
approval_statusGET /v1/approvals/{id}Poll a human approval
emitPOST /v1/eventsTelemetry events (never raises)

Standards we follow

  • RFC 9457 problem details
  • IETF RateLimit headers
  • ETag / If-Match
  • Idempotency-Key
  • W3C Trace Context
  • OpenAPI 3.1
  • OpenTelemetry GenAI conventions
  • RFC 7239 Forwarded
Next step

Ready to connect your first agent?

Register as a client and we'll issue your workspace and keys, and pair you with an onboarding engineer.