Skip to content

Python: [Python][Agents] AgentMesh: Trust and Governance Layer#13517

Closed
imran-siddique wants to merge 2 commits intomicrosoft:mainfrom
imran-siddique:contrib/agent-os-governance
Closed

Python: [Python][Agents] AgentMesh: Trust and Governance Layer#13517
imran-siddique wants to merge 2 commits intomicrosoft:mainfrom
imran-siddique:contrib/agent-os-governance

Conversation

@imran-siddique
Copy link
Copy Markdown
Member

Summary

Adds agentmesh module to \semantic_kernel.agents\ providing cryptographic identity verification and governance controls for Semantic Kernel agents.

Features

Trust Layer

  • CMVKIdentity: Ed25519-based cryptographic identity
  • TrustedAgentCard: Agent discovery and verification
  • TrustHandshake: Peer verification protocol

Governance Layer

  • GovernancePolicy: Comprehensive policy configuration
  • GovernedAgent: Agent wrapper with policy enforcement
  • GovernanceKernel: Kernel wrapper with governance controls

Governance Capabilities

Feature Description
Rate Limiting Per-minute and per-hour limits
Function Control Allow/deny lists for functions
Resource Limits Concurrent tasks, memory limits
Audit Logging Full invocation audit trail
Trust Requirements Identity verification, trust scores

Example

\\python
from semantic_kernel.agents.agentmesh import (
CMVKIdentity,
GovernedAgent,
GovernancePolicy,
)

identity = CMVKIdentity.generate('assistant', capabilities=['chat'])

policy = GovernancePolicy(
max_requests_per_minute=30,
allowed_functions=['chat'],
audit_all_invocations=True,
)

governed = GovernedAgent(agent=base_agent, identity=identity, policy=policy)
\\

Related

Adds agentmesh module to semantic_kernel.agents providing:
- CMVKIdentity: Cryptographic identity with Ed25519 keys
- TrustedAgentCard: Agent discovery and verification
- TrustHandshake: Peer verification protocol
- GovernancePolicy: Rate limiting, capability control, auditing
- GovernedAgent: Agent wrapper with governance enforcement
- GovernanceKernel: Kernel wrapper with policy enforcement

Features:
- Rate limiting (per-minute and per-hour)
- Function allow/deny lists
- Resource limits (concurrent tasks, memory)
- Full audit logging
- Trust score thresholds
- Policy violation tracking
@imran-siddique imran-siddique requested a review from a team as a code owner February 6, 2026 21:48
@moonbox3 moonbox3 added python Pull requests for the Python Semantic Kernel documentation labels Feb 6, 2026
@github-actions github-actions bot changed the title [Python][Agents] AgentMesh: Trust and Governance Layer Python: [Python][Agents] AgentMesh: Trust and Governance Layer Feb 6, 2026
@moonbox3
Copy link
Copy Markdown
Collaborator

moonbox3 commented Feb 6, 2026

@imran-siddique
Copy link
Copy Markdown
Member Author

Ready for Final Review 🙏

This PR has been open for a while. The AgentMesh trust layer integration is complete and tested.

Could a maintainer please provide a final review? Happy to address any remaining concerns.

Thank you!

@moonbox3
Copy link
Copy Markdown
Collaborator

moonbox3 commented Feb 7, 2026

What's the requirement/need driving this?

@imran-siddique
Copy link
Copy Markdown
Member Author

Great question! The need comes from several production multi-agent scenarios:

Key Requirements

  1. Identity Verification - When agents communicate (A2A, multi-agent orchestration), there's no built-in way to verify "who" you're talking to. Without cryptographic identity, any process can claim to be any agent.

  2. Trust-Gated Operations - Sensitive operations (code execution, data access, external API calls) should only be allowed from verified, trusted agents. This module provides configurable trust thresholds per operation.

  3. Audit Compliance - Enterprise deployments need full audit trails of all agent invocations for compliance (GDPR, HIPAA, SOX). The governance layer logs every action with identity tracking.

  4. Rate Limiting & Resource Control - Prevent runaway agents from exhausting resources. The policy layer enforces per-minute/per-hour limits and concurrent task bounds.

Real Example

In a multi-agent system where:

  • Agent A requests Agent B to execute code
  • Agent B should verify Agent A is trusted before execution
  • All interactions must be logged for audit

This module makes that possible with minimal code changes:

\\python
governed = GovernedAgent(agent=base_agent, identity=identity, policy=policy)

Now all invocations are identity-verified, policy-checked, and audit-logged

\\

Similar integrations have been merged/submitted to AutoGen, CrewAI, A2A, and others. Happy to discuss specific use cases!

@imran-siddique
Copy link
Copy Markdown
Member Author

Great question @moonbox3! The driving need is runtime governance for AI agents — specifically:

  1. Compliance requirements: Enterprises deploying SK-based agents need deterministic policy enforcement (not just prompt-based guardrails) for regulated industries (finance, healthcare, government)

  2. Safety at the kernel function level: Current approaches rely on the LLM to follow instructions, but agent-os intercepts before execution — if a kernel function would violate policy (e.g., accessing forbidden resources, exceeding token budgets), it's blocked deterministically

  3. Audit trail: Every kernel function invocation, policy decision, and tool call is logged with cryptographic integrity — critical for SOC2/ISO compliance

  4. Real-world demand: We've seen this pattern requested across multiple frameworks — we have similar integrations open for AutoGen (.Net: Ollama Connector : Added metadata, integration tests + more adjustments #7212), CrewAI, LangChain, and LlamaIndex. The A2A protocol team at Google is also reviewing our trust layer approach.

The integration is lightweight (~200 lines) and opt-in — it wraps existing SK kernel functions without changing their behavior unless a policy violation is detected.

Happy to discuss further or adjust the approach!

@moonbox3
Copy link
Copy Markdown
Collaborator

moonbox3 commented Feb 9, 2026

Thanks for the contribution, @imran-siddique. These types of features usually have a longer tail in design/implementation: we need to review the requirement with the team, capture design in an ADR (while looking at different ways to design it), and make sure things also align with .NET. Our focus is currently on the Microsoft Agent Framework. We aren't bringing new features like this in to Semantic Kernel.

@moonbox3 moonbox3 closed this Feb 9, 2026
@imran-siddique
Copy link
Copy Markdown
Member Author

Thanks @moonbox3 for reviewing! I understand this may not align with the project's current priorities. I'll keep improving the governance layer independently and would love to revisit this when there's a clearer need from the SK ecosystem. Appreciate your time!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation python Pull requests for the Python Semantic Kernel

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants