AddThisFeature

API Key Management

Let users create and control API credentials without ever showing a secret twice.

involved Developer Experience

What it adds

A self-serve screen for issuing, scoping, rotating, and revoking API keys, with secrets stored only as hashes.

What your agent is told to do

5
  1. 1

    Generate keys with a cryptographically secure random source and a recognisable prefix so leaked keys can be identified in logs and scanners.

  2. 2

    Show the full secret exactly once, at creation, with a copy control and a clear warning that it will not be shown again. Store only a hash.

  3. 3

    Give each key a name, a scope set, an optional expiry, and a last-used timestamp so users can tell which key is safe to delete.

  4. 4

    Support rotation as a first-class action: issue a replacement while the old key stays valid for a short overlap, then revoke it.

  5. 5

    Do NOT log, email, or include the raw secret in any audit record, error report, or support view. The hash is the only copy the system keeps.

Edge cases it handles

6
  • Revocation must invalidate cached authentication immediately, not at the next cache expiry.
  • A key with an expiry must stop working at the expiry, and the owner should be warned before it lapses.
  • Verify keys with a constant-time comparison against the hash.
  • A key must never carry more permission than the user who created it has now — re-check on use, not just at issue.
  • Per-key rate limits are useful, but the account-level limit still applies; one key must not be able to spend the whole account budget.
  • Deleting a user or removing them from a workspace must revoke the keys they issued.

Definition of done

8
  • The raw secret is displayed once and never retrievable afterwards.
  • Only a hash of the key is stored, and comparison is constant-time.
  • Keys have names, scopes, optional expiry, and last-used timestamps.
  • Rotation issues a new key with a defined overlap window.
  • Revocation takes effect immediately, including behind caches.
  • Key creation, rotation, and revocation are audited without the secret.
  • The feature matches the existing design system.
  • No existing functionality is broken.

Related features

How it works

  1. 1

    Copy the link

    Grab the Markdown instruction URL for this feature.

  2. 2

    Give it to your AI

    Paste it into Claude Code, Cursor, v0, Lovable — whatever you build with.

  3. 3

    It inspects, then implements

    Your agent reads your existing app first, then adds the feature to fit it.

Works with your stack

These instructions are written to adapt. They tell the agent to detect your framework, match your existing design system, and reuse what you already have — rather than assuming a particular stack.

Need it tighter than that? Customize the feature and tell it exactly what you're running.