mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2026-08-11 00:37:41 +00:00
Zaps and DMs move real artifacts (money, private messages) to a Nostr pubkey. Nostr has no global namespace, so "zap Alice" is ambiguous — multiple users can publish the same display name. Four safeguards now make it much harder for Gemini (or any agent) to misroute a write: 1. `expectedDisplayName: String?` on followUser / sendDm / zapUser. Agent passes the name it understood; verb cross-checks that the resolved profile's name / display name / NIP-05 contains it (or vice-versa). Mismatch aborts with a typed error carrying the npub and NIP-05 so the agent can re-prompt. 2. `requireFollow: Boolean = true` default on sendDm and zapUser. Refuses to act on a pubkey the user doesn't already follow on Nostr. Strongest guard against same-name impersonators — even if the agent picked the wrong Alice, the user almost certainly isn't following her. Override to false only when the user explicitly approves acting on a stranger. 3. Updated kdocs instruct the agent to confirm with the user using all three identity signals (display name + npub + NIP-05) before invoking. The kdoc is what Gemini reads to learn the verb's contract, so this is where the instruction goes. 4. searchProfiles now filters out hits whose NIP-05 claim explicitly fails verification (the listed domain refuses to sign for that pubkey). Network errors / no-claim profiles are kept (inconclusive, not refutations). Verifications run in parallel with a 4s overall budget; on timeout we surface all candidates rather than censor. https://claude.ai/code/session_013NKVhEF2KqyCrV7ufaiQ6N