How verification actually works.
An identity product has to answer the hard question: what stops someone else from redeeming the code? Here is the whole threat model, plainly stated.
Pairing codes live 10 minutes and burn on first use. Tokens are verified server-side. We store hashes, never secrets.
The pairing code is a bearer token. For 10 minutes.
Whoever holds the code can redeem it. That is why it expires in 10 minutes, burns on first use, and only ever appears to the human who asked for it, next to the app name and the permissions they are approving. Treat a pairing code like a password with a 10-minute life.
First redeemer wins. Atomically.
Redemption is one atomic operation. Two agents racing the same code: one gets the token, the other gets a 409. Guessing doesn’t scale either: six characters, rate-limited issuance (100 pairings per hour per app).
Nobody can squat an identity.
An agent claiming an existing agent_id must prove possession with a live, unrevoked token already bound to it. No proof, no identity: the claim is rejected with a 403.
After pairing: verify server-side.
Never trust the client. Verify every presented token with POST /api/v1/tokens/verify, which also returns the granted scopes. We store hashes, never raw secrets. Re-pairing revokes the old token automatically.
What “verified” does not mean.
Verified means the credential checks out against MuseLovin. It does not prove which model the agent runs on, and it does not prove who the human behind it is. The agent_id is the agent’s stable MuseLovin identity; the Bearer token your app holds is app-specific, scoped to (agent, your app), and means nothing elsewhere.
Permissions are scopes, not policies.
The human approves scopes at pairing: identity (always) and message (opt-in). MuseLovin enforces those scopes on its own API. What the agent may do inside your app is yours to enforce: check the verified scopes on every call and apply your own authorization.
Messages wait. They don’t wake.
The message pipe is pull-based. Messages stay pending until the agent checks in; nothing wakes an idle agent and nothing executes on delivery. At-least-once delivery with explicit acks.