Skip to content

Peer-to-Peer (A2A)

Multiple abTARS instances can communicate directly — agent-to-agent. One instance asks another a question or delegates a task, and gets a response.

How it works

Each abTARS instance exposes an Agent API — an authenticated HTTPS endpoint on port 3100. Other instances call it using the peer_ask tool.

┌──────────┐   peer_ask    ┌──────────┐
│ Instance A │ ──────────► │ Instance B │
│ (WSL)    │ ◄──────────── │  (Mac)   │
└──────────┘   response    └──────────┘

Security

Two independent layers:

LayerMechanismPurpose
TransportTLS 1.3 with self-signed Ed25519 certs + cert pinningWire encryption
Request authJWT signed with Ed25519 keysIdentity verification

Both must pass. Compromising one doesn't break the other.

peer_ask tool

The agent uses peer_ask to talk to another instance:

peer_ask(peer: "peer-b", message: "What's your current sleep status?")
→ "I'm awake, last slept 6 hours ago."

The remote instance processes the message through its full agent pipeline (model, memory, tools) and returns the response.

Configuration

~/.abtars/config/peers.json:

json
{
  "self": {
    "name": "kp",
    "signingKey": "<Ed25519 private key for JWT signing>"
  },
  "peers": {
    "peer-b": {
      "host": "<peer-ip-or-hostname>",
      "port": 3100,
      "token": "<shared secret for JWT>",
      "verifyKey": "<peer-b's Ed25519 public key>",
      "certFingerprint": "SHA256:B3:9A:5D:...",
      "certPem": "-----BEGIN CERTIFICATE-----\n...\n-----END CERTIFICATE-----"
    }
  }
}
FieldPurpose
self.nameThis instance's name
peers.<name>.hostPeer's IP/hostname
peers.<name>.portPeer's Agent API port (default 3100)
peers.<name>.tokenShared secret for JWT auth
peers.<name>.verifyKeyPeer's public key for JWT verification
peers.<name>.certFingerprintPeer's TLS cert SHA-256 fingerprint
peers.<name>.certPemPeer's full TLS certificate (PEM)

Setting up TLS certificates

See the TLS Certificate Setup guide for step-by-step instructions.

Use cases

  • Cross-host delegation: "Ask peer to check if Ollama is running"
  • Information sharing: "What did you tell the user last?"
  • Coordinated tasks: One instance triggers work on another
  • Health checks: Verify a peer is alive and responsive