Anthropic Key and Audit Review
Overview
API keys are the part of an Anthropic org that leaks, outlives its owner, and runs up spend. This skill inventories them and reads the compliance feed to explain how the org got into its current state. It never sees a secret and cannot archive or rotate a key; it produces findings for a client admin to act on in Claude Console.
Admin-gated in Conduit. All three tools in this skill require the
admin tier: anthropic_admin_api_keys_list,
anthropic_admin_api_key_get, and
anthropic_admin_compliance_activities_list. With an ordinary read
grant they are not listed at all. Check conduit__my_access and ask an
org owner for the grant rather than working around it.
Anti-triggers
- Which keys are spending the money — that is cost and usage grouped
by
api_key_id; use spend-review, which is read-tier. - Who is a member right now — use seat-inventory.
Key Concepts
- Key status:
active,inactive,archived, orexpired. Filter withstatus. Onlyactivekeys can call the API. - Scope: a key belongs to a workspace (
scope.workspace_id) or, for a principal-bound key, to the organization. - Creator and principal:
created_byis who made the key (a user or a service account;nullfor legacy or system keys).principalis who the key acts as. They can differ. expires_at:nullmeans the key never expires.partial_key_hint: a redacted fragment (sk-ant-api03-R2D...igAA). It is how you match a key found in a repo, a log, or a leaked-secret alert to a key ID without ever handling the secret.- The key list does not include a last-used date. To tell whether a key
is in use, group spend or usage by
api_key_id(read-tier, see spend-review).
Workflows
Key hygiene review
anthropic_admin_organization_get- confirm the org.anthropic_admin_api_keys_listwithstatus: "active",limit: 1000, pagingafter_idto the end.- Flag, in this order:
- active keys created by someone no longer in
anthropic_admin_users_list(orphaned keys); - active keys with
expires_at: null; - active keys in the default workspace, where they are hardest to attribute to a client or project;
- generic names (
test,key,my key) that nobody can own.
- active keys created by someone no longer in
- Cross-check which flagged keys have spent anything in the last 30 days
with
anthropic_admin_analytics_costoranthropic_admin_usage_report_messages, both grouped byapi_key_id(the legacyanthropic_admin_cost_reportcannot split by key). An orphaned key with spend is urgent; one with none is cleanup.
Leaver key sweep
- Resolve the leaver's user ID (from
anthropic_admin_users_listbefore removal, or from the compliance feed if they are already gone). anthropic_admin_api_keys_listwithcreated_by_user_idandstatus: "active".- Report each key with name, workspace, and partial hint, and recommend the client archive it in Claude Console. Keys a leaver created keep working after their seat is removed.
Leaked key triage
Given a key fragment from a secret-scanning alert:
anthropic_admin_api_keys_list(all statuses), match onpartial_key_hint.anthropic_admin_api_key_geton the match for full metadata.- Pull recent spend and usage for that
api_key_idto see whether it was used. - Recommend immediate archive in Console. Do not ask anyone to paste the full key to "confirm".
Activity timeline
anthropic_admin_compliance_activities_listwithcreated_at_gte/created_at_ltaround the window,order: "asc", andlimitup to 5000, pagingafter_id.- Narrow with
user_ids,actor_ids, oractivity_typesonce you see which types the org emits. Useexclude_activity_typesto drop noisy sign-in events when you are after role or key changes. - Present a time-ordered table: when, actor, activity type, target.
Gotchas
- An empty or 403/404 compliance feed can mean the feature is not available to this org rather than "nothing happened". Say which.
- The compliance feed and the key inventory are sensitive. Keep raw output inside the MSP; client reports carry findings, not dumps.
- A key list from one page is not an inventory. Page to the end.
Related Skills
- api-patterns - tiers, pagination, errors
- seat-inventory - who is still a member
- spend-review - which keys are spending