microsoft/agent-governance-toolkit

AI Agent Governance Toolkit — Policy enforcement, zero-trust identity, execution sandboxing, and reliability engineering for autonomous AI agents. Covers 10/10 OWASP Agentic Top 10.

Agent Governance Toolkit – Quick, Jargon‑Light Overview

What it is – A Microsoft‑maintained open‑source library that lets you run autonomous AI agents in production while enforcing deterministic, auditable policies. It sits between an agent and the tools/services the agent wants to use, checking every request against a YAML/OPA‑style policy, logging the decision, and optionally blocking the call.


Why you might need it

  1. Policy enforcement – Prevent an agent that can read a database from issuing destructive commands like DROP TABLE.
  2. Attribution – Identify which agent (or which API key) performed a given action in a multi‑agent system.
  3. Auditability – Produce tamper‑evident logs that regulators or internal auditors can inspect.

The toolkit does this outside the LLM prompt, so the protection is deterministic rather than relying on probabilistic prompt‑level safety.


Core concepts (the “pipeline”)

Agent ──► Policy Engine ──► Identity ──► Audit Log
            (YAML/OPA/Cedar)   (SPIFFE/DID/mTLS)   (tamper‑evident)
  • Policy Engine – evaluates a policy file and returns allow, deny, or require_approval.
  • Identity – optional SPIFFE/DID/mTLS credentials that tie a request to a specific agent.
  • Audit Log – immutable record of every decision, useful for compliance.

You can use just the first two layers (policy + audit) for most deployments; the identity layer is optional.


Getting started (Python example)

# Install the full stack (includes CLI, compliance tools, etc.)
pip install "agent-governance-toolkit[full]"
from agentmesh.governance import govern

# Wrap any tool you expose to the agent
safe_tool = govern(my_tool, policy="policy.yaml")

# Policy file (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
#   - 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'

If a rule returns require_approval, the call raises a GovernancePending exception that your orchestration layer can route to a human reviewer.


Language support

Language Package Install command
Python agent-governance-toolkit pip install "agent-governance-toolkit[full]"
TypeScript @microsoft/agent-governance-sdk npm install @microsoft/agent-governance-sdk
.NET Microsoft.AgentGovernance dotnet add package Microsoft.AgentGovernance
Rust agent-governance cargo add agent-governance
Go agent-governance-toolkit (golang sub‑folder) go get github.com/microsoft/agent-governance-toolkit/agent-governance-golang

All SDKs expose the same core API: create a policy engine, evaluate a request, and receive a verdict.


CLI utilities (agt)

  • agt doctor – sanity‑check the installation.
  • agt verify – run OWASP Agentic Top‑10 compliance checks on your policies.
  • agt red-team scan … – audit a set of prompts for injection risk.
  • agt lint-policy … – validate YAML/OPA syntax.
  • agt verify --evidence … --strict – fail CI if evidence of compliance is weak.

Ecosystem integrations

The toolkit ships adapters for the major LLM‑agent frameworks:

  • Microsoft Agent Framework, Semantic Kernel, AutoGen, LangChain/​LangGraph, CrewAI, OpenAI Agents SDK, Claude Code, Google ADK, LlamaIndex, Haystack, Mastra, Dify, Azure AI Foundry, GitHub Copilot CLI, etc.

You simply install the appropriate adapter package and wrap your tools with govern() or the lower‑level AgentControl API.


Governance‑related extras

Feature What it adds
MCP Security Gateway Detects tool‑poisoning, drift, typosquatting, hidden instructions.
Shadow AI Discovery Scans a host for unregistered agents.
Governance Dashboard Streamlit UI showing fleet health, trust scores, and policy violations in real time.
PromptDefense Evaluator 12‑vector audit for prompt‑injection risk.
Contributor Reputation Action GitHub Action that flags PR authors with low reputation (helps prevent social‑engineering attacks).

When to use it

  • You are deploying autonomous agents that call external tools (web search, database queries, email, shell commands, etc.).
  • You need hard, deterministic guarantees that certain actions cannot happen, regardless of how clever a prompt‑injection attack is.
  • Your organization must keep audit trails for compliance (e.g., GDPR, financial regulations) or internal governance.
  • You already use one of the supported frameworks and want a drop‑in policy layer.

If you only need simple prompt‑level safety or are just experimenting locally, the toolkit may be overkill.


Where to learn more

  • Full documentation site – https://microsoft.github.io/agent-governance-toolkit
  • Quick‑start guide – docs/quickstart.md
  • Specification docs – policy-engine/spec/SPECIFICATION.md and other docs/specs/*
  • Community – Discord link in the README, plus the OpenSSF scorecard badge showing good supply‑chain health.

Bottom line – Agent Governance Toolkit gives you a production‑grade, language‑agnostic way to deterministically control what autonomous AI agents can do, record every decision, and stay compliant with emerging OWASP Agentic security standards.

Related

  • Project
  • Project
  • Project
  • Project
  • Project