Microsoft Agent Framework Integration Guide

Integrate ACGP with Microsoft Agent Framework for production-grade governance in Azure.


Overview

Microsoft Agent Framework provides production-ready agents with policies, orchestrations, and Azure integration. ACGP adds comprehensive governance with telemetry and policy bridging.


Installation

pip install acgp-ms-agents

# With Azure telemetry
pip install acgp-ms-agents[azure]

Coming Soon

TypeScript Microsoft Agent Framework integration is planned for a future release. Python is available now.


Basic Usage

from azure.ai.agent import Agent
from acgp_ms_agents import ACGPAgent
from acgp import GovernanceSteward

# Your MS Agent
agent = Agent(
    name="assistant",
    description="Production assistant"
)

# Add governance
steward = GovernanceSteward(blueprint_file="blueprint.yaml")
governed_agent = ACGPAgent(agent, steward)

# Execute with governance
result = governed_agent.execute("Process request")

Features

Azure Telemetry Integration

Send governance events to Application Insights:

from acgp_ms_agents.telemetry import ACGPTelemetry

telemetry = ACGPTelemetry(
    connection_string="InstrumentationKey=...",
    enable_azure=True
)

agent = ACGPAgent(agent, steward, telemetry=telemetry)

Orchestration Governance

Govern multi-agent workflows:

from acgp_ms_agents.orchestration import GovernedOrchestration

orchestration = MyMSOrchestration()
governed_orch = GovernedOrchestration(orchestration, steward)

result = governed_orch.run(input_data)

Async Support

from acgp_ms_agents.async_wrapper import AsyncGovernedAgent

async_agent = AsyncGovernedAgent(agent, steward)
result = await async_agent.execute("Async task")

Azure Integration

Application Insights

Track governance metrics in Azure:

from acgp_ms_agents.telemetry import ACGPTelemetry

telemetry = ACGPTelemetry(
    connection_string=os.environ['APPLICATIONINSIGHTS_CONNECTION_STRING'],
    enable_azure=True
)

# Metrics automatically sent to Azure
agent = ACGPAgent(agent, steward, telemetry=telemetry)

Monitoring Dashboard

View governance metrics in Azure Portal:

  • Intervention counts by type
  • Agent performance metrics
  • Trust debt tracking
  • Escalation patterns

Advanced Features

Get Governance Metrics

metrics = governed_agent.get_metrics()
print(f"Agent: {metrics['agent_name']}")
print(f"Total interventions: {metrics['total_interventions']}")

Exception Handling

from acgp_ms_agents.exceptions import InterventionError

try:
    result = governed_agent.execute("Risky task")
except InterventionError as e:
    print(f"Action blocked: {e.message}")
    print(f"Trace ID: {e.trace_id}")

Control Intervention Behavior

# Don't raise exceptions on interventions
governed_agent = ACGPAgent(
    agent,
    steward,
    raise_on_intervention=False  # Log instead of raising
)

Telemetry Methods

# Track custom metrics
telemetry.track_metric('custom_metric', 42, {'context': 'info'})

# Track exceptions
try:
    risky_operation()
except Exception as e:
    telemetry.track_exception(e, {'agent': agent_name})

Best Practices

Production Deployment

Always enable Azure telemetry in production for observability.

Performance

Monitor latency impact - use governance contracts for SLA enforcement.

Telemetry Client

Install applicationinsights package for Azure integration: pip install applicationinsights


Enterprise Features

  • Azure Integration: Full Application Insights telemetry
  • Telemetry: Real-time governance metrics and events
  • Monitoring: Track interventions, blocks, and escalations
  • Orchestration: Multi-agent workflow governance
  • Compliance: Audit trails for regulated industries
  • Async Support: Full async/await compatibility

Back to Integration Overview