Registry / devops / agent-governance-toolkit

agent-governance-toolkit

JSON →
library4.0.0pypypi✓ verified 80d ago

Unified installer and runtime policy enforcement for agent governance. Version 4.0.0 (public preview). Supports Python >=3.9. Maintained by Microsoft with monthly releases.

pip install agent-governance-toolkit
INSTALL
IMPORT
SIG · AGENT-GOVERNANCE-T
A
agent-governance-toolkit
devopspythonv4.0.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

PromptDefenseConfig
from agent_compliance import PromptDefenseConfig
from agent_governance_toolkit import AgentGovernanceClient
SupplyChainConfig
from agent_compliance import SupplyChainConfig
from agent_governance_toolkit import AgentGovernanceClient
PromptDefenseEvaluator
from agent_compliance import PromptDefenseEvaluator
from agent_governance_toolkit import AgentGovernanceClient

Initialize client and apply a policy using the v4 API.

import os from agent_governance_toolkit import AgentGovernanceClient, Policy client = AgentGovernanceClient( endpoint=os.environ.get('GOVERNANCE_ENDPOINT', ''), credential=None ) policy = Policy.from_json({ "id": "allow-list", "rules": [{"effect": "Allow", "actions": ["*"], "resources": ["*"]}] }) client.apply_policy(policy)
Debug
Known issues
breakingIn v4.0.0, the top-level import path changed from `agent_governance` to `agent_governance_toolkit`. All existing imports must be updated.
fix
Replace `import agent_governance` with `from agent_governance_toolkit import ...`.
affects: >=3.0.0, <4.0.0
deprecatedThe `Policy.from_dict()` method is deprecated in v4.0. Use `Policy.from_json()` instead.
fix
Change `Policy.from_dict(data)` to `Policy.from_json(data)`.
affects: >=4.0.0
gotchaCredential parameter is optional but most users forget to pass Azure credentials, leading to runtime 401 errors.
fix
Pass a `DefaultAzureCredential()` from azure-identity, or set the AZURE_CLIENT_SECRET environment variable.
affects: >=4.0.0
gotchaPolicy schemas are strict; missing required fields like 'id' or 'effect' cause silent failures.
fix
Always validate JSON schema using Policy.validate(json_data) before applying.
affects: >=4.0.0
Upgrade
Version history
4.0.0latest on PyPI · released May 29, 2026
Audit
Dependencies
azure-identityoptionalRequired for authentication in Azure cloud environments
Agent activity
48 hits · last 30 days
node
40
Perplexity
1
Resources
agent-governance-toolkit — pip install agent-governance-toolkit · libregistry