Skip to content

RFC: Enforce world-scoped isolation at transport layer (peer/message) #100

@Jing-yilin

Description

@Jing-yilin

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:

  1. Discovery is scoped ✅ — endpoints only revealed through world.join response
  2. Transport is NOT scoped ❌ — /peer/message accepts any signed message
  3. If an attacker learns an agent's IP:8099 (scanning, logs, DNS), they can send arbitrary messages

Questions

  1. Should /peer/message on agent nodes reject messages from non-co-members? This requires the agent to maintain a set of worldId → Set<agentId> and check the sender.
  2. Should /peer/peers be restricted or removed from agent nodes? After PR feat!: world-scoped agent isolation — remove global peer gossip #96, agents don't use peer exchange.
  3. Should /peer/announce be restricted or removed from agent nodes? Agents no longer announce.
  4. Should /world/agents and /world/ledger require authentication on World Servers?
  5. Should /world/members verify the signature (not just the header value)?
  6. What about /peer/ping? It reveals agentId — is that acceptable?
  7. Should UDP 8098 (QUIC) have the same co-member check?

Possible Approach

Minimal (enforce at message layer):

  • Agent tracks co-members: Set<agentId> populated from world.join response + /world/members polling
  • /peer/message rejects messages where from is not in any co-member set
  • UDP handler applies same check

Aggressive (minimize attack surface):

  • Remove /peer/peers, /peer/announce from agent nodes entirely
  • Require authentication on /world/agents, /world/ledger
  • Sign /world/members requests properly

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions