Govern
your agents.
Before-action policy enforcement for TypeScript AI agents. Before-action enforcement. Zero dependencies. One import.
Everything to govern AI agents
Not guardrails. Governance — fleet-wide policy enforcement, compliance mapping, and tamper-evident audit trails.
Before-Action Enforcement
Block dangerous tool calls before they execute. 13 condition types, boolean combinators, priority-ordered evaluation. Under 1ms.
tool_blockedrequire_approvalrate_limittoken_limitagent_leveltool_sequencetime_windowany_ofall_ofnotHMAC Audit Trail
SHA-256 hash-chained event log. Modify any event — the chain breaks. Tamper-evident by default.
7-Dimension Scoring
Identity, permissions, observability, guardrails, auditability, compliance, lifecycle. Score 0–100, levels L0–L4.
Kill Switch
Agent going rogue? One call kills it. Fleet-wide? Kill them all. Priority 999 overrides everything.
ks.killAll("security incident")Injection Detection
64+ patterns across 7 categories. Synchronous, in-process. Block prompt injection before it reaches your agent.
EU AI Act Ready
Map your governance posture against Articles 9, 11, 12, 14, 15, and 50. Built-in gap analysis with remediation steps.
8 Policy Presets
Cover 90% of governance needs with declarative presets. Compose with boolean combinators for the rest.
blockTools()allowOnlyTools()requireApproval()tokenBudget()rateLimit()requireLevel()requireSequence()timeWindow()3 lines to governed agents
Drop into any TypeScript agent framework. No config files, no external services, no runtime dependencies.
20 framework adapters — one import, zero config
createGovernanceMiddleware()createGovernedTools()governTool()governAgent()governAnthropicTools()createGovernedMCP()See governance in action
No signup, no backend — everything runs client-side with the real SDK logic.
Works with your stack
20 official adapters across 4 categories. One import. Zero config.
createMemoryStorage()Built-in default. 10K event capacity. Zero config.governance-sdk/storage-postgresProduction-ready. Auto-migrate. Custom table prefix.Governance in 4 steps
From install to fully governed fleet in under 5 minutes. No external services. No configuration files. Just TypeScript.
Register your agents
Call gov.register() once at startup. The SDK computes a 7-dimension governance score and assigns a trust level (L0–L4). No external service. No API key.
Define policies
13 condition types. Boolean combinators. Priority-ordered evaluation. Block tools, require levels, gate payments behind human approval — all in TypeScript.
Enforce before every call
gov.enforce() runs inline — same process, before execution, under 1ms. Returns allow or block with the matching rule. Automatically writes to the HMAC audit chain.
Audit everything
Every enforce() decision is written to an HMAC-SHA256 hash-chained audit trail. Modify any event — the chain breaks. chain.verify() detects tampering at the exact index.
In-process. Zero network overhead.
Governance runs inline on every tool call. No round-trips, no spawned processes, no eval(). Pure TypeScript running in your runtime.
How we compare
The only TypeScript governance SDK with boolean combinators, sequence-aware policies, 7-dimension scoring, and EU AI Act compliance mapping.
| Capability | governance-sdk | AgentBouncr | Runlayer | Guardrails AI | OneTrust |
|---|---|---|---|---|---|
| TypeScript-native | |||||
| Before-action enforcement | |||||
| Boolean policy combinators | |||||
| Sequence-aware policies | |||||
| Tamper-evident audit | |||||
| 7-dimension scoring | |||||
| EU AI Act mapping | |||||
| Kill switch | |||||
| Injection detection | |||||
| PostgreSQL storage | |||||
| Framework adapters | 20 | 5 | 0 | 0 | 0 |
| Zero dependencies | |||||
| MIT license | |||||
| npm install |
Ship with confidence
The only governance SDK that's actually zero dependencies, actually in-process, and actually TypeScript-native.
Block unauthorized wire transfers before execution. HMAC audit chain satisfies SOX compliance.
Zero-dependency deployment into regulated environments. Edge-compatible enforcement for HIPAA.
Govern agent tool access across multi-tenant SaaS. Per-tenant policy isolation.
Rate-limit bulk operations. Require human approval for high-value order modifications.
Questions developers actually ask
No fluff. Direct answers to the objections we hear most.
Still have questions? Ask on GitHub Discussions or email us.
Ship governed agents today.
Your competitors are deploying AI agents without governance. When the EU AI Act hits, they'll scramble. You'll be compliant.