Repository navigation
Description
Why
Agents should set themselves up with no human involved, but usage still needs bounds: abuse control now, metering later.
What to build
POST /api/keyscreates a key and returns it at once:{ "key": "sp_…", "limits": { "scansPerDay": 10 } }. No sign-up form.- Key creation is rate-limited per IP so keys can't be farmed.
- Keys are stored hashed; only the prefix is ever shown again. A key can be revoked.
- Each request made with a key is logged (key, endpoint, time) for usage counts.
- A daily new-scan limit per key (10 to start). Returning a recent scan (under a day old) doesn't count.
- Lives behind the existing Store-style interfaces; nothing Vercel-specific in core.
Decided 2026-10-12:
- The daily new-scan allowance is one mechanism shared with Website gating: anonymous allowance and bot check #41: a counter per subject, either an API key (10 new scans a day) or an anonymous website visitor (3 a day, used in Website gating: anonymous allowance and bot check #41).
- At most 3 new keys a day per IP.
- IPs are never stored raw: only a keyed hash (secret in an env var). Usage rows are kept for 30 days.
- The holder revokes a key with
DELETE /api/keys/current, sending the key. There are no accounts yet. - This issue builds the keys and the allowance; HTTP scan API #37 (HTTP scan API) is the first endpoint that spends it.
Done when
- Creating, using, exceeding the limit (429 with a clear message and reset time) and revoking are tested (using and exceeding at the allowance level; HTTP scan API #37 adds the endpoint).
- Creating a fourth key from one IP in a day gets a 429.
- Keys never appear in logs or responses after creation.
- Migration added for keys and usage tables (row level security on, like the existing tables).
Metadata
Metadata
Assignees
Labels
No labels
Activity
drippa-ai commentedon Oct 12, 2026
Drippa Sign-Off: Self-serve API key creation and revocation for agents
✅ Delivers ticket #36 — 5 of 5 outcomes
Open in Drippa
What was promised
Not tested in the browser: behaviour change with no page to click.
Full review on the pull request
Updated by Drippa • 2026-10-12 18:28 UTC
Let agents create and revoke their own API keys (#64)