Skip to main content
agent-mesh

agent-mesh

Cryptographic peer-to-peer agent coordination.

No broker. No scp'd tokens. No centralized configuration.

CI PyPI License


A small Rust workspace that gives multi-agent systems a shared root of trust (ed25519 user key, cross-signed by your existing GitHub SSH key) and direct, verifiable peer messaging.

Two agents that share a user identity discover each other on the LAN, authenticate via cert chain at the QUIC handshake, and exchange signed envelopes — without a broker in the middle and without scp'ing tokens around.

CLI: amesh (workspace member agent-mesh-cli). Libraries:

  • agent-mesh-protocol — identity types, signed envelopes.
  • agent-mesh-discovery — LAN discovery via mDNS.
  • agent-mesh-transport — authenticated QUIC transport via iroh.
  • agent-mesh-bus — high-level pub/sub + request/reply.
  • agent-mesh-py — Python bindings (PyPI package agent-mesh).

License: Apache-2.0.

Python install

pip install newt-agent-mesh

(The PyPI distribution name is newt-agent-mesh because agent-mesh is blocked by PyPI's similarity check — see the note in pyproject.toml. The Python import path is unchanged: import agent_mesh.core.)

This installs the Python package agent_mesh with submodules .core, .discovery, .transport, .bus. The amesh CLI binary ships separately — install it with cargo install agent-mesh-cli if you want it on $PATH.

Rust install

The library crates are on crates.io:

# Cargo.toml
[dependencies]
agent-mesh-protocol = "0.5"   # ed25519 identity, signed envelopes
agent-mesh-discovery = "0.5"  # mDNS LAN discovery
agent-mesh-transport = "0.5"  # authenticated QUIC via iroh
agent-mesh-bus = "0.5"        # high-level pub/sub + request/reply

The amesh CLI:

cargo install agent-mesh-cli   # binary lands as `amesh` on PATH

(The -protocol suffix on the foundation crate is because agent-mesh-core on crates.io is owned by an unrelated project. The Rust crate name is agent-mesh-protocol; the Python user-facing submodule it powers is still agent_mesh.core.)

Discovery (Phase 1)

amesh can announce itself on the LAN and list every other agent it sees there, with no broker or central registry. Service type: _agent-mesh._udp.local.

# Terminal A — announce this agent for 5 minutes, advertising
# `ollama` and `vllm` capabilities under the role `inference-worker`.
amesh announce --capability ollama --capability vllm \
                --role inference-worker --duration 5m

# Terminal B — list everyone on the LAN for the next 5 seconds.
amesh peers --listen 5s

# Or only those sharing our user fingerprint:
amesh peers --listen 5s --same-user

Sample amesh peers output:

listening for peers for 5s...

discovered 2 peer(s):

AGENT          SAME?  ROLE@HOST                     PORT   CAPABILITIES
abcd12345678   yes    inference-worker@host-a       0      ollama,vllm
ef9876543210   no     orchestrator@host-b           0      orchestrator

The fingerprints in mDNS TXT records are claims; verification happens during the Phase 2 transport handshake (below).

Transport (Phase 2)

Phase 2 layers an authenticated QUIC transport on top of Phase 1 discovery. Two architectural notes:

  • The agent's ed25519 signing key doubles as its iroh EndpointId, so a peer who knows your agent fingerprint already knows enough to address your iroh endpoint. No separate "node ID" to manage.
  • After ALPN negotiation (agent-mesh/v1), both ends exchange cert chains and enforce the auto-team rule fail-closed: if peer user_pubkey != ours and no pact exists, the handshake rejects before any payload data crosses the boundary.

The CLI splits "I want to be discovered" from "I want to be reachable":

Subcommand Discoverable? Reachable (QUIC)?
amesh announce yes no (publishes port 0)
amesh listen yes yes (binds + announces)

End-to-end smoke (same user on two terminals):

# Terminal A — bind QUIC, announce on mDNS, accept envelopes
amesh listen --duration 60s
# prints:
#   listening on udp/<port>
#     agent_fp=<fp>
#     user_fp =<user_fp>

# Terminal B — within that 60s window:
amesh send <fp-from-terminal-A> --payload '{"hello":"world"}'
# Terminal A then prints one JSON line per received envelope:
#   {"sender_agent_fp":"...","sender_user_fp":"...","sequence":0,
#    "payload":{"encoding":"utf8","text":"{\"hello\":\"world\"}"}}

If you point amesh send at a peer that belongs to a different user, the handshake closes the connection cleanly and both sides report auto-team check failed: ....

Python Usage

Install the wheel:

pip install newt-agent-mesh

(See the install section above for why the distribution name is newt-agent-mesh and not agent-mesh. The import path is unchanged.)

Identity round-trip — no network required:

import agent_mesh.core as core

# Generate a user key (root of trust).
user = core.UserKey.generate()
print("user fp:", user.fingerprint().hex())

# Issue an agent key signed by that user.
meta = core.AgentMetadata(
    role="my-agent",
    host="my-machine",
    capabilities=["inference"],
    issued_at="2026-05-29T00:00:00Z",
)
agent = core.AgentKey.issue(user, meta)
print("agent fp:", agent.fingerprint().hex())

# Build and verify a signed envelope.
recipient = core.Recipient.topic("hello/world")
env = core.SignedEnvelope(agent, recipient, sequence=1, payload=b"hi")
env.verify()  # raises core.MeshError on tamper

Request/reply over an authenticated mesh — needs mDNS on the LAN:

import asyncio
import agent_mesh.core as core
import agent_mesh.bus as bus


async def main() -> None:
    user = core.UserKey.generate()
    meta = core.AgentMetadata(
        role="echo",
        host="localhost",
        capabilities=["test"],
        issued_at="2026-05-29T00:00:00Z",
    )
    server_agent = core.AgentKey.issue(user, meta)
    client_agent = core.AgentKey.issue(user, meta)

    server_bus = await bus.Bus.bind(user, server_agent, 0)
    client_bus = await bus.Bus.bind(user, client_agent, 0)

    topic = bus.Topic(user.fingerprint(), "echo")
    server_bus.handle_requests(topic, lambda body: b"echo: " + body)

    # Let mDNS settle.
    await asyncio.sleep(0.5)

    reply = await client_bus.request(
        server_bus.agent_fingerprint(),
        topic,
        b"hi",
        timeout_ms=5000,
    )
    print(reply)  # b'echo: hi'

    await server_bus.close()
    await client_bus.close()


asyncio.run(main())

The handler must return bytes directly. Async handlers (callables that return a coroutine) are recognized and rejected in this release; wrap any async work in asyncio.run(...) inside the sync handler.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

newt_agent_mesh-0.6.3.tar.gz (164.7 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

newt_agent_mesh-0.6.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (7.2 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

newt_agent_mesh-0.6.3-cp312-cp312-macosx_11_0_arm64.whl (5.5 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

newt_agent_mesh-0.6.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (7.2 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

newt_agent_mesh-0.6.3-cp311-cp311-macosx_11_0_arm64.whl (5.5 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

newt_agent_mesh-0.6.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (7.2 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

newt_agent_mesh-0.6.3-cp310-cp310-macosx_11_0_arm64.whl (5.5 MB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

newt_agent_mesh-0.6.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (7.2 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

newt_agent_mesh-0.6.3-cp39-cp39-macosx_11_0_arm64.whl (5.5 MB view details)

Uploaded CPython 3.9macOS 11.0+ ARM64

File details

Details for the file newt_agent_mesh-0.6.3.tar.gz.

File metadata

  • Download URL: newt_agent_mesh-0.6.3.tar.gz
  • Upload date:
  • Size: 164.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for newt_agent_mesh-0.6.3.tar.gz
Algorithm Hash digest
SHA256 af69c9029ddcb69e052e73f65b41cbc309e6c15c08ef763167fae33a81daffe4
MD5 e91c736e13b47c658c5735e324d670b4
BLAKE2b-256 9e126b7d8bb976253105e779af6bec7faacb28ef350bafd7745a4b97c9066bac

See more details on using hashes here.

Provenance

The following attestation bundles were made for newt_agent_mesh-0.6.3.tar.gz:

Publisher: release.yml on Gilamonster-Foundation/agent-mesh

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file newt_agent_mesh-0.6.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for newt_agent_mesh-0.6.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 5216c1a1d1760e323d26f11cb2fac0be3cb0891bc771b48960fa4c9496844ccd
MD5 18834a8d5882143867895bd3454f5de0
BLAKE2b-256 299581349e7bca6c23bc16205113590740329949d128ab5fbca24b47a5c920e2

See more details on using hashes here.

Provenance

The following attestation bundles were made for newt_agent_mesh-0.6.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: release.yml on Gilamonster-Foundation/agent-mesh

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file newt_agent_mesh-0.6.3-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for newt_agent_mesh-0.6.3-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 afaf54fadf561c23a63e82a3827e13959487b8e41416b8894ab59bda69c12f68
MD5 dacbed4bcf870649d837e9d8151f1d66
BLAKE2b-256 6b0e6229dc26bfd246b996230e2bab8c429fc09fcaee048432a1cfae0b91cb4c

See more details on using hashes here.

Provenance

The following attestation bundles were made for newt_agent_mesh-0.6.3-cp312-cp312-macosx_11_0_arm64.whl:

Publisher: release.yml on Gilamonster-Foundation/agent-mesh

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file newt_agent_mesh-0.6.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for newt_agent_mesh-0.6.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 05cd592ec5f5abdbd1642846ab3a7ecfa5172d115fede34e9d5dcf73d03b85f0
MD5 f5243fd3e36f71efacdde90f800aa25f
BLAKE2b-256 739c69cb89d5fa703c27f3468b9ef83187b9a3e5770584ea9fe36b7e0e42faaa

See more details on using hashes here.

Provenance

The following attestation bundles were made for newt_agent_mesh-0.6.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: release.yml on Gilamonster-Foundation/agent-mesh

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file newt_agent_mesh-0.6.3-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for newt_agent_mesh-0.6.3-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 45a7ab68482be763e64b33cf04062b85c999b936c1ffcd0c250829206fb80323
MD5 e9cc0cd8809854603c079d6dab0078db
BLAKE2b-256 d5161af77831dca27138f88bb554fea898f06276fac51fb62018c199a7aaa731

See more details on using hashes here.

Provenance

The following attestation bundles were made for newt_agent_mesh-0.6.3-cp311-cp311-macosx_11_0_arm64.whl:

Publisher: release.yml on Gilamonster-Foundation/agent-mesh

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file newt_agent_mesh-0.6.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for newt_agent_mesh-0.6.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 4e2b97374cd93c49099793282c5b1d1b6e008b7ea36f734ff3bc1bd4ca386eeb
MD5 c657bdbaf5cdf3b377a4410e5e2ad24b
BLAKE2b-256 432f8d5364bf5d19f25c88977e2689934e8e33af7ce066d8af678a00f412ca62

See more details on using hashes here.

Provenance

The following attestation bundles were made for newt_agent_mesh-0.6.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: release.yml on Gilamonster-Foundation/agent-mesh

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file newt_agent_mesh-0.6.3-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for newt_agent_mesh-0.6.3-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 b5997729d0463de960e7937c2e78dce4bbef114fbabb3ac33d06d35a0d96d5be
MD5 519ab1e433d8b5b3edc924f5ca198242
BLAKE2b-256 1df229a0555fc1f673557bb40fac7faca8e4198e3eeb7a84ebb8ac6e925051cc

See more details on using hashes here.

Provenance

The following attestation bundles were made for newt_agent_mesh-0.6.3-cp310-cp310-macosx_11_0_arm64.whl:

Publisher: release.yml on Gilamonster-Foundation/agent-mesh

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file newt_agent_mesh-0.6.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for newt_agent_mesh-0.6.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 278da4260a30d61f4e1e51369953625136ae32a2c8d8265c354aad7dd1a4e9f6
MD5 25587c0488db07e0bfb91cd31455e896
BLAKE2b-256 63c17e1de2dbfccaf62b88aa4216853cd43bbd1b993477b1ba6b5361ee2eb7a7

See more details on using hashes here.

Provenance

The following attestation bundles were made for newt_agent_mesh-0.6.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: release.yml on Gilamonster-Foundation/agent-mesh

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file newt_agent_mesh-0.6.3-cp39-cp39-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for newt_agent_mesh-0.6.3-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 57f7892ff473f8e4de3147e13bc80108cd7e69eafe2cbe4a483e69e0ab616d18
MD5 b072ac5bc45942067a151b6392d7120f
BLAKE2b-256 694cb2d8071771aa79e21fccf00e2422a4120f474c5c38520d8b6204076dcfc2

See more details on using hashes here.

Provenance

The following attestation bundles were made for newt_agent_mesh-0.6.3-cp39-cp39-macosx_11_0_arm64.whl:

Publisher: release.yml on Gilamonster-Foundation/agent-mesh

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page