Skip to content
Claude Certified Developer – Foundations (CCDV-F) Exam Prep

Lesson 22 of 25 · 7 min

x
22/25

Identity, Secrets and Key Management

Video lesson: CCDV-F 22/25: Identity, Secrets, and Key Management (Domain 7, 1.6%)

Official scope (Exam Guide v1.0): secrets, credentials and API keys; identity validation; access approval and level verification; authorised access monitoring.

Three ways to authenticate

MethodCredentialBest for
API keyStatic sk-ant-api... secret as Authorization: Bearer (legacy x-api-key still works)Local dev, scripts, servers that control secret storage
Workload Identity FederationShort-lived token exchanged from your IdP's identity token (POST /v1/oauth/token); the SDK refreshes itCloud workloads, CI/CD, Kubernetes: removes static secrets
App AttestShort-lived token (1 hour, Messages API only) for a genuine attested iOS/macOS appApps calling the API directly with no back end

Key types

TypeActs asStops working when
Personal keyYou, with your rolesYou leave the org (archived) or lose workspace access
Service account keyA service accountThe service account is archived or removed
Workspace key (legacy)No one; belongs to the workspaceExpires, disabled/deleted, or workspace archived

Prefer identity-backed keys (personal, service account): they cannot outlive their owner. Shared or automated workloads use a service account, never a personal key. A key not scoped to a workspace must send anthropic-workspace-id on each request.

Lifecycle

  • Expiry chosen at creation (3 hours, 1 day, 7 days, 30 days, custom, or never) and cannot be changed later; expired keys return 401 and cannot be revived.
  • Disable is reversible; delete is permanent (archived). Store keys in a secrets manager; rotate.
  • Expiry limits a leak but is not a substitute for hygiene.
  • Federation is only as strong as the IdP configuration; a static upstream secret that can mint IdP tokens undermines it.

Patterns (design guidance)

  • Server-side proxy: never ship a key to a browser or mobile app (unless App Attest); your server holds it, applies limits, logs.
  • Separate keys per environment and service, scoped to a workspace, so one leak exposes little.
  • Agents and Claude Code: no secrets in prompts, CLAUDE.md or committed settings; keep them in the environment or a secrets manager and deny the agent read access to secret files.

Identity validation and access approval (design guidance)

Confirm the caller before issuing or honouring credentials; grant the minimum level; require approval for elevated access; re-verify before sensitive operations.

Authorised access monitoring (verified tools)

Admin API lists keys with expires_at and status; Console usage export and the Usage and Cost API break usage down by API key and model; alert on unusual use; audit who created and who uses each key.

If a key leaks (design guidance)

Disable → rotate and redeploy → find the exposure → review usage for abuse → fix the process.

Exam traps

  • Key in front-end JavaScript.
  • Personal key powering a shared service.
  • "Expiry means we can skip rotation."
  • Static keys in CI when federation is available.

References

  1. Authentication — checked Oct 16, 2026
  2. Usage and Cost API — checked Oct 16, 2026
  3. Errors — checked Oct 16, 2026

Check your understanding

  • CI pipeline needs API access. Best credential?Show answer

    Answer

    Workload Identity Federation (else a service account key).
  • Developer leaves; the shared service breaks. Root cause?Show answer

    Answer

    A personal key on a shared workload.
  • Suspected leak. First action?Show answer

    Answer

    Disable the key.
  • How do you see which key is driving unusual spend?Show answer

    Answer

    Usage export or Usage and Cost API grouped by API key.
Previous

Progress is saved in this browser.

Next Lesson