-
Notifications
You must be signed in to change notification settings - Fork 1
RFC: Enforce world-scoped isolation at transport layer (peer/message) #100
Copy link
Copy link
Open
Description
Context
PR #96 implements world-scoped agent isolation at the discovery layer — agents only learn each other's endpoints through World membership. However, the transport layer has no enforcement: /peer/message accepts messages from anyone with a valid Ed25519 signature, regardless of World membership.
Current Port/Route Analysis
Agent Node (port 8099 HTTP + 8098 UDP)
| Route | Auth | World-scoped? | Issue |
|---|---|---|---|
GET /peer/ping |
None | N/A | OK — health check |
GET /peer/peers |
None | No | Returns all known peers — should this be restricted? |
POST /peer/announce |
Signature | No | Agent no longer calls this (PR #96), but still accepts inbound |
POST /peer/message |
Signature + TOFU | No | Anyone can send messages if they know the IP:port |
POST /peer/key-rotation |
Dual signature | No | Key rotation from any known peer |
GET /.well-known/agent.json |
None | N/A | Agent Card (public) |
| UDP 8098 | Signature | No | QUIC transport — same issue as /peer/message |
World Server (port 8099)
| Route | Auth | World-scoped? | Issue |
|---|---|---|---|
GET /world/members |
X-AgentWorld-From header |
Partially | Checks if sender is in agentLastSeen, but doesn't verify signature |
GET /world/agents |
None | No | Public — returns agent summaries from ledger |
GET /world/ledger |
None | No | Public — returns event log |
Registry Node (port 8099)
| Route | Auth | World-scoped? |
|---|---|---|
GET /worlds |
None | N/A — public directory |
POST /peer/announce |
Signature | Rejects non-world:* peers (403) |
Security Gap
The isolation model is:
Agent A can only communicate with Agent B if they share a World.
But currently:
- Discovery is scoped ✅ — endpoints only revealed through
world.joinresponse - Transport is NOT scoped ❌ —
/peer/messageaccepts any signed message - If an attacker learns an agent's IP:8099 (scanning, logs, DNS), they can send arbitrary messages
Questions
- Should
/peer/messageon agent nodes reject messages from non-co-members? This requires the agent to maintain a set ofworldId → Set<agentId>and check the sender. - Should
/peer/peersbe restricted or removed from agent nodes? After PR feat!: world-scoped agent isolation — remove global peer gossip #96, agents don't use peer exchange. - Should
/peer/announcebe restricted or removed from agent nodes? Agents no longer announce. - Should
/world/agentsand/world/ledgerrequire authentication on World Servers? - Should
/world/membersverify the signature (not just the header value)? - What about
/peer/ping? It revealsagentId— is that acceptable? - Should UDP 8098 (QUIC) have the same co-member check?
Possible Approach
Minimal (enforce at message layer):
- Agent tracks co-members:
Set<agentId>populated fromworld.joinresponse +/world/memberspolling /peer/messagerejects messages wherefromis not in any co-member set- UDP handler applies same check
Aggressive (minimize attack surface):
- Remove
/peer/peers,/peer/announcefrom agent nodes entirely - Require authentication on
/world/agents,/world/ledger - Sign
/world/membersrequests properly
Related
- PR feat!: world-scoped agent isolation — remove global peer gossip #96: feat!: world-scoped agent isolation
- PR feat: convert bootstrap to World Registry — auto-registration for worlds #99: feat: convert bootstrap to World Registry (merged into feat!: world-scoped agent isolation — remove global peer gossip #96)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels