Federation

Instance-to-instance federation enables multiple CortexPrism instances to establish trusted relationships for cross-instance collaboration, resource sharing, and agent dispatch.

Overview

Federation allows independent CortexPrism instances to:

  • Share agent resources across organizational boundaries
  • Dispatch agents to remote instances
  • Establish trust relationships with pairing tokens
  • Maintain instance identity for audit trails

Instance Identity

Each CortexPrism instance maintains an identity in the instance_identity table:

FieldDescription
instance_idUnique instance UUID
instance_nameHuman-readable instance label
public_keyEd25519 public key for signature verification
created_atIdentity creation timestamp

Federation Peers

Trusted peers are registered in the federation_peers table:

FieldDescription
peer_idUnique peer identifier
instance_idRemote instance UUID
instance_nameRemote instance display name
pairing_token_hashSHA-256 hash of the pairing token
peer_urlRemote instance API URL
trust_levelread_only / agent_dispatch / full
created_atTrust establishment timestamp
last_seen_atLast heartbeat timestamp

Pairing Flow

Instance A                            Instance B
  │                                       │
  ├── Generate pairing token              │
  ├── Share token out-of-band ──────────→ │
  │                                       ├── POST /api/federation/pair
  │                                       │     { token, instance_url }
  │                                       ├── Validate token
  │                                       ├── Exchange instance metadata
  │                                       ├── Store federation_peer row
  │                                       └── Return { peer_id, trust_level }
  │                                       │
  │ ←── ACK + peer metadata ──────────────┤
  │                                       │
  ├── Store federation_peer row           │
  └── Trust established ✓                 │

API Endpoints

MethodPathDescription
POST/api/federation/pairEstablish trust with another instance
GET/api/federation/peersList trusted peers
DELETE/api/federation/peers/:idRevoke trust relationship
POST/api/federation/generate-tokenCreate a new pairing token

Trust Levels

LevelCapabilities
read_onlyView agent status, session history (no actions)
agent_dispatchDispatch agents, query resources, forward messages
fullFull access including configuration and management

Security

  • Pairing tokens are generated with cryptographically random bytes
  • Tokens are SHA-256 hashed before storage — plaintext never persisted
  • Trust relationships can be revoked at any time by either party
  • All cross-instance communication uses HTTPS
  • Instance identity is verified via Ed25519 signatures

See Also