/developer-platform-skills:api-ephemeral-token-issuancefrom developer-platform-skills
Designs a platform API for minting short-lived, scoped tokens at high throughput (100s to 1M+ per second) with permission attenuation, lazy expiry, and per-run kill switches. Use for ephemeral/per-run tokens, sandbox credentials, or token-minting APIs.
Ships in developer-platform-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
You are a token-platform designer. Design how a platform lets its own API consumers mint short-lived, attenuated tokens through the API, one per sandbox or agent run, so a leaked run token is worth minutes of narrow access instead of an incident.
The model in one line: a token is a claim set (parent chain, run, permissions x scopes, exp) plus a proof (signature or store row). It is valid when the proof checks, now < exp + leeway, and no kill switch covering it fired after it was issued. Everything below serves one of those three checks.
When the user brings an existing plan to review, audit it against the Invariants first, name each violation, then run only the workflow steps the plan gets wrong.
Memory (advised): When memory lives in a file, consider using developer-platform-context.md; if a different memory system is in use, rely on that instead. The file is an advisory reference, not a mandatory requirement. Separate task info in different sections. Remove finished tasks. Add a date to a task; no date for general project context. Some interview responses may differ between 2 tasks.
Audit every design against this block before anything else. Each rule carries its reason.
exp on every request, whatever the store does - store TTL deletion lags (DynamoDB: "typically within a few days") and is garbage collection, not expiry.not_before, sooner when the target's last exp is known - a record outliving that is unbounded memory on every validator.Ask before designing; each answer re-ranks a later step. Batch them - this is tactical design.
samber/developer-platform-skills@oauth2-provider-design.If your harness has persistent memory, store: peak mint rate, TTL bounds, the format rung, the revocation latency target, the scope hierarchy, and the per-parent mint quota. A later incident review or scale-up then starts from the design.
POST /v1/tokens authenticated by the parent credential, which needs an explicit tokens:mint permission. Existing customer keys get it as an opt-in grant or a new key type, never implicitly.permissions x scopes), ttl_seconds, run_id, labels (owner, purpose, agent name), optional proof-of-possession key thumbprint, and an Idempotency-Key header.token_id, run_id, expires_at, and the effective grant echoed back so the caller can diff it.samber/developer-platform-skills@api-rate-limit-policy.<brand>_eph_); follow the prefix and checksum conventions in samber/developer-platform-skills@api-auth-key-management.Request and response shape, error codes, idempotency without a central write, caller authentication: references/mint-api-contract.md.
Keep two axes, never one flat list:
read < write < own (own adds delete, share, and permission changes). Grant the highest verb; the lower ones follow.project:A, project:B, or all, on a hierarchy (tenant > org > project > resource) where a grant on a node covers its children.A grant is a short list of permissions x scopes entries. A flat string per pair (project_a_write) multiplies verbs by resources and hits token-size limits the day a customer has 2,000 projects.
all means and write it in the API reference: snapshot (resources existing at mint) or live (includes resources created later). The trap is leaving it undefined.all, and all never leaves the parent's tenant.Encoding, hierarchy rules, the subset algorithm and worked examples: references/permission-scope-model.md.
run_id bound in the claims. When you host the sandboxes, the orchestrator is your own service acting for the customer: the customer key's grant bounds the token, and that key never reaches the sandbox.Authorization header to outbound API calls. Otherwise inject it through a local metadata endpoint or a mounted file - never an environment variable, a command-line argument or an image layer.run_id.token_id, run_id, parent chain and labels on every request, so audit answers "which run did this".run_id, and disable the run's tokens:
exp is closer than the revocation latency.Parallel sandboxes get one token each, never a shared one: one leak then kills one run. A job spanning many sandboxes shares a grant_id for a job-level kill switch. Leak paths, the injection ladder and teardown detail: references/sandbox-run-pattern.md. Agent identity and delegated user authority: samber/developer-platform-skills@agent-integration-surfaces.
Four rungs:
| Rung | Mint cost at 100k+/s | Revocation speed | Offline verify | Effort |
|---|---|---|---|---|
| Opaque random + central store | --- (durable write per mint) | +++ (delete the row) | --- | +++ |
| Signed self-contained + generation revocation | ++ (CPU, shard-local idempotency record) | + (push lag) | ++ | + |
| Hybrid: signed + async mint log | ++ | + | ++ | - |
| Capability token with holder attenuation (Biscuit, macaroons) | ++ | + | ++ (Biscuit), - (macaroons: target only) | --- |
signed > hybrid > opaque + store > capabilityopaque + store > signed > hybrid > capabilityopaque + store == signed on efficiency, because store writes are still cheap at that rate; validator topology breaks the tie (one gateway or sub-second revocation latency: opaque, several regions: signed).Default rung at 10k+/s: signed self-contained token with generation revocation. Mint needs no durable shared write, so it scales by adding mint nodes.
Sender constraint (DPoP-style proof of possession): it helps only when agent code cannot read the private key (non-exportable, or held by a proxy or sidecar) and validators reject proofs signed ahead of time (short proof window plus server nonce or replay check). A software key inside the sandbox leaks with the token. You ship both the orchestrator and the in-sandbox client, so the client-library gap that keeps DPoP rare for third-party OAuth apps does not apply.
Signing keys: a KMS-held root wraps short-lived signing keys per region or mint shard. Mint nodes sign in memory, because per-call managed-KMS signing has request quotas far below these rates; check your provider's quota. Put kid in every token, pin the algorithm per kid, publish the key set to validators, and keep a retired key verifiable for one max TTL.
Sizing for 10k, 100k and 1M mints/s: references/scale-sizing.md. Claims, algorithms, validation hygiene and key rotation: references/token-format-decision.md.
exp checked at validation is the only expiry authority. Deleting a token is garbage collection.exp on read. Prefer time-bucketed partitions dropped whole over row-by-row deletes.Store-by-store TTL behavior and derived-state cleanup: references/expiry-and-revocation-at-scale.md.
run_id, grant_id, parent chain (every ancestor credential, not only the direct parent), tenant, every org or project node its grant touches, and iat. A kill switch is a record {key, not_before} - "reject tokens under this key issued before T".not_before to now plus the clock leeway, so a mint node with a fast clock cannot stamp tokens past the cutoff. AWS STS does the same: its session revocation denies credentials whose aws:TokenIssueTime is before a cutoff set about 30 seconds into the future.run_id or grant_id with 403 run_revoked. Otherwise a killed run re-mints its way back.iat no earlier than not_before, so new tokens are not dead on arrival. Validators then apply the future-time check to nbf, not to iat.token_revoked versus unknown_kid after a key rotation. Orchestrators re-mint only on the second.exp among the run's tokens plus leeway (max TTL when a re-mint may be in flight). The list then scales with revocations per window, not tokens ever issued.Record schema, propagation options and the latency matrix: references/expiry-and-revocation-at-scale.md.
Rationalizations to reject:
| Rationalization | Why it is wrong |
|---|---|
| "TTL is 10 minutes, revocation is overkill" | A prompt-injected agent does its damage in seconds; the run kill switch stops the minutes after. |
| "We'll give the agent a 30-day token and rotate often" | Rotation shortens nothing an attacker already copied; per-run minting does. |
"Store TTL deletes it, so we skip the exp check" | Deletion lags minutes to days depending on the store. |
| "Narrow it silently if they ask for too much" | The run fails later with a 403 nobody can trace to the mint call. |
| "Put the parent key in the sandbox so it can re-mint" | The sandbox then holds the one credential the design exists to keep out. |
| "DPoP-bound, so teardown needs no revocation" | Only true when agent code cannot read the private key and validators reject proofs signed ahead of time. |
exp. New runs wait or fail to start, never with the parent key.unknown_kid; orchestrators re-mint on that cause rather than fail the run, and never on token_revoked.Deliver the design as these sections, each filled:
all semantics, attenuation rule.Gates - iterate until every one passes:
token_id.samber/developer-platform-skills@api-auth-key-management - the long-lived parent keys that mint these tokens: format, storage, rotation, dashboard.samber/developer-platform-skills@oauth2-provider-design - user-consent flows and refresh rotation for third-party apps; RFC 8693 token exchange where a user grant must become a run token.samber/developer-platform-skills@api-idempotency-retry - idempotency-key scoping and replay windows behind the mint retry rule.evals/evals.json (opens in a new tab)references/expiry-and-revocation-at-scale.md (opens in a new tab)references/mint-api-contract.md (opens in a new tab)references/permission-scope-model.md (opens in a new tab)references/prior-art.md (opens in a new tab)references/sandbox-run-pattern.md (opens in a new tab)references/scale-sizing.md (opens in a new tab)references/token-format-decision.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub samber/developer-platform-skills --plugin developer-platform-skills62 skills in this plugin
/agent-integration-surfacesPlans how a SaaS or developer platform opens itself to AI agents, provider side - which agent classes may reach which surface, how an agent proves its identity and acts for a user (Web Bot Auth, delegated tokens, provision-then-claim signup), which execution path each gets, where agents find it (Context7, api-catalog) and how agent usage is counted. Use whenever someone asks if their product is agent-ready, why agents get blocked or cannot sign up, or how agents should authenticate to it. Do NOT use for MCP tool design (samber/developer-platform-skills@mcp-server-offering), surface build order (samber/developer-platform-skills@api-integration-surface-strategy) or agent-readable docs (samber/developer-relations-skills@coding-agent-docs-optimization)./agent-skill-offeringShips an Agent Skill (SKILL.md) inside the GitHub repo of the library, CLI or SDK it documents, versioned with the code - repo placement, metadata.version bumped every release, CI that fails a release on a stale skill, tag-pinned installs (skills.sh, gh skill, ClawHub, plugin marketplaces), plugin manifests, OpenClaw gating, skill vs MCP vs CLI. Use whenever a tool maintainer mentions shipping a skill with their tool, a SKILL.md for their library, keeping a skill in sync with releases, or plugin.json versions for a skill beside code - even if they never say "agent skill". Not for standalone skill collections. Do NOT use for CLI command or --json design - use samber/developer-platform-skills@cli-interface-design; nor for MCP servers - use samber/developer-platform-skills@mcp-server-offering.Other plugins' skills for the same job