Public Preview — MCP governance primitives for the Agent Governance Toolkit.
Project description
agent-mcp-governance
Public Preview — Standalone Python package that exposes the Agent Governance Toolkit's MCP (Model Context Protocol) governance primitives for use outside the full AGT monorepo.
Overview
agent_mcp_governance provides a thin, typed re-export surface over the
governance, audit, and trust modules in
agent-os-kernel. It is
not zero-dependency — it requires agent-os-kernel >=3.0.0,<4.0.0.
Installation
pip install agent-mcp-governance
This will pull in agent-os-kernel automatically.
Quick Start
from agent_mcp_governance import (
GovernanceMiddleware,
AuditMiddleware,
TrustGate,
BehaviorMonitor,
)
# 1. Governance — block prompt-injection patterns
gov = GovernanceMiddleware(
blocked_patterns=[r"(?i)ignore previous instructions"],
allowed_tools=["web-search", "read-file"],
rate_limit_per_minute=60,
)
# 2. Audit — tamper-evident hash-chain logging
audit = AuditMiddleware(capture_data=True)
# 3. Trust — DID-based agent identity verification
gate = TrustGate(min_trust_score=500)
# 4. Monitoring — detect rogue agents
monitor = BehaviorMonitor(
burst_threshold=100,
consecutive_failure_threshold=20,
)
API Reference
| Export | Source module | Description |
|---|---|---|
GovernanceMiddleware |
agent_os.governance.middleware |
Policy enforcement (rate limits, allow-lists, content filters) |
AuditMiddleware |
agent_os.audit.middleware |
Tamper-evident audit logging with hash chain |
TrustGate |
agent_os.trust.gate |
DID-based trust verification for agent handoffs |
BehaviorMonitor |
agent_os.services.behavior_monitor |
Per-agent anomaly detection and quarantine |
Compatibility
| Python | agent-os-kernel |
|---|---|
| ≥ 3.10 | ≥ 3.0.0, < 4.0.0 |
License
MIT — Copyright (c) Microsoft Corporation.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file agent_mcp_governance-3.3.0.tar.gz.
File metadata
- Download URL: agent_mcp_governance-3.3.0.tar.gz
- Upload date:
- Size: 3.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: RestSharp/106.13.0.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
311b83cfd1cc443f00a3be3ba60f3ee445a9a125625a52f597bbb2633dadc044
|
|
| MD5 |
bc963557aab85e3d82de6877bc6c7bb4
|
|
| BLAKE2b-256 |
7c78fc4158f61e1db85255c54b7996ccd0f499363f808722030f73fb69263d0e
|
File details
Details for the file agent_mcp_governance-3.3.0-py3-none-any.whl.
File metadata
- Download URL: agent_mcp_governance-3.3.0-py3-none-any.whl
- Upload date:
- Size: 2.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: RestSharp/106.13.0.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e5ed2157288757d7bf80ba52886ae55833f4b67d30a5ff7bb00ffc7c89d0f8d7
|
|
| MD5 |
c37af7b07dcf35e75d0b1012ce6e0c07
|
|
| BLAKE2b-256 |
98ddc3fd5d2f94b12214ab9fc792f2ce36988c799936d8d3e479172b442a8330
|