EU AI Act in 121 days945+ tests · 0 deps

Govern
your agents.

Before-action policy enforcement for TypeScript AI agents. Before-action enforcement. Zero dependencies. One import.

Get started
33 exports
20 adapters
945+ tests
0 deps

Everything to govern AI agents

Not guardrails. Governance — fleet-wide policy enforcement, compliance mapping, and tamper-evident audit trails.

Core

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_ofnot
Security

HMAC Audit Trail

SHA-256 hash-chained event log. Modify any event — the chain breaks. Tamper-evident by default.

chain.verify() → {valid, brokenAt}
chain.export() → auditor-ready JSON
Assessment

7-Dimension Scoring

Identity, permissions, observability, guardrails, auditability, compliance, lifecycle. Score 0–100, levels L0–L4.

L1L2L3L4
Emergency

Kill Switch

Agent going rogue? One call kills it. Fleet-wide? Kill them all. Priority 999 overrides everything.

ks.killAll("security incident")
Defense

Injection Detection

64+ patterns across 7 categories. Synchronous, in-process. Block prompt injection before it reaches your agent.

instruction_overriderole_manipulationcontext_escapedata_exfiltrationencoding_attacksocial_engineeringobfuscation
Compliance

EU AI Act Ready

Map your governance posture against Articles 9, 11, 12, 14, 15, and 50. Built-in gap analysis with remediation steps.

Art. 9
Risk management
Art. 11
Technical docs
Art. 12
Record-keeping
Art. 14
Human oversight
Art. 15
Accuracy
Art. 50
Transparency
Developer experience

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()
Before / After

3 lines to governed agents

Drop into any TypeScript agent framework. No config files, no external services, no runtime dependencies.

Before — ungoverned
ts
After — governed
ts

20 framework adapters — one import, zero config

MastracreateGovernanceMiddleware()
Vercel AI SDKcreateGovernedTools()
LangChaingovernTool()
OpenAI AgentsgovernAgent()
AnthropicgovernAnthropicTools()
MCPcreateGovernedMCP()
+14 more →
Interactive Playground

See governance in action

No signup, no backend — everything runs client-side with the real SDK logic.

Policy Enforcement
Block tools, require approval, enforce levels
Pick a scenario or build your own:
enforce.ts
ts
Framework Adapters

Works with your stack

20 official adapters across 4 categories. One import. Zero config.

AI Frameworks
5
Model Providers
4
Agent Platforms
5
Cloud & Runtime
6
Storage Backends
2
In-Memory
createMemoryStorage()Built-in default. 10K event capacity. Zero config.
PostgreSQL
governance-sdk/storage-postgresProduction-ready. Auto-migrate. Custom table prefix.
How it works

Governance in 4 steps

From install to fully governed fleet in under 5 minutes. No external services. No configuration files. Just TypeScript.

01
Register

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.

ts
02
Policy

Define policies

13 condition types. Boolean combinators. Priority-ordered evaluation. Block tools, require levels, gate payments behind human approval — all in TypeScript.

ts
03
Enforce

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.

ts
04
Audit

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.

ts
945+
tests passing
0
external deps
13
condition types
6/6
EU AI Act articles
Performance

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.

Benchmarks
Node.js 22 · M3 Pro · 2026
enforce() — in-memoryp50 · no I/O
0.3ms
x
enforce() — PostgreSQLp50 · local PG
2.1ms
x
register() — in-memoryscoring + storage
0.8ms
x
detectInjection()64+ patterns · sync
0.1ms
x
evaluate 1000 rulesadversarial test verified
<10ms
x
chain.verify() — 1k eventsHMAC re-hash chain
4.2ms
x
assessCompliance()6-article mapping
0.05ms
x
0
network round-trips
0
network calls
100%
edge-compatible
Enforcement flow
1
Agent calls tool
Agent requests shell_exec()
enforce() intercepts
Before execution · in-process
2a
Blocked
blockTools() matched
2b
Allowed
All rules pass
3
Audit logged
HMAC-chained event written
Zero overhead design
No network round-trips
Enforcement runs in-process — nothing leaves your runtime
No spawned processes
Pure TypeScript · zero binary dependencies
No eval() or dynamic code
Statically analyzable · works in edge runtimes
Additive audit writes
Append-only storage · never blocks the hot path
Tree-shakeable exports
Only import what you use · zero unused code

How we compare

The only TypeScript governance SDK with boolean combinators, sequence-aware policies, 7-dimension scoring, and EU AI Act compliance mapping.

Capabilitygovernance-sdkAgentBouncrRunlayerGuardrails AIOneTrust
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 adapters205000
Zero dependencies
MIT license
npm install
AgentBouncr: Elastic License v2 · Runlayer: $11M funded, enterprise proxy · Guardrails AI: Python-first · OneTrust: $4.5B valuation, enterprise SaaS
Built for production

Ship with confidence

The only governance SDK that's actually zero dependencies, actually in-process, and actually TypeScript-native.

945+
Tests passing
279 suites, 0 failures
20
Framework adapters
Mastra, Vercel AI, LangChain, OpenAI + 16
0
Runtime dependencies
Auditable in minutes
35
Export paths
In-process, no network calls
Financial Services

Block unauthorized wire transfers before execution. HMAC audit chain satisfies SOX compliance.

payment_sendwire_transferaccount_close
requireApproval + blockTools
Healthcare

Zero-dependency deployment into regulated environments. Edge-compatible enforcement for HIPAA.

patient_lookupprescription_writerecord_export
requireLevel(3) + timeWindow
Developer Platforms

Govern agent tool access across multi-tenant SaaS. Per-tenant policy isolation.

shell_execdeploydb_migrate
requireSequence + tokenBudget
E-Commerce

Rate-limit bulk operations. Require human approval for high-value order modifications.

bulk_exportprice_updaterefund_process
rateLimit + requireApproval
MIT LicenseTypeScript-nativeZero dependenciesEdge-compatibleHMAC-SHA256 auditEU AI Act mapped35 export pathsTree-shakeable
FAQ

Questions developers actually ask

No fluff. Direct answers to the objections we hear most.

Still have questions? Ask on GitHub Discussions or email us.

121 days until EU AI Act enforcement

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.

945+ tests·0 dependencies·TypeScript-native·MIT license