Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions packages/agentmesh-integrations/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
__pycache__/
*.pyc
*.egg-info/
dist/
build/
.venv/
195 changes: 195 additions & 0 deletions packages/agentmesh-integrations/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,195 @@
<div align="center">

# AgentMesh Integrations

> **📦 Migrated:** This package was moved from [imran-siddique/agentmesh-integrations](https://github.com/imran-siddique/agentmesh-integrations) into the monorepo at `packages/agentmesh-integrations/`.


**Platform Plugins & Trust Providers for AgentMesh**

*Dify · LangChain · LangGraph · LlamaIndex · Agent Lightning · OpenAI Agents · OpenClaw · Nostr WoT · Moltbook*

[![GitHub Stars](https://img.shields.io/github/stars/microsoft/agent-governance-toolkit/tree/main/packages/agentmesh-integrations?style=social)](https://github.com/microsoft/agent-governance-toolkit/tree/main/packages/agentmesh-integrations/stargazers)
[![License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
[![Python](https://img.shields.io/badge/python-3.10+-blue.svg)](https://python.org)
[![AgentMesh](https://img.shields.io/badge/agentmesh-compatible-green.svg)](https://github.com/microsoft/agent-governance-toolkit)

> ⭐ **If this project helps you, please star it!** It helps others discover AgentMesh integrations.

> 🔗 **Part of the Agent Ecosystem** — [AgentMesh](https://github.com/microsoft/agent-governance-toolkit) (identity & trust) · [Agent OS](https://github.com/microsoft/agent-governance-toolkit) (governance) · [Agent SRE](https://github.com/microsoft/agent-governance-toolkit) (reliability)

[Integrations](#available-integrations) • [Quick Start](#quick-start) • [Contributing](#contributing-a-new-integration) • [AgentMesh Core](https://github.com/microsoft/agent-governance-toolkit)

</div>

---

## Why a Separate Repo?

AgentMesh core is a lean, zero-external-dependency library. Platform integrations live here because they:

- **Have their own dependencies** — Dify, LangChain, Nostr libraries shouldn't bloat the core
- **Release independently** — A Dify plugin update shouldn't require a core release
- **Accept community contributions** — Lower barrier than modifying core

> **Note:** Framework adapters that wrap agent frameworks with governance (LangChain, CrewAI, LlamaIndex) live inside [Agent OS](https://github.com/microsoft/agent-governance-toolkit/tree/main/src/agent_os/integrations) because they are tightly coupled to the kernel. This repo contains platform-specific *plugins* and external *trust providers*.

## Available Integrations

| Integration | Package | Status | Description |
|---|---|---|---|
| [LangChain](langchain-agentmesh/) | `langchain-agentmesh` | ✅ Stable | Ed25519 identity, trust-gated tools, scope chains, callbacks |
| [LangGraph](langgraph-trust/) | [`langgraph-trust`](https://pypi.org/project/langgraph-trust/) | ✅ Published (PyPI) | Trust-gated checkpoint nodes, governance policy enforcement, trust-aware routing |
| [LlamaIndex](llamaindex-agentmesh/) | `llama-index-agent-agentmesh` | ✅ Merged Upstream | Trust-verified workers, identity-aware query engines, scope chains |
| [Agent Lightning](agent-lightning/) | — | ✅ Merged Upstream | Agent-OS governance adapters, reward shaping, governed RL training |
| [Dify Plugin](dify-plugin/) | `agentmesh-trust-layer` | ✅ Stable | Packaged `.difypkg` with peer verification, step auth, trust scoring |
| [Dify Middleware](dify/) | — | 📦 Archived | Flask middleware (archived — use the plugin instead) |
| [Moltbook](moltbook/) | — | ✅ Stable | AgentMesh governance skill for [Moltbook](https://moltbook.com) agent registry |
| [Nostr Web of Trust](nostr-wot/) | `agentmesh-nostr-wot` | 🚧 Scaffold | Trust scoring via [MaximumSats](https://github.com/joelklabo/maximumsats-mcp) NIP-85 WoT |
| [OpenAI Agents](openai-agents-trust/) | [`openai-agents-trust`](https://pypi.org/project/openai-agents-trust/) | ✅ Published (PyPI) | Trust guardrails, policy enforcement, governance hooks, trust-gated handoffs for OpenAI Agents SDK |
| [OpenClaw Skill](openclaw-skill/) | [`agentmesh-governance`](https://clawhub.ai/imran-siddique/agentmesh-governance) | ✅ Published (ClawHub) | Governance skill for [OpenClaw](https://openclaw.im) agents — policy enforcement, trust scoring, Ed25519 DIDs, hash-chain audit |

## Quick Start

### LangChain — Trust-Gated Tool Execution

```bash
pip install langchain-agentmesh
```

```python
from langchain_agentmesh import VerificationIdentity, TrustGatedTool, TrustedToolExecutor

# Generate cryptographic identity (Ed25519)
identity = VerificationIdentity.generate("research-agent", capabilities=["search", "summarize"])

# Wrap any tool with trust requirements
gated_tool = TrustGatedTool(
tool=search_tool,
required_capabilities=["search"],
min_trust_score=0.8,
)

# Execute with automatic identity verification
executor = TrustedToolExecutor(identity=identity)
result = executor.invoke(gated_tool, "query")
```

### Dify Plugin — Trust Verification in Workflows

1. Download `agentmesh-trust-layer.difypkg` from [`dify-plugin/`](dify-plugin/)
2. Upload via **Settings → Plugins → Install from Package** in Dify
3. Use the trust tools in your workflows:
- **Verify Peer Agent** — Check identity before trusting data
- **Verify Workflow Step** — Authorize each step by capability
- **Record Interaction** — Update trust scores after collaboration
- **Get Agent Identity** — Share your DID with other agents

### Nostr Web of Trust — Decentralized Trust Scoring

```bash
pip install agentmesh-nostr-wot
```

```python
from agentmesh.trust import TrustEngine
from agentmesh_nostr_wot import NostrWoTProvider

# Bridge Nostr WoT scores into AgentMesh trust engine
provider = NostrWoTProvider(wot_api="https://wot.klabo.world")
engine = TrustEngine(external_providers=[provider])

# Composite score: AgentMesh verification + Nostr WoT
score = await engine.get_trust_score("agent-123")
```

---

## Architecture

```
agentmesh (core library) agentmesh-integrations (this repo)
┌──────────────────────┐ ┌─────────────────────────────────┐
│ TrustProvider │◄─implements─│ NostrWoTProvider │
│ VerificationIdentity │◄─uses───────│ LangChain identity.py │
│ TrustEngine │◄─extends────│ Dify trust_manager.py │
│ TransportLayer │◄─implements─│ (future: NATS, gRPC, etc.) │
│ StorageProvider │◄─implements─│ (future: Redis, Postgres, etc.)│
└──────────────────────┘ └─────────────────────────────────┘
Depends on agentmesh core.
Core NEVER imports from here.
```

### Where Do Integrations Live?

| Type | Location | Example |
|---|---|---|
| **Framework adapters** (wrap agent frameworks with governance) | [Agent OS `integrations/`](https://github.com/microsoft/agent-governance-toolkit/tree/main/src/agent_os/integrations) | LangChainKernel, CrewAIKernel |
| **Ecosystem bridges** (connect sibling projects) | [Agent SRE `integrations/`](https://github.com/microsoft/agent-governance-toolkit/tree/main/src/agent_sre/integrations) | Agent OS bridge, AgentMesh bridge |
| **Platform plugins & trust providers** | **This repo** | Dify plugin, Nostr WoT, Moltbook |

---

## Contributing a New Integration

1. Create a directory: `your-integration/`
2. Implement the relevant AgentMesh interface (e.g., `TrustProvider`)
3. Include: `pyproject.toml`, `README.md`, `tests/`, and a working example
4. Open a PR — maintainers will review and help you get it published

### Directory Structure

```
your-integration/
├── agentmesh_your_integration/
│ ├── __init__.py
│ └── provider.py # Implements AgentMesh interface
├── tests/
│ └── test_provider.py
├── pyproject.toml # pip install agentmesh-your-integration
├── README.md
└── examples/
└── basic_usage.py
```

### Interface Contract

All trust providers must implement:

```python
from agentmesh.trust import TrustProvider

class YourProvider(TrustProvider):
async def get_trust_score(self, agent_id: str) -> float:
"""Return trust score between 0.0 and 1.0"""
...

async def verify_identity(self, agent_id: str, credentials: dict) -> bool:
"""Verify agent identity via your system"""
...
```

### Integration Ideas We'd Love to See

- **Redis/PostgreSQL storage** — Persistent trust scores and audit logs
- **NATS/gRPC transport** — High-performance agent-to-agent messaging
- **OpenAI Agents SDK** — Trust-gated function calling for OpenAI agents
- **Autogen** — Trust verification in multi-agent conversations
- **A2A Protocol** — Google's Agent-to-Agent protocol bridge

---

## License

MIT — same as AgentMesh core.

---

<div align="center">

**Trust is the foundation. These integrations bring it to your platform.**

[AgentMesh](https://github.com/microsoft/agent-governance-toolkit) · [Agent OS](https://github.com/microsoft/agent-governance-toolkit) · [Agent SRE](https://github.com/microsoft/agent-governance-toolkit)

</div>
37 changes: 37 additions & 0 deletions packages/agentmesh-integrations/a2a-protocol/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# A2A AgentMesh

A2A protocol bridge for AgentMesh — trust-verified agent-to-agent communication via the [A2A standard](https://a2a-protocol.org/).

## Features

- **AgentCard**: Convert AgentMesh identities to A2A-compliant discovery cards
- **TaskEnvelope**: Trust-verified task lifecycle (submitted → working → complete/failed)
- **TrustGate**: Policy enforcement for A2A task negotiations (trust scores, rate limits, DID allow/deny)

## Quick Start

```python
from a2a_agentmesh import AgentCard, TaskEnvelope, TrustGate, TrustPolicy

# Publish your agent as an A2A card
card = AgentCard.from_identity(
did="did:mesh:my-agent",
name="TranslationAgent",
capabilities=["translate", "summarize"],
trust_score=800,
)

# Create a trust-verified task
task = TaskEnvelope.create(
skill_id="translate",
source_did="did:mesh:requester",
target_did=card.agent_did,
source_trust_score=600,
input_text="Translate 'hello' to Spanish",
)

# Gate the request
gate = TrustGate(TrustPolicy(min_trust_score=500))
result = gate.evaluate(task)
assert result.allowed
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
"""
a2a-agentmesh: A2A Protocol Bridge for AgentMesh
=================================================

Maps AgentMesh identities and trust verification to the
Google A2A (Agent-to-Agent) protocol standard.

Components:
- AgentCard: A2A-compliant agent discovery cards
- TaskEnvelope: Trust-verified task request/response wrappers
- TrustGate: Policy enforcement for A2A task negotiations
"""

from a2a_agentmesh.agent_card import AgentCard, AgentSkill
from a2a_agentmesh.task import (
TaskEnvelope,
TaskState,
TaskMessage,
)
from a2a_agentmesh.trust_gate import TrustGate, TrustPolicy, TrustResult

__all__ = [
"AgentCard",
"AgentSkill",
"TaskEnvelope",
"TaskState",
"TaskMessage",
"TrustGate",
"TrustPolicy",
"TrustResult",
]
Loading
Loading