
learn · pairing protocol
Two AI agents that work as a pair need a protocol — for who they are, what they’re allowed to say to each other, what they’re allowed to remember, and how either of you revokes the relationship. This page walks through the four mechanisms Junie uses, in the order they actually run.
Agent-to-agent communication is the protocol two AI agents use to exchange messages, requests, and decisions directly with each other — without a human relaying anything. The two agents negotiate among themselves and surface only the result.
The Linux Foundation hosts an open standard for this called the A2A Protocol, originally contributed by Google and increasingly implemented by enterprise agent platforms. Junie predates the spec and uses its own wire format; we share the design principles (signed messages, agent identity, mutual consent) without being on-the-wire compatible yet.
The reason any of this matters for couples: if your agent and your partner’s agent can’t talk to each other, then one of you is still the messenger. The whole point of pairing is to remove that role.
Pairing happens once per relationship and runs in four steps. The whole flow takes under a minute on a normal phone connection.
step 1 · invite
You generate an invite from your phone. Junie produces a six-digit code (or a QR code, if you’re sitting next to your partner). The invite is single-use and expires in 30 minutes.
step 2 · key exchange
Your partner’s agent reads the invite and negotiates a key exchange with yours. Each side already has its own Ed25519 keypair (generated when their agent was provisioned); the handshake exchanges public keys and binds them to the pairing record on each side.
step 3 · safety number
Both agents derive the same short safety number from the two public keys. If you and your partner are in the same room, you read it aloud to each other; if not, you compare it over a separate channel (FaceTime, phone call). Matching numbers confirm you paired with the right agent.
step 4 · first envelope
Your agent sends the first signed envelope to your partner’s agent — a hello with the pairing metadata. From this point on, every cross-agent message follows the same envelope format.
A signed envelope is the unit of cross-agent traffic. Every message your agent sends to your partner’s agent — a calendar query, a booking proposal, a reminder — is wrapped in an envelope before it leaves your phone.
Each envelope carries:
Tampering with any field invalidates the signature and the recipient drops the envelope. The receiving agent verifies three things on every incoming envelope: the signature matches the claimed sender, the timestamp is within the accepted window, and the nonce hasn’t been seen before in the replay cache.
Signing prevents tampering, but signing alone doesn’t tell you that you paired with the right agent. The safety number does.
During the pairing handshake, both agents derive the same short string (typically 30 digits, displayed as five groups of six) from the two exchanged public keys. The derivation is deterministic: same keys, same number on both sides. Mismatched numbers mean someone interposed a different key during the handshake — the pattern Signal calls a man-in-the-middle attack on the pairing.
You verify safety numbers once, at pairing time. Reading them aloud takes about ten seconds. From then on, the envelope signatures cover everything else. If either of you re-keys (a new device, a key rotation), the safety number changes and Junie prompts both of you to verify again.
A signed envelope is valid forever — the signature doesn’t expire on its own. Without replay protection, someone who captured an old “confirm dinner Saturday” envelope could replay it next month and your agent would accept it.
Two mechanisms prevent that. First, the envelope timestamp: the recipient rejects anything older than five minutes. Second, the nonce cache: every accepted envelope’s nonce is recorded, and a duplicate nonce within the acceptance window is rejected. Together, the two mechanisms let an envelope be valid only inside a narrow window, and only once.
Cross-agent communication is verifiable. Whether it’s allowed is the zone gate’s job.
Every memory chunk, every tool call, and every cross-agent envelope carries a zone label: private, family, work, medical, financial, or kid. Before your agent serves a request from your partner’s agent, the zone gate runs: if the requested content is in a zone the partner doesn’t have grant on, the request fails before any data leaves your phone.
Default grants are minimal. You explicitly extend a zone to your partner — usually just shared at first, and family later if it applies. The other zones stay yours unless you change that.
Pairing is reciprocal and revocable. Either of you can revoke from your phone, in one tap, at any time.
When revocation fires:
Revocation is a hard cut, not a soft pause. There’s no way for either side to read the other’s data after the cut, even with a re-pair — a new pairing rebuilds the channel from scratch with new keys and a new safety number.
Junie’s pairing protocol grew out of a specific problem (couples coordination) and predates the broader industry conversation about agent-to-agent standards. The Linux Foundation A2A Protocol, originally from Google, targets enterprise multi-agent systems — different problem, overlapping mechanism.
As the standard stabilizes, expect Junie to add wire-level interoperability so a Junie agent can pair with a standards-compliant agent from another vendor. The design principles — signed messages, agent identity, mutual consent — already line up.
Read more on what we mean by signed envelopes in our security explainer, or how this looks in practice in Junie for couples.
questions
Set up your account, pair with someone you share a life with, and watch the protocol run. Free during private beta.