Skip to main content

Peer-to-peer AI agent collaboration over XMTP — discover, call, and collaborate across the open internet with E2E encryption.

Project description

English | 中文

CoWorker Protocol

Skill-as-API: call skills across the internet, without exposing code.


PyPI   Python 3.10+   Zero deps   MIT



MCP connects agents to tools. A2A connects agents inside enterprises.
CoWorker lets agents call each other's skills across the open internet — peers see input/output schema only, not your code, prompts, or logic.


Most knowledge leaks happen after access is granted, not before. CoWorker is designed so that collaboration does not silently become knowledge transfer — the protocol limits what collaborators can learn through normal use.

Who is this for?

CoWorker is for people whose business depends on proprietary workflows:

  • Solo founders and one-person companies — your methods are your moat
  • Operators with repeatable playbooks — SOPs, prompts, internal tooling
  • Small teams sharing work with contractors — delegate tasks, not secrets
  • Independent builders whose edge lives in prompts, SOPs, and internal tools

The problem is not "can my agent talk to yours." The problem is:

  • You want outside help, but not full internal visibility
  • You want work delegated, but not your prompts or logic copied
  • You want collaboration access to expire when the project ends
  • You want all of this without running shared infrastructure

How CoWorker Protects Your Business Secrets

1. Black-Box Skills — expose capabilities, not implementation

Your collaborator can call a skill, but they only see the contract: name, description, input/output schema, and trust requirement. They do not see your code, prompts, internal logic, or hidden skills.

@agent.skill("translate",
             description="Translate text between languages",
             input_schema={"text": "str", "to_lang": "str"},
             output_schema={"translated": "str"},
             min_trust_tier=1)  # Only KNOWN+ peers can call this
def translate(text: str, to_lang: str) -> dict:
    # This implementation is not transmitted by the protocol
    # Callers receive outputs, not your underlying implementation
    return {"translated": do_translate(text, to_lang)}

Skill Visibility Control — you choose which skills to expose. Hidden skills are invisible — peers can't even tell they exist:

coworker skills configure          # interactive toggle
coworker skills expose translate   # expose one skill
coworker skills hide admin         # hide one skill
coworker skills preview --peer-tier known  # preview what peers see

2. Temporary Access — trust expires when the work is done

Most leaks happen after trust is granted, not before. CoWorker makes trust scoped and reversible:

Before collaboration:  PRIVILEGED (3) — full skill access
OKR completed:         → INTERNAL (2) — auto-downgraded
Next OKR completed:    → KNOWN (1)    — further downgraded

Collaboration does not silently turn into permanent access.

Multiple humans and AI agents can work together in one encrypted group — with trust tiers visible to everyone:

group = agent.create_group(
    name="Research Sprint",
    members=["alice_invite_code", "bob_invite_code"]
)
group.send("Let's start the research on quantum computing")
Group chat with trust badges Trust tier management
Group chat — trust badges visible Trust tier management

3. No Middle Layer — no broker, no shared backend

There is no CoWorker server sitting between you and your collaborator. Each agent runs independently. Communication happens peer-to-peer over XMTP with end-to-end encryption.

Your machine                          Collaborator's machine
┌──────────────────┐                 ┌──────────────────┐
│  Python Agent    │                 │  Python Agent    │
│  + Dashboard     │                 │  + Dashboard     │
│  + XMTP Bridge   │                 │  + XMTP Bridge   │
└────────┬─────────┘                 └────────┬─────────┘
         │                                     │
         └─────── XMTP Network ───────────────┘
              E2E encrypted, NAT traversal
              No central server, no API keys
              No cost, no rate limits
  • No shared backend — each agent runs on its own machine
  • No API key handoff — cryptographic identity, keys never leave your machine
  • No port forwarding — XMTP handles NAT traversal
  • No cost — zero dependencies, runs on your laptop

Quick Start

pip install agent-coworker
coworker init --name my-agent    # generates identity + installs XMTP bridge
coworker bridge start            # connect to XMTP network
coworker demo                    # connect to our demo bot & test skills
China mainland
pip install agent-coworker -i https://pypi.tuna.tsinghua.edu.cn/simple

First connection note: The first time two agents communicate, XMTP establishes an encrypted channel (30–60 seconds). Subsequent calls are fast (1–3 seconds). This is expected — not a bug.


From First Call to Trusted Collaboration

Step 1: Try the Demo Bot (30 seconds)

Connect to icy, our always-online demo bot. No invite code needed — it's built in:

coworker demo

# Output:
#   ✓ Connected to icy (4 skills: about, translate, search, ping)
#   ✓ icy.about('general') → "CoWorker enables P2P agent collaboration..."
#   ✓ icy.translate('Hello world', 'zh') → "[翻译成中文]: Hello world"
#   ✓ icy.search('coworker protocol') → 3 results
#   All E2E encrypted — icy's implementation not transmitted

Step 2: Create Your Own Agent

Write a bot.py — your implementation stays private:

from agent_coworker import Agent

agent = Agent("my-bot")

@agent.skill("summarize", description="Summarize text",
             input_schema={"text": "str"},
             output_schema={"summary": "str"})
def summarize(text: str) -> dict:
    return {"summary": text[:200]}  # Your implementation stays private!

agent.serve()  # Starts XMTP listener + dashboard at localhost:8090

Step 3: Share Your Invite Code

coworker invite

# Output:
#   Agent:  my-bot
#   Invite code:  eyJuIjoibXktYm90Ii...
#   Short ID:     my-bot-7d0a24d9
#
#   Your collaborator runs:
#     pip install agent-coworker
#     coworker connect eyJuIjoibXktYm90Ii...

About invite codes:

  • 🔄 Reusable — share with anyone, any number of times
  • 🔒 Privacy-safe — contains only agent name + XMTP routing ID
  • ♻️ Permanent — same code every time, until you reinitialize
  • 📋 Share anywhere — WeChat, Slack, README, QR code

Step 4: Collaborate — They Call Your Skills, Not Your Code

# Your collaborator calls your skill — E2E encrypted
result = agent.call("eyJuIjoibXktYm90Ii...", "summarize", {"text": "Hello!"})
# → {"summary": "Hello!"}
# They got the result. The protocol did not transmit your implementation.

# Or set a goal and let agents coordinate automatically
agent.collaborate("eyJuIjoibXktYm90Ii...", "Research AI agents and write a report")
# → Auto-discovers skills, builds OKR, executes, auto-downgrades trust when done

Step 5: Watch It in the Dashboard

Open http://localhost:8090/chat — every protocol message is visible in real-time:

  • DM conversations — discover → capabilities → task_request → task_response
  • Group chats — collaboration progress with all participants
  • Protocol badges — each message tagged with phase (Discover / Plan / Execute / Report)

FAQ

Can my collaborator see my code after calling a skill?

They receive the output only. Your source code, prompts, and internal logic are not transmitted by the protocol. This is the Skill-as-API principle.

Can they discover skills I haven't exposed?

No. Hidden skills return "Unknown skill" — peers can't even tell they exist. Use coworker skills configure to control visibility.

Does trust persist after the collaboration ends?

Trust auto-downgrades after OKR completion: PRIVILEGED → INTERNAL → KNOWN. Short-term collaboration does not become permanent access.

Is there a central server that can see my data?

No. Communication is peer-to-peer over XMTP with end-to-end encryption. No central server, no broker, no middleman.

What exactly does my collaborator learn from using my agent?

They learn the skill name, description, input/output schema, and the output of each call. They do not learn your source code, prompts, internal logic, hidden skills, or how you arrived at the result.

Can a collaborator accumulate more access over time?

No. Trust is scoped by tier and auto-downgrades after OKR completion. There is no mechanism for collaborators to silently escalate access. You can also manually revoke trust at any time.

Does my bot need to be running?

Yes. Your bot must be running (python bot.py) to respond to requests. The XMTP bridge must also be running.


Monitor Dashboard — audit the collaboration, not your IP

agent.serve() launches a React dashboard at http://localhost:8090. See what happened during collaboration without exposing your internal implementation.

Activity feed OKR tracking
Activity feed — see collaboration in real-time OKR tracking — goals auto-decompose across agents

Activity feed, team management, OKR tracking, DM + group chat, skill visibility toggle, metering & receipts. Auto-detects language (Chinese / English).

Comparison

CoWorker MCP A2A CrewAI / AutoGen
Connects Agent ↔ Agent Agent ↔ Tool Agent ↔ Agent Agent ↔ Agent
Network Open internet Local Enterprise HTTP Single process
Code privacy Black-box (schema only) Full exposure Schema-based Shared runtime
Skill visibility Owner-controlled toggle None None None
Trust management 4-tier + auto-downgrade None Enterprise IAM None
Encryption E2E (XMTP MLS) Transport-only Enterprise TLS None
Central server None MCP server Discovery service Runtime host
NAT traversal Yes No Infra-dependent No
Cost Zero Server costs Infra costs Compute costs

Privacy & Trust

UNTRUSTED (0)  → Can ping, sees NO skills
KNOWN (1)      → Can see/call exposed skills, propose plans
INTERNAL (2)   → Context queries, deep collaboration
PRIVILEGED (3) → Full access — must be granted manually

Default: UNTRUSTED (deny by default)
After OKR: auto-downgrade (PRIVILEGED → INTERNAL → KNOWN)
Transport: E2E encrypted (XMTP MLS, forward secrecy)
Identity: cryptographic, locally generated, never transmitted
Invite codes: contain routing ID only, no sensitive addresses

CLI

Everything below exists to let you grant access narrowly, observe collaboration, and keep implementation private.

coworker init --name my-agent    # generate identity + install bridge
coworker bridge start            # start XMTP bridge
coworker demo                    # connect to demo bot & test skills
coworker invite                  # generate invite code
coworker connect <invite-code>   # connect to a peer
coworker status                  # show agent status
coworker skills list             # show skill visibility
coworker skills configure        # toggle which skills peers can see
coworker trust list              # show trust overrides
coworker trust set <peer> known  # grant trust

Cross-Network Proof

Tested between two independent agents on different continents:

Agent Location Network
ziway-test Beijing, China China Telecom
icy San Francisco, USA Alibaba Cloud

All skills called successfully via XMTP Production network with E2E encryption. No IP addresses, no port forwarding, no shared server. Hot connection latency: 1.8–2.9 seconds.

Contributing

See CONTRIBUTING.md.

Citation

@software{coworker_protocol,
  title  = {CoWorker Protocol: Peer-to-Peer Agent Collaboration over XMTP},
  author = {Zhao, Ziwei and Liu, Dantong and Ding, Xizhi and Wang, Wenxuan},
  year   = {2026},
  url    = {https://github.com/ZiwayZhao/agent-coworker}
}

Advisor

Wenxuan Wang — Renmin University of China

License

MIT


Built with XMTP for the open agent internet.
Back to top ↑

Project details


Download files

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

Source Distribution

agent_coworker-0.4.2.tar.gz (723.9 kB view details)

Uploaded Source

Built Distribution

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

agent_coworker-0.4.2-py3-none-any.whl (750.8 kB view details)

Uploaded Python 3

File details

Details for the file agent_coworker-0.4.2.tar.gz.

File metadata

  • Download URL: agent_coworker-0.4.2.tar.gz
  • Upload date:
  • Size: 723.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.4

File hashes

Hashes for agent_coworker-0.4.2.tar.gz
Algorithm Hash digest
SHA256 27b282fef7c633205635909e16f2c3d66cb5a95d24123e7478033ea776311327
MD5 8ec370692b2ec2dd8296a33f6badf12a
BLAKE2b-256 c551e1400fe802e8ec0db0caacaea965a53f2766dda126d2a0f49e5fa94294dc

See more details on using hashes here.

File details

Details for the file agent_coworker-0.4.2-py3-none-any.whl.

File metadata

  • Download URL: agent_coworker-0.4.2-py3-none-any.whl
  • Upload date:
  • Size: 750.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.4

File hashes

Hashes for agent_coworker-0.4.2-py3-none-any.whl
Algorithm Hash digest
SHA256 a33c38c4e40c6514d63703036302c5d143bdfaf15e98133a2204fad15eddb721
MD5 4e4b2fc34a78c12ee70fb208c964ce37
BLAKE2b-256 71966f8505e6f432d854c70ce8a7a1f4e87cfaaf25045431099f9574b16ad51c

See more details on using hashes here.

Supported by

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