CLAUDE LABJP
VERSION — v2.1.227 landed on August 10 with no new features, just fixes around plan detection and CI behaviorAUTO — Two days remain until August 14, when auto mode becomes the default in Claude Code for Pro, Max, and TeamCI — Bash commands no longer fail across the board under claude-code-action with allowed_non_write_users on GitHub-hosted runnersBILLING — Sessions started with an expired token could misread your plan and nudge Max users toward usage credits; that is now fixedSUNSET — The legacy Workbench and the experimental prompt tool APIs retire on August 17, five days outPRICE — Sonnet 5 promo pricing at $2/$10 per Mtok runs through August 31, moving to $3/$15 on September 1VERSION — v2.1.227 landed on August 10 with no new features, just fixes around plan detection and CI behaviorAUTO — Two days remain until August 14, when auto mode becomes the default in Claude Code for Pro, Max, and TeamCI — Bash commands no longer fail across the board under claude-code-action with allowed_non_write_users on GitHub-hosted runnersBILLING — Sessions started with an expired token could misread your plan and nudge Max users toward usage credits; that is now fixedSUNSET — The legacy Workbench and the experimental prompt tool APIs retire on August 17, five days outPRICE — Sonnet 5 promo pricing at $2/$10 per Mtok runs through August 31, moving to $3/$15 on September 1
Articles/API & SDK
API & SDK/2026-06-22Advanced

Drop Your Static Claude API Keys: Moving CI and Production to Keyless Auth with Workload Identity Federation

Workload Identity Federation is now generally available on the Claude Platform. This guide walks through replacing long-lived sk-ant- keys with short-lived OIDC tokens, including keyless GitHub Actions auth, the migration steps, and token refresh design.

Claude47API28Security11Authentication2CI/CD19

Premium Article

Have you ever pushed a file containing an API key to GitHub and felt your stomach drop? It happened to me once, back when I was juggling several repositories as an indie developer, and I spent a frantic afternoon revoking and rotating. There was no real damage, but the incident taught me something at a gut level: the danger isn't carelessness, it's the structure. A long-lived secret string will inevitably end up somewhere — in history, in logs, in CI — and stay there.

In June 2026, Workload Identity Federation (WIF) became generally available on the Claude Platform. In one sentence: you stop holding a long-lived sk-ant-... key entirely and instead have a short-lived token minted at request time. Once the premise of "store the key" disappears, most of the headaches — leakage, rotation, inventory — fall away with it. Running automated publishing across several Dolice sites by myself, I found this a quiet change with an outsized payoff. Let's walk through how it works and how to land it in CI and production, including the spots where people get stuck.

The structural risk in static keys

The trouble with a static key isn't performance or price — it's the absence of an expiry. Once issued, an sk-ant-... key is valid forever unless you explicitly revoke it. From the moment that string is exposed until the instant you finish revoking, the entire window is attackable.

And exposure routes are surprisingly varied: commit history, CI log output, shell history files, container image layers, stack traces shipped to your error monitor. If even one slips through, anyone holding that string can impersonate you. Because the key itself is the credential, this is structural, not a matter of discipline. I wrote up the emergency response in how to handle a committed API key, but the strongest defense is to not hold a key at all.

From "holding a key" to "minted on demand"

WIF inverts how you hold credentials. A traditional API key is itself the credential. With WIF, a token is issued — only when needed — to a principal called a service account. You don't hold the key; the key is minted for you.

The flow has three stages:

  1. An identity provider (IdP) you already operate issues a signed OIDC token (a JWT) to the workload. On most platforms this is ambient: a Kubernetes projected service-account token, the Google Cloud metadata server, Azure IMDS, or the GitHub Actions OIDC endpoint.
  2. The SDK presents that JWT to Claude's token endpoint. Anthropic verifies the signature and claims, then exchanges it for a short-lived Anthropic access token.
  3. The SDK attaches that token to every request and re-exchanges it before it expires. Your application code calls the API as usual, passing no api_key at all.

The key point is that the SDK carries the exchange-and-refresh loop for you. All you configure is "which rule, and whose JWT, to exchange."

Thank you for reading this far.

Continue Reading

What follows includes implementation code, benchmarks, and practical content we hope you'll find useful. This site runs without ads — server and development costs are supported entirely by members like you. If it's been helpful, we'd be truly grateful for your support.

WHAT YOU'LL LEARN
A concrete path from static sk-ant- keys to OIDC tokens that expire in minutes
A GitHub Actions setup that calls the Claude API with zero API keys in CI secrets
The trap where ANTHROPIC_API_KEY silently shadows federation, and how ant auth status reveals it
Designing token lifetime as the lesser of the rule's token_lifetime_seconds and the JWT's remaining life
Secure payment via Stripe · Cancel anytime

Unlock This Article

Get full access to the rest of this article. Buy once, read anytime. This site is ad-free — your support goes directly toward keeping it running.

or
Unlock all articles with Membership →
Share

Thank You for Reading

Claude Lab is ad-free, supported entirely by members like you. We publish practical guides daily with implementation code, benchmarks, and production-ready patterns. If you've found it useful, we'd love to have you on board.

  • Copy-paste ready implementation code
  • New advanced guides published daily
  • $5/mo or $10 for lifetime access
View Membership →

Related Articles

API & SDK2026-06-21
Connecting Managed Agents to Services You Don't Want to Expose: MCP Tunnel Design
How to connect Claude Managed Agents to an internal MCP server that is never exposed to the public internet. We cover the MCP tunnel, self-hosted sandboxes, authorization boundaries, and graceful degradation when things break.
API & SDK2026-07-24
When Memory Store Listings Returned Half the Rows: Migrating to agent-memory-2026-07-22
agent-memory-2026-07-22 changed memories.list: fixed ordering, stricter depth, segment-based path_prefix matching. How an audit quietly halved, an access layer that survives it, and measured depth=1 traversal cost.
API & SDK2026-07-14
A Two-Stage Pre-Publish Gate for User-Facing AI Text in Consumer Apps
Design a two-stage pre-publish gate for short AI-generated text you ship to end users: a deterministic rule layer plus a Claude classifier, with fail-closed handling, generation-time vetting, and a cost model. Full implementation code included.
📚RECOMMENDED BOOKS
Build a Large Language Model (From Scratch)
Sebastian Raschka
LLM Dev
Prompt Engineering for LLMs
Berryman & Ziegler
Prompting
AI Engineering
Chip Huyen
AI Eng
* Contains affiliate links
See all →