Skip to content

Microsoft AGT Integration

MeshGuard treats Microsoft Agent Governance Toolkit (AGT) as a first-class policy enforcement point. AGT runs inside the agent process. MeshGuard runs the neutral control plane for policy decisions, audit ingestion, identity, trust scoring, and fleet operations.

Install

bash
pip install meshguard-agt

Configure

python
import os
from meshguard_agt import configure_agt_with_meshguard

kernel = configure_agt_with_meshguard(
    gateway_url="https://gateway.meshguard.app",
    tenant_id="acme-corp",
    agent_token=os.environ["MESHGUARD_AGENT_TOKEN"],
    features=["policy", "audit", "identity", "trust", "mcp"],
)

What The Adapter Provides

AGT extension pointMeshGuard implementationControl-plane behavior
Policy evaluatorMeshGuardPolicyBackendCalls MeshGuard PDP and caches decisions by policy version and context hash.
Audit sinkMeshGuardAuditSinkBatches decision events to audit ingestion with WAL-backed recovery.
Identity providerMeshGuardIdentityProviderIssues and verifies JWT agent identity now, SPIFFE SVID mode when enabled.
Trust oracleMeshGuardTrustOracleReads live trust tier and trust score from MeshGuard.
MCP gatewayMeshGuardMCPGatewayDelegates MCP tool risk, drift, and typosquatting checks to MeshGuard.

PDP Contract

AGT calls the same contract as every other MeshGuard client:

protobuf
service MeshGuardPDP {
  rpc Evaluate(PolicyRequest) returns (PolicyResponse);
  rpc EvaluateStream(stream PolicyRequest) returns (stream PolicyResponse);
  rpc Subscribe(PolicySubscription) returns (stream PolicyChangeEvent);
}

HTTP fallback is available at POST /api/v1/pdp/evaluate for environments where gRPC is blocked.

Failure Modes

fail-closed is the default and should be used in production. fail-open is available only for low-risk migration windows and writes a failure-mode audit event.

python
from meshguard_agt.backends.policy import MeshGuardPolicyBackend

backend = MeshGuardPolicyBackend(
    gateway_url="https://gateway.meshguard.app",
    tenant_id="acme-corp",
    agent_token=os.environ["MESHGUARD_AGENT_TOKEN"],
    failure_mode="fail-closed",
    timeout_ms=50,
)

Migration

Local AGT YAML remains valid. Move the file into a Git-backed policy repo, run meshguard policy lint, then use meshguard policy lift to stage it in MeshGuard. See Migrating from AGT local policies.

Governance Control Plane for AI Agents