Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/microsoft/agent-governance-toolkit/llms.txt

Use this file to discover all available pages before exploring further.

AGT runs as in-process middleware or as a sidecar container alongside your agent. In-process middleware is ideal when you’re using a managed agent framework (Azure AI Foundry, AWS Bedrock, Vertex AI) and want zero sidecar overhead. The sidecar pattern — running governance in a separate container that shares a network namespace with your agent — is the production recommendation because it provides OS-level isolation between the governance layer and the agent code. AGT has zero cloud-vendor dependencies. It is pure Python/TypeScript/.NET/Rust/Go and runs anywhere containers run: Azure, AWS, GCP, on-premises, or your laptop.
# Local development
pip install agent-governance-toolkit[full]

Deployment Patterns

┌────────────────────────────────────────────────────────────────────────┐
│  Any Cloud (Azure / AWS / GCP / On-Prem)                              │
│                                                                        │
│  ┌──────────────────┐  ┌──────────────────┐  ┌─────────────────────┐  │
│  │ Kubernetes (AKS/ │  │ Serverless (ACA/ │  │ Agent Framework     │  │
│  │ EKS/GKE)         │  │ Fargate/CloudRun)│  │ (Foundry/Bedrock/   │  │
│  │                  │  │                  │  │  Vertex)            │  │
│  │ ┌─────┐┌─────┐  │  │ ┌─────┐┌──────┐ │  │                     │  │
│  │ │Agent││Gov  │  │  │ │Agent││Gov   │ │  │  ┌─────────────┐   │  │
│  │ │     ││Side-│  │  │ │     ││Side- │ │  │  │ Governance  │   │  │
│  │ │     ││car  │  │  │ │     ││car   │ │  │  │ Middleware   │   │  │
│  │ └─────┘└─────┘  │  │ └─────┘└──────┘ │  │  └─────────────┘   │  │
│  │  Pod / Task      │  │  Container Group │  │   In-Process       │  │
│  └──────────────────┘  └──────────────────┘  └─────────────────────┘  │
└────────────────────────────────────────────────────────────────────────┘
PatternBest For
Kubernetes (AKS/EKS/GKE)Production multi-agent systems, enterprise HA, full AgentMesh mesh
Serverless (Container Apps/Fargate/Cloud Run)Scale-to-zero, prototyping, single-agent scenarios
In-Process MiddlewareManaged frameworks (Foundry, Bedrock, Vertex), zero-sidecar overhead

Deployment Targets

Azure Container Apps runs the governance toolkit as a sidecar container within a Container Apps Environment. Both containers share a network namespace and communicate over localhost.Prerequisites: Azure CLI 2.60+ with the containerapp extension.
# Install/update the Container Apps extension
az extension add --name containerapp --upgrade
az provider register --namespace Microsoft.App
az provider register --namespace Microsoft.OperationalInsights
Environment setup:
RESOURCE_GROUP="rg-agent-governance"
LOCATION="eastus"
ENVIRONMENT="agent-gov-env"
REGISTRY="agentgovregistry"

az group create --name $RESOURCE_GROUP --location $LOCATION
az acr create --name $REGISTRY --resource-group $RESOURCE_GROUP \
  --sku Basic --admin-enabled true

az containerapp env create \
  --name $ENVIRONMENT \
  --resource-group $RESOURCE_GROUP \
  --location $LOCATION
Container App with governance sidecar (container-app.yaml):
properties:
  configuration:
    ingress:
      external: true
      targetPort: 8080
    registries:
      - server: agentgovregistry.azurecr.io
        identity: system
  template:
    containers:
      # Primary: Your AI agent
      - name: agent
        image: agentgovregistry.azurecr.io/your-agent:latest
        resources:
          cpu: 1.0
          memory: 2Gi
        env:
          - name: GOVERNANCE_ENDPOINT
            value: http://localhost:8081
          - name: AGENT_ID
            value: my-agent-001
          - name: AZURE_CLIENT_ID
            secretRef: azure-client-id
          - name: AZURE_TENANT_ID
            secretRef: azure-tenant-id

      # Sidecar: Governance toolkit
      - name: governance-sidecar
        image: agentgovregistry.azurecr.io/agent-governance-sidecar:latest
        resources:
          cpu: 0.25
          memory: 0.5Gi
        env:
          - name: POLICY_DIR
            value: /policies
          - name: TRUST_SCORE_THRESHOLD
            value: "0.6"
          - name: RATE_LIMIT_PER_MINUTE
            value: "100"
        volumeMounts:
          - volumeName: policy-volume
            mountPath: /policies

    scale:
      minReplicas: 0   # 0 for dev, 2 for prod
      maxReplicas: 10
      rules:
        - name: http-rule
          http:
            metadata:
              concurrentRequests: "50"

    volumes:
      - name: policy-volume
        storageType: AzureFile
        storageName: policy-share
Deploy:
az containerapp create \
  --name my-governed-agent \
  --resource-group $RESOURCE_GROUP \
  --environment $ENVIRONMENT \
  --yaml container-app.yaml
Mount policies via Azure Files:
az storage account create \
  --name agentgovpolicies \
  --resource-group $RESOURCE_GROUP \
  --sku Standard_LRS

az storage share create --name policies --account-name agentgovpolicies
az storage file upload-batch \
  --destination policies \
  --source ./policies/ \
  --account-name agentgovpolicies
Query governance events in Log Analytics:
ContainerAppConsoleLogs_CL
| where ContainerName_s == "governance-sidecar"
| where Log_s contains "DENIED"
| summarize ViolationCount = count() by bin(TimeGenerated, 1h)
| render timechart

Environment Variables

VariablePurposeRequired For
AZURE_CLIENT_IDService principal / managed identity client IDAzure-integrated features (Key Vault, Monitor)
AZURE_TENANT_IDAzure Active Directory tenant IDAzure-integrated features
AZURE_CLIENT_SECRETService principal secretService principal auth (use managed identity in prod)
AGT_POLICY_PATHPath to the policies directoryAll deployments
AGT_LOG_LEVELLog verbosity: debug, info, auditAll deployments
TRUST_SCORE_THRESHOLDMinimum trust score for tool accessTrust-gated deployments
RATE_LIMIT_PER_MINUTEGlobal rate limit capRate-limited deployments

Production Recommendations

Container-per-Agent

Run each agent in a separate container. AGT enforces governance at the application middleware layer — the policy engine and agents share the same process boundary. OS-level isolation requires separate containers.

Policy File Mounts

Store policy YAML files in your secret store or a read-only volume mount. Version-control policies alongside your agent code so every deployment has an auditable policy history.

Audit Log Sinks

Route the AGT audit log to a tamper-evident sink (Azure Monitor, CloudWatch, SIEM). The Merkle-chained audit trail is only useful if it’s forwarded somewhere you control.

Managed Identity

Use workload identity / managed identity instead of static secrets for Azure-integrated features. Never store AZURE_CLIENT_SECRET in environment variables in production containers.

Sidecar Resource Sizing

SettingRecommendationNotes
Sidecar CPU0.25 coresGovernance adds < 0.1ms p99 latency
Sidecar Memory512MiSufficient for policy engine + trust scoring
minReplicas0 for dev, 2 for prodScale-to-zero saves cost in dev

Example Policy for Production

# policies/default.yaml
version: "1.0"
policies:
  - name: rate-limit
    type: rate_limit
    max_calls: 100
    window: 1m

  - name: read-only
    type: capability
    allowed_actions:
      - "read_*"
      - "search_*"
      - "list_*"
    denied_actions:
      - "delete_*"
      - "write_production_*"

  - name: content-safety
    type: pattern
    blocked_patterns:
      - "ignore previous instructions"
      - "DROP TABLE"
      - "rm -rf"

Security Boundaries

AGT enforces governance at the application middleware layer. It is not an OS-level security boundary.
LayerWhat It Enforces
AGT (application layer)Policy rules, tool allow/deny, rate limits, audit logging, trust scoring, prompt injection detection
OS / ContainerProcess isolation, network namespace, filesystem permissions, kernel-level syscall filtering
Cloud IAMWhich cloud services the container identity can reach
The policy engine and agents share the same process boundary when running in-process. For strong isolation — where a compromised agent cannot tamper with the governance layer — run governance and the agent in separate containers with no shared writable filesystem. See Architecture: Security Boundaries and Known Limitations for a complete description of design boundaries and recommended layered defense.

Build docs developers (and LLMs) love