Skip to main content

Anthropic/admin

@webframp/anthropic/adminv2026.10.21.1· Apache-2.0· 5d agoBEHAVIORS
01README

Manage the people in a Claude Enterprise organization through the Admin API user-management endpoints: read members, custom roles, and RBAC groups with their attached roles and members, add members to a group, and switch members between the User and Custom (managed) organization roles.

Authentication

Requires an Admin API key created by the primary owner in claude.ai → Organization settings → API, for all linked organizations, with the scopes read:members, write:members, read:rbac_groups, and write:rbac_groups. Store it in a swamp vault.

Usage

swamp extension pull @webframp/anthropic/admin
swamp vault create local_encryption anthropic   # once, if you have no vault yet
swamp vault put anthropic ADMIN_KEY             # prompts; never pass the value
swamp model create @webframp/anthropic/admin claude-admin \
  --global-arg 'adminKey=${{ vault.get("anthropic", "ADMIN_KEY") }}'

# Observe (read-only)
swamp model method run claude-admin sync_access

# Put every User and Custom member in a group (dry run by default)
swamp model method run claude-admin add_group_members \
  --input groupId=rbac_group_... --input expectRoleId=rbac_role_... \
  --input 'roles:json=["user","managed"]'

# Switch User members to Custom, only those already in the group
# (dry run by default; add --input dryRun=false to apply)
swamp model method run claude-admin set_member_roles \
  --input role=managed --input requireGroupId=rbac_group_... \
  --input expectRoleId=rbac_role_... --input 'fromRoles:json=["user"]'

Methods

  • sync_members — read the member roster with organization roles
  • sync_access — fan-out read: members, custom roles, and groups with their roles and members
  • add_group_members — add members (by role or user ID) to a direct group; dry run by default
  • set_member_roles — set user or managed (by current role or user ID); managed requires coverage (requireGroupId + expectRoleId, or requireRoleId for any group carrying the role); records previous roles for rollback; dry run by default

Only user and managed members are ever targeted: the API cannot modify owner, primary_owner, or membership_admin. Every write run adds a version to its audit record.

02Release Notes

2026.10.21.1

Fixed: set_member_roles could change one more member after a cancel. When the cancel arrived while the run was re-reading the covering group and that read still completed, the next member was written before the run stopped. The run now checks for cancellation right after each re-read, so the record's changed list ends at the last write made before the cancel.

Changed: The README, the registry description, and the adminKey global argument description no longer print a token-shaped key prefix. The argument description now says to supply the key as ${{ vault.get("anthropic", "ADMIN_KEY") }}. The README and the registry Quick Start now create the vault if needed and store the key with the interactive swamp vault put anthropic ADMIN_KEY prompt before creating the model.

Upgrade note: No schema changes. The model version moves to 2026.10.21.1 with an identity upgrade.

03Behaviors1
@webframp/anthropic/adminv2026.10.21.1anthropic/admin.ts

Global Arguments

ArgumentTypeDescription
adminKeystringAdmin API key from claude.ai → Organization settings → API. Supply it as ${{ vault.get("anthropic", "ADMIN_KEY") }}; never pass the literal key
requestsPerMinute?numberClient-side pacing for Admin API calls. The API allows 100/min per organization, shared by every caller; default 80 leaves headroom.
fn sync_members()
Read every organization member with their organization role (read-only).
fn sync_access()
Fan-out, read-only: members, custom roles, and every RBAC group with its attached roles and members, in one call.
fn add_group_members(groupId: string, expectRoleId?: string, dryRun?: boolean)
Add members to a direct RBAC group, selected by organization role (live roster) or explicit user IDs. Skips members already in the group and only ever targets user and managed members. Dry run unless dryRun is false.
ArgumentTypeDescription
groupIdstringTarget group (rbac_group_...); must be a direct group
expectRoleId?stringRefuse to run unless this custom role (rbac_role_...) is attached to the group
dryRun?booleanReport what would change without sending writes (default true)
fn set_member_roles(role: enum, requireGroupId?: string, expectRoleId?: string, requireRoleId?: string, dryRun?: boolean)
Set members' organization role to user or managed (Custom), selected by current role (live roster) or explicit user IDs. Switching to managed requires coverage: either requireGroupId + expectRoleId (the group must carry the role; only its members change) or requireRoleId (only members of some group carrying the role change), so nobody becomes Custom without it. Records previous roles for rollback. Dry run unless dryRun is false.
ArgumentTypeDescription
roleenumRole to assign
requireGroupId?stringOnly change members who are in this group. Required when role is managed.
expectRoleId?stringCustom role requireGroupId must carry.
requireRoleId?stringOnly change members who are in some group carrying this custom role (alternative to requireGroupId + expectRoleId).
dryRun?booleanReport what would change without sending writes (default true)

Resources

members(1h)— Organization members and their organization roles
rbacRoles(24h)— Custom roles defined in the organization
rbacGroups(1h)— RBAC groups with attached custom roles and members
groupMemberChanges(infinite)— Result of add_group_members runs (audit record; one version per run, dry runs and applies in separate instances)
roleChanges(infinite)— Result of set_member_roles runs, with previous roles for rollback (audit record; one version per run, dry runs and applies in separate instances)
04Previous Versions1
2026.10.20.1Apache-2.0

2026.10.20.1

Added: First release. Reads members, custom roles, and RBAC groups (with their attached roles, members, and member counts by organization role) through the Claude Enterprise Admin API, adds members to direct groups, and switches members between the user and managed (Custom) organization roles.

Write methods are dry runs unless dryRun is false. set_member_roles with role: managed requires coverage — requireGroupId with expectRoleId (the group must carry the role; only its members change) or requireRoleId (only members of some group carrying the role change) — so nobody becomes Custom before the role applies. sync_access reports per-role coverage counts for verification. Only user and managed members are ever targeted. Every run writes an audit record (dry runs and applies in separate instances, one version per run) with previous roles for rollback. Requests are paced client-side (default 80/min against the API's 100/min), time out after 30 seconds, and are retried on 429, 5xx, and no response; runs stop on 401/403 or repeated identical failures.

05Stats
A
100 / 100
Downloads
6
Archive size
27.4 KB
  • Has README or module doc2/2earned
  • README has a code example1/1earned
  • README is substantive1/1earned
  • Most symbols documented1/1earned
  • No slow types (deprecated)1/1earned
  • Dependencies pass trust audit2/2earned
  • Has description1/1earned
  • Platform support declared (or universal)2/2earned
  • License2/2earned
  • Verified public repository2/2earned
06Platforms
07Labels