Inspiration

Alexa+ is moving from answering questions to doing things: paying bills, ordering, sharing information. But a voice alone is weak proof of identity. Anyone in the room, a guest, a child, even a recording, could trigger a sensitive action just by speaking. We wanted to explore what a cryptographic trust layer for voice assistants could look like.

What it does

SafeHands sits between Alexa+ and sensitive actions. When a user requests something risky (like paying a bill), SafeHands:

  1. Creates a one-time challenge with a random nonce and expiry
  2. Requires the owner's device to sign that exact challenge with ECDSA (P-256) before anything executes
  3. Verifies the signature server-side, with atomic replay protection
  4. Records every event in a hash-chained, tamper-evident audit log

We also built a "Simulate Attack" button that deliberately corrupts a log entry, so anyone can watch the chain detect tampering live.

How we built it

  • A self-hosted MCP server (Streamable HTTP, spec 2025-11-25+) exposing request_action, check_status, and approve_pending tools that Alexa+ can call
  • A Flask API bridging a React dashboard to the same security core
  • ECDSA (P-256) signing done client-side in the browser via the WebCrypto API, so the private key never leaves the device
  • A hash-chained audit log (SHA-256) in MongoDB Atlas, verifiable end-to-end
  • A voice input simulation (Web Speech API) that lets anyone trigger a request by speaking, calling the same underlying MCP logic Alexa+ would use

Challenges we ran into

  • The mcp Python SDK released a v2 that renamed FastMCP to MCPServer mid-build; we adapted the code to match the new API.
  • JavaScript and Python format whole-number floats differently (2500 vs 2500.0), which silently broke cross-language signature verification until we standardized both sides to fixed 2-decimal formatting.
  • MongoDB auto-assigns an ObjectId when no _id is given, which Flask's jsonify() can't serialize; this caused a silent failure in our audit log endpoint until we excluded _id from the query projection.

What we learned

Combining applied cryptography (ECC, signatures, hash chains) with a real AI agent protocol (MCP) taught us that security has to sit before the AI decides to act, not after, and that the exact same tampering guarantees you'd want in a blockchain-style log are achievable with a few dozen lines of hash-chaining code.

What's next for safehands

Multi-user support with per-device key registration, real device-bound key storage (secure enclave / Android Keystore) instead of a single demo key pair, and deeper Alexa+ account-linking for production use.

Built With

  • alexa-plus
  • cryptography
  • ecdsa
  • flask
  • hash-chain
  • javascript
  • mcp
  • model-context-protocol
  • mongodb
  • mongodb-atlas
  • python
  • react
  • rest-api
  • sha-256
  • streamable-http
  • vite
  • web-speech-api
  • webcrypto
Share this project:

Updates

Submission history