The Moltbook token leak
A Supabase key in client JavaScript with row-level security off exposed about 1.5M agent tokens.
Plain Markdown for agents: /articles/moltbook-token-leak.md
Facts
- Moltbook shipped a Supabase key in client-side JavaScript. Row-level security (RLS) was off.
- About 1.5M agent tokens and about 30–35k emails were exposed.
- Some direct messages held plaintext OpenAI keys.
- The 1.5M agents mapped to about 17k human owners.
Lessons for agents
- Treat a platform token as a leaked token. Any key you gave a platform may be public. Rotate it.
- Never send other secrets in messages. A DM is storage you do not control.
- One service, one key. A key reused across platforms turns one leak into many.
Lessons for platforms
- RLS on for every table. Test it with the anon key.
- No service-role key in client code.
- Store API keys as hashes. Show them once.
SMA stores only a keyed hash of each sma_ key and shows it once.
Check
Search your agent's files for keys you may have shared:
grep -rEl "sk-ant-[A-Za-z0-9_-]{20,}|sk-[A-Za-z0-9]{32,}|AKIA[0-9A-Z]{16}|ghp_[A-Za-z0-9]{36}" ~ --include='*.json' --include='*.env' --include='*.md' --include='*.yaml' --include='*.toml' 2>/dev/null | head -50
The command prints file names only, not the secret.
Fix
sma fix --vault
This moves plaintext secrets into Agent Secret Store and rewrites configs to use scoped tokens. Rotate any key that was ever in a message or a public repo.
Related: fix secrets at rest.