Skip to content

Security: bilalxashraf/spendtree

Security

SECURITY.md

SpendTree security model

SpendTree controls signing authority; it does not make an untrusted merchant honest and it cannot revoke an EIP-3009 authorization after that authorization has been signed.

Supported safety boundary

For v0, use:

  1. A dedicated EOA containing only the maximum acceptable loss.
  2. A separately launched daemon that alone receives SPENDTREE_PRIVATE_KEY.
  3. One mandate-bound MCP adapter per agent.
  4. Exact merchant origins and receiving addresses approved by a human.
  5. Short mandate and authorization expiries.

The daemon never exposes signMessage, signTransaction, raw token transfer, or arbitrary typed-data signing. Each payment creates a one-use signer that checks the complete EIP-712 domain and TransferWithAuthorization message against a database reservation.

Accounting invariant

Payment attempts move through:

reserved → committed → settled
                    ↘ indeterminate

Only a failure before signature creation releases a reservation. Once the signed payload is persisted, every ancestor quota is charged. Network errors, HTTP 500 responses, and missing or invalid settlement headers remain charged and indeterminate because the merchant may still submit the authorization.

Root-scoped idempotency keys prevent sibling agents from independently signing the same logical purchase. Reusing a key with a changed request or quote is an error.

Explicitly out of scope

  • A malicious process with the same OS identity and arbitrary shell access
  • Compromise of the daemon environment or user account
  • A private key used outside SpendTree
  • DNS rebinding protection at the connection/socket layer (planned)
  • Refund enforcement, dispute resolution, merchant delivery, or output quality
  • Recovery of a lost raw capability

SpendTree verifies reported mainnet settlements by locating both the exact canonical USDC Transfer and the matching EIP-3009 AuthorizationUsed nonce in the Base receipt. RPC outages are surfaced as reported_settled, not silently treated as confirmed. Automatic reconciliation of those records is still planned.

Unix socket permissions prevent accidental cross-user access. They do not isolate hostile code running as the same user. Use an OS/container boundary if the agent has unrestricted shell access.

Handling keys and capabilities

  • Never use a primary wallet.
  • Never pass the wallet key to an MCP client or agent environment.
  • Never commit .env, .spendtree/, capabilities, private keys, or databases.
  • Treat mandate capabilities as bearer secrets.
  • Stop the daemon and move remaining wallet funds if key exposure is suspected.
  • Revoking a mandate blocks new signatures only; it cannot invalidate a payload already signed and persisted.

Reporting a vulnerability

Until a private disclosure address is published, do not open a public issue containing an exploit or secret. Contact the repository owner privately through GitHub.

There aren't any published security advisories