在具有加密身份和防篡改传输的 AI 代理之间提供端到端加密、经过身份验证和前向保密的消息传递。
数据来源:ClawHub。 在 ClawSkills 查看
选择你使用的 Agent
方法一:命令行安装(推荐)
推荐(无需提前安装 clawhub)
npx clawhub@latest --dir ~/.claude/skills install agentmesh或使用 clawhub CLI(需提前安装)
clawhub --dir ~/.claude/skills install agentmesh⚠️ 需要 Node.js 18+,没有 Node?请使用下方方法二直接下载 ZIP。 安装 Node.js →
方法二:手动下载安装(无需 Node)
下载 ZIP,解压后将文件夹放到以下路径,重启 Agent 即可:
安装路径
~/.claude/skills/agentmesh/💡解压后将文件夹放到上方路径,重启 Agent 即可生效
> WhatsApp-style end-to-end encrypted messaging for AI agents. > GitHub: https://github.com/cerbug45/AgentMesh | Author: cerbug45
---
AgentMesh gives every AI agent a cryptographic identity and lets agents exchange messages that are:
| Property | Mechanism | |---|---| | Encrypted | AES-256-GCM authenticated encryption | | Authenticated | Ed25519 digital signatures (per message) | | Forward-secret | X25519 ECDH ephemeral session keys | | Tamper-proof | AEAD authentication tag | | Replay-proof | Nonce + counter deduplication | | Private | The Hub (broker) never sees message contents |
No TLS certificates. No servers required for local use. One pip install.
---
pippip install git+https://github.com/cerbug45/AgentMesh.git
git clone https://github.com/cerbug45/AgentMesh.git
cd AgentMesh
pip install .
git clone https://github.com/cerbug45/AgentMesh.git
cd AgentMesh
pip install -e ".[dev]"
pytest # run all tests
python -c "import agentmesh; print(agentmesh.__version__)"
# → 1.0.0
---
from agentmesh import Agent, LocalHub
hub = LocalHub() # in-process broker
alice = Agent("alice", hub=hub) # keys generated automatically
bob = Agent("bob", hub=hub)
@bob.on_message
def handle(msg):
print(f"[{msg.recipient}] ← {msg.sender}: {msg.text}")
alice.send("bob", text="Hello, Bob! This is end-to-end encrypted.")
Output:
[bob] ← alice: Hello, Bob! This is end-to-end encrypted.
---
An Agent is an AI agent with a cryptographic identity (two key pairs):
from agentmesh import Agent, LocalHub
hub = LocalHub()
alice = Agent("alice", hub=hub)
# See the agent's fingerprint (share out-of-band to verify identity)
print(alice.fingerprint)
# → a1b2:c3d4:e5f6:g7h8:i9j0:k1l2:m3n4:o5p6
A Hub is the message router. It stores public key bundles (for discovery) and routes encrypted envelopes. It cannot decrypt messages.
| Hub | Use case | |---|---| | LocalHub | Single Python process (demos, tests, notebooks) | | NetworkHub | Multi-process / multi-machine (production) |
@bob.on_message
def handle(msg):
msg.sender # str – sender agent_id
msg.recipient # str – recipient agent_id
msg.text # str – shortcut for msg.payload["text"]
msg.type # str – shortcut for msg.payload["type"] (default: "message")
msg.payload # dict – full decrypted payload
msg.timestamp # int – milliseconds since epoch
---
alice.send(
"bob",
text = "Run this task",
task_id = 42,
priority = "high",
data = {"key": "value"},
)
All keyword arguments beyond text are included in msg.payload.
# Handler as decorator
@alice.on_message
def handler_one(msg):
...
# Handler as lambda
alice.on_message(lambda msg: print(msg.text))
# Multiple handlers – all called in registration order
alice.on_message(log_handler)
alice.on_message(process_handler)
Save keys to disk so an agent has the same identity across restarts:
alice = Agent("alice", hub=hub, keypair_path=".keys/alice.json")
# List all agents registered on the hub
peers = alice.list_peers() # → ["bob", "carol", "dave"]
# Check agent status
print(alice.status())
# {
# "agent_id": "alice",
# "fingerprint": "a1b2:…",
# "active_sessions": ["bob"],
# "known_peers": ["bob"],
# "handlers": 2
# }
---
On the broker machine (or in its own terminal):
# Option A – module
python -m agentmesh.hub_server --host 0.0.0.0 --port 7700
# Option B – entry-point (after pip install)
agentmesh-hub --host 0.0.0.0 --port 7700
# Machine A
from agentmesh import Agent, NetworkHub
hub = NetworkHub(host="192.168.1.10", port=7700)
alice = Agent("alice", hub=hub)
# Machine B (different process / different computer)
from agentmesh import Agent, NetworkHub
hub = NetworkHub(host="192.168.1.10", port=7700)
bob = Agent("bob", hub=hub)
bob.on_message(lambda m: print(m.text))
alice.send("bob", text="Cross-machine encrypted message!")
┌──────────────────────────────────────────────────────┐
│ NetworkHubServer │
│ Stores public bundles. Routes encrypted envelopes. │
│ Cannot read message contents. │
└──────────────────────┬───────────────────────────────┘
│ TCP (newline-delimited JSON)
┌───────────┼───────────┐
│ │ │
Agent A Agent B Agent C
(encrypted) (encrypted) (encrypted)
---
┌─────────────────────────────────────────────────────┐
│ Application layer (dict payload) │
├─────────────────────────────────────────────────────┤
│ Ed25519 signature (sender authentication) │
├─────────────────────────────────────────────────────┤
│ AES-256-GCM (confidentiality + integrity) │
├─────────────────────────────────────────────────────┤
│ HKDF-SHA256 key derivation (directional keys) │
├─────────────────────────────────────────────────────┤
│ X25519 ECDH (shared secret / forward secrecy) │
└─────────────────────────────────────────────────────┘
| Attack | Defence | |---|---| | Eavesdropping | AES-256-GCM encryption | | Message tampering | AES-GCM authentication tag (AEAD) | | Impersonation | Ed25519 signature on every message | | Replay attack | Nonce + monotonic counter deduplication | | Key compromise | X25519 ephemeral sessions (forward secrecy) | | Hub compromise | Hub stores only public keys; cannot decrypt |
---
| File | What it shows | |---|---| | examples/01_simple_chat.py | Two agents, basic send/receive | | examples/02_multi_agent.py | Coordinator + 4 workers, task distribution | | examples/03_persistent_keys.py | Keys saved to disk, identity survives restart | | examples/04_llm_agents.py | LLM agents (OpenAI / any API) in a pipeline |
Run any example:
python examples/01_simple_chat.py
---
Agent(agent_id, hub=None, keypair_path=None, log_level=WARNING)...
安装 代理网格 后,可以对 AI 说这些话来触发它
Help me get started with AgentMesh
Explains what AgentMesh does, walks through the setup, and runs a quick demo based on your current project
Use AgentMesh to end-to-end encrypted, authenticated, and forward-secret messaging b...
Invokes AgentMesh with the right parameters and returns the result directly in the conversation
What can I do with AgentMesh in my finance & investment workflow?
Lists the top use cases for AgentMesh, with example commands for each scenario
将技能文件夹放到 ~/.claude/skills/agentmesh/ 目录(个人级,所有项目可用),或 .claude/skills/agentmesh/(项目级)。重启 AI 客户端后,用 /agentmesh 主动调用,或让 AI 根据上下文自动发现并使用。
代理网格 支持 Claude、Cursor、OpenClaw,可与这些 AI 平台无缝集成,扩展其能力。
代理网格 可免费安装使用。请查阅仓库了解许可证信息。
在具有加密身份和防篡改传输的 AI 代理之间提供端到端加密、经过身份验证和前向保密的消息传递。
代理网格 属于「Finance & Investment」分类,该分类的技能帮助 AI 智能体在此领域执行专业任务。
Automate my finance & investment tasks using AgentMesh
Identifies repetitive steps in your workflow and sets up AgentMesh to handle them automatically