---
hide:
- navigation
- toc
---
# Ship agents to production without losing sleep
Policy enforcement, identity, sandboxing, and SRE for autonomous AI agents.
One pip install, any framework.
```bash
pip install agent-governance-toolkit[full]
```
3,700+GitHub Stars
10Formal Specs
5Languages
19Integrations
## The problem
Your AI agents call tools, browse the web, query databases, and delegate to other agents. Once deployed, they make decisions autonomously. You need answers to three questions:
**1. Is this action allowed?** An agent with access to `send_email` and `query_database` should not be able to `drop_table`. OAuth scopes and IAM roles control which services an agent can reach, not what it does once connected.
**2. Which agent did this?** In a multi-agent system, five agents might share a single API key. When something goes wrong, "an agent did it" is not an incident response.
**3. Can you prove what happened?** Auditors and regulators need tamper-evident records of every decision: what policy was active, what the agent requested, and why it was allowed or denied.
## Govern any agent in 2 lines
Wrap any tool function with `govern()`. Policy enforcement, audit logging, and denial handling are automatic.
```python
from agentmesh.governance import govern
safe_tool = govern(my_tool, policy="policy.yaml")
```
That's it. `safe_tool` evaluates your YAML policy on every call, logs the decision, and raises `GovernanceDenied` if the action is blocked. Works with LangChain, CrewAI, OpenAI Agents, AutoGen, Google ADK, and any other framework.
```yaml
# policy.yaml
apiVersion: governance.toolkit/v1
name: production-policy
default_action: allow
rules:
- name: block-destructive
condition: "action.type in ['drop', 'delete', 'truncate']"
action: deny
description: "Destructive operations require human approval"
- name: require-approval-for-send
condition: "action.type == 'send_email'"
action: require_approval
approvers: ["security-team"]
```
```
>>> safe_tool(action="read", table="users")
{'table': 'users', 'rows': 42}
>>> safe_tool(action="drop", table="users")
GovernanceDenied: Action denied by policy rule 'block-destructive':
Destructive operations require human approval
```
## How it works
``` mermaid
flowchart LR
A["๐ค Agent"] -->|govern| PE
subgraph GK [" Agent Governance Toolkit "]
direction LR
PE["Policy Engine
YAML ยท OPA ยท Cedar"]
ID["Identity
SPIFFE ยท DID ยท mTLS"]
AL["Audit Log
Tamper-evident"]
PE --> ID --> AL
end
AL -->|Allowed| T["Tool executes"]
PE -->|Denied| D["GovernanceDenied"]
```
Every layer is optional. Start with `govern()` and add layers as your risk profile grows. Most teams run policy enforcement + audit logging and never need the full stack.
## Packages
Agent OS
Policy engine, agent lifecycle, governance gate
Agent Mesh
Agent discovery, routing, and trust mesh
Agent Runtime
Execution sandboxing with four privilege rings
Agent SRE
Kill switch, SLO monitoring, chaos testing
Agent Compliance
OWASP verification, policy linting, integrity checks
Agent Marketplace
Plugin governance and trust scoring
Agent Lightning
RL training governance with violation penalties
Agent Hypervisor
Execution audit, delta engine, commitment anchoring
Agent Control Specification
Stateless policy decisions for agent security
## Language SDKs
| SDK | Install |
|-----|---------|
| ๐ [Python](packages/agent-compliance.md) | `pip install agent-governance-toolkit[full]` |
| ๐ TypeScript | `npm install @microsoft/agent-governance-sdk` |
| ๐ท [.NET](packages/dotnet-sdk.md) | `dotnet add package Microsoft.AgentGovernance` |
| ๐ฆ Rust | `cargo add agent-governance` |
| ๐น Go | `go get github.com/microsoft/agent-governance-toolkit/agent-governance-golang` |
## Framework Integrations
Works with any agent framework: LangChain, CrewAI, AutoGen, Google ADK, OpenAI Agents, LlamaIndex, Haystack, Mastra, MCP, A2A, and more. See the [full list](packages/index.md).
## Examples
| Example | Framework | What it demonstrates |
|---------|-----------|---------------------|
| [openai-agents-governed](https://github.com/microsoft/agent-governance-toolkit/tree/main/examples/openai-agents-governed) | OpenAI Agents SDK | Policy-gated tool calls with trust tiers |
| [crewai-governed](https://github.com/microsoft/agent-governance-toolkit/tree/main/examples/crewai-governed) | CrewAI | Multi-agent governance with role-based policies |
| [smolagents-governed](https://github.com/microsoft/agent-governance-toolkit/tree/main/examples/smolagents-governed) | HuggingFace smolagents | Lightweight agent governance |
| [maf-integration](https://github.com/microsoft/agent-governance-toolkit/tree/main/examples/maf-integration) | MAF | Microsoft Agent Framework integration |
| [mcp-trust-verified-server](https://github.com/microsoft/agent-governance-toolkit/tree/main/examples/mcp-trust-verified-server) | MCP | Trust-verified MCP server implementation |
## Specifications
Every major component has a formal RFC 2119 specification with conformance tests.
| Specification | Tests |
|---|---|
| [Agent OS Policy Engine](specs/AGENT-OS-POLICY-ENGINE-1.0.md) | 68 |
| [Agent Control Specification](packages/agent-control-specification.md) | -- |
| [AgentMesh Identity and Trust](specs/AGENTMESH-IDENTITY-TRUST-1.0.md) | 135 |
| [Agent Hypervisor Execution Control](specs/AGENT-HYPERVISOR-EXECUTION-CONTROL-1.0.md) | 80 |
| [AgentMesh Trust and Coordination](specs/AGENTMESH-TRUST-COORDINATION-1.0.md) | 62 |
| [Agent SRE Governance](specs/AGENT-SRE-GOVERNANCE-1.0.md) | 111 |
| [MCP Security Gateway](specs/MCP-SECURITY-GATEWAY-1.0.md) | 127 |
| [Agent Lightning Fast-Path](specs/AGENT-LIGHTNING-FAST-PATH-1.0.md) | 100 |
| [Framework Adapter Contract](specs/FRAMEWORK-ADAPTER-CONTRACT-1.0.md) | 152 |
| [Audit and Compliance](specs/AUDIT-COMPLIANCE-1.0.md) | 157 |
| [AgentMesh Wire Protocol](specs/AGENTMESH-WIRE-1.0.md) | -- |
[25 Architecture Decision Records](adr/) document the reasoning behind key design choices.
## Standards Compliance
| Standard | Coverage |
|----------|----------|
| [OWASP Agentic AI Top 10](compliance/owasp-agentic-top10-architecture.md) | All ASI risk categories mapped with deterministic controls |
| [NIST AI RMF 1.0](reference/nist-rfi-mapping.md) | Full GOVERN, MAP, MEASURE, MANAGE alignment |
| [EU AI Act](compliance/) | Compliance mapping with automated evidence |
| [SOC 2](compliance/soc2-mapping.md) | Control mapping with audit trail export |