Anthropic/compliance
Observe a Claude Enterprise account via the Compliance API. Covers the 6-year activity audit feed, organization directory (users, roles, groups with SCIM source attribution), and effective runtime settings (retention, redaction, IP allowlist, SSO mode, code execution egress).
Authentication
Requires a Compliance Access Key (sk-ant-api01-...) created by the
primary owner in claude.ai → Org settings → API access. Store in a
swamp vault.
Usage
swamp extension pull @webframp/anthropic/compliance
swamp model create @webframp/anthropic/compliance claude-compliance \
--global-arg 'complianceKey=${{ vault.get("anthropic", "COMPLIANCE_KEY") }}'
# Discover org
swamp model method run claude-compliance sync_organizations
# Full directory sync (users + roles + groups)
swamp model method run claude-compliance sync_directory
# Effective settings
swamp model method run claude-compliance sync_effective_settings
# Audit feed
swamp model method run claude-compliance collect_activities
swamp model method run claude-compliance collect_activities \
--input activity_types=user.login,conversation.createMethods
- sync_organizations — discover orgs visible to the key
- sync_users — paginate all directory users
- sync_roles — list defined roles
- sync_groups — list groups
- get_group_members — members with SCIM source attribution
- sync_directory — fan-out: users + roles + groups in one call
- sync_effective_settings — observe runtime config
- collect_activities — filterable audit feed (6-year retention)
Reports
- config-snapshot — aggregates effective settings, roles, groups, organizations, and directory user count (never the roster itself) into one JSON artifact, for exporting to a git-tracked config repo. Runs as a default report on every method call.
2026.08.21.2
Changed: collect_activities's since argument is now validated as a
parseable timestamp before being sent to the API — previously a malformed
value passed straight through and only surfaced as an opaque upstream 400.
get_group_members's best-effort group-name lookup no longer swallows its
failure silently; a failed lookup now logs a message naming the group ID and
the underlying error before falling back to using the ID as the display name.
The config-snapshot report's data reads no longer treat a storage-backend
failure and "this spec was never collected" identically. A failed
getContent call or unparseable JSON now logs a warning naming the spec and
model instance before the report falls back to omitting that section.
Global Arguments
| Argument | Type | Description |
|---|---|---|
| complianceKey | string | Compliance Access Key (sk-ant-api01-...) from claude.ai org settings (use vault reference) |
| orgId? | string | Organization ID to scope queries. Omit to auto-discover from /v1/compliance/organizations. |
| Argument | Type | Description |
|---|---|---|
| activity_types? | string | Comma-separated activity type filter (e.g. 'user.login,conversation.create') |
| since? | string | ISO-8601 timestamp — collect activities created after this time |
| limit? | string | Max activities to collect per page (default 100, max 5000) |
| Argument | Type | Description |
|---|---|---|
| groupId | string | Group ID to fetch members for |
Resources
Aggregate effective settings, roles, groups, organizations, and directory user count into one git-diffable config snapshot
2026.08.21.1
Changed: Added descriptions to every previously undocumented field across
the activities, organizations, users, roles, groups,
groupMembers, and effectiveSettings resource schemas. No behavioral
change.
2026.07.30.1
Fixed: sync_groups and sync_directory returned HTTP 404 from the
Anthropic Compliance API. The org-scoped groups endpoint
(/v1/compliance/organizations/{orgId}/groups) no longer exists; groups are
now served at the top-level path /v1/compliance/groups.
Changed: All three call sites that listed groups (sync_groups,
sync_directory, and the name-lookup fallback in get_group_members) now
use /v1/compliance/groups instead of the former org-scoped path.
Upgrade note: No action required. The resource schema and instance names
are unchanged — only the upstream API path differs. Re-run sync_groups or
sync_directory after upgrading to populate the groups resource.
2026.07.30.1
Fixed: sync_groups and sync_directory returned HTTP 404 from the
Anthropic Compliance API. The org-scoped groups endpoint
(/v1/compliance/organizations/{orgId}/groups) no longer exists; groups are
now served at the top-level path /v1/compliance/groups.
Changed: All three call sites that listed groups (sync_groups,
sync_directory, and the name-lookup fallback in get_group_members) now
use /v1/compliance/groups instead of the former org-scoped path.
Upgrade note: No action required. The resource schema and instance names
are unchanged — only the upstream API path differs. Re-run sync_groups or
sync_directory after upgrading to populate the groups resource.
2026.07.17.1
Added:
- New
config-snapshotreport (@webframp/compliance-config-snapshot), registered as a default report on the model type. Aggregates the latesteffectiveSettings,roles,groups, andorganizations, plus the directory user count (never the roster), into one JSON artifact —swamp report get @webframp/compliance-config-snapshot --model claude-compliance --json. Intended to be exported into a git-tracked config repo so drift and growth are visible viagit log/git diff. Individual users and group membership are deliberately excluded: that data is SCIM/Entra-owned, not config, and carries PII.
2026.07.15.1
Fixed:
sync_users,sync_roles,sync_groups,sync_effective_settings, and thesync_directoryfan-out all wrote their resource using the organization ID as the instance name. Since every one of those specs shared the same instance name, each sync method's write landed as a new version of the same data artifact rather than its own resource — runningsync_rolesaftersync_effective_settingssilently pushed the effective settings snapshot into history, andswamp data get claude-compliance <orgId>would return whichever spec synced most recently, not a specific one.
Changed:
- These methods now write to a fixed instance name equal to their own spec name
(
"users","roles","groups","effectiveSettings") instead of the organization ID, matching the existing pattern used bycollect_activities("recent") andsync_organizations("all") — each spec's instance name is exclusive to that spec, since swamp's storage key is(modelId, name)and does not includespecName. An earlier draft of this fix used a single shared literal ("current") for all four specs, which reproduced the exact same collision under a different name; that was caught in review before release. get_group_membersnow writes tomember:<groupId>instead of the baregroupId. SincegroupIdis caller-supplied, an unnamespaced write could collide with one of the new fixed literals above (e.g. a group ID of"users"would have landed on the same data name assync_users).
Upgrade note: Data written under the old org-ID-keyed name by previous
versions is orphaned by this change — it remains in history (subject to each
resource's normal GC policy) but is no longer returned by
swamp data get claude-compliance <orgId>. Re-run sync_users, sync_roles,
sync_groups, and sync_effective_settings (or sync_directory) after
upgrading, then read them back with swamp data get claude-compliance users /
roles / groups / effectiveSettings. Group member data moves from
swamp data get claude-compliance <groupId> to
swamp data get claude-compliance member:<groupId> — update any CEL expressions
or scripts referencing the old form.
2026.07.07.1
Fixed:
collect_activitiessincefilter: the Compliance API expects the dotted range parametercreated_at.gte, not the bracketedcreated_at[gte], which returned HTTP 400 (Unknown query parameter: 'created_at[gte]'). Thesinceargument now filters activities correctly.
2026.07.03.1
Fixed:
- Organization ID mapping: The Anthropic compliance API returns org identifiers
in the
uuidfield, notid.resolveOrgIdandsync_organizationsnow correctly preferuuidoverid, fixing auto-discovery failures. - Activity schema:
actor.id,actor.email,actor.name, anddetailsare now nullable+optional, matching actual API response shapes (e.g.api_actorhasapi_key_idbut noid/email/name).
Changed:
collect_activitiesnow writes to the"recent"instance (was"latest"). swamp reserves"latest"for internal use. If you have CEL expressions referencingdata.latest("claude-compliance", "latest"), update them todata.latest("claude-compliance", "recent").
2026.07.02.1
Added: Initial release. Compliance API observation model with 8 methods: sync_organizations, sync_users, sync_roles, sync_groups, get_group_members, sync_directory (fan-out), sync_effective_settings, collect_activities. Seven versioned resource specs for CEL queries.
2026.07.17.1
Added:
- New
config-snapshotreport (@webframp/compliance-config-snapshot), registered as a default report on the model type. Aggregates the latesteffectiveSettings,roles,groups, andorganizations, plus the directory user count (never the roster), into one JSON artifact —swamp report get @webframp/compliance-config-snapshot --model claude-compliance --json. Intended to be exported into a git-tracked config repo so drift and growth are visible viagit log/git diff. Individual users and group membership are deliberately excluded: that data is SCIM/Entra-owned, not config, and carries PII.
2026.07.15.1
Fixed:
sync_users,sync_roles,sync_groups,sync_effective_settings, and thesync_directoryfan-out all wrote their resource using the organization ID as the instance name. Since every one of those specs shared the same instance name, each sync method's write landed as a new version of the same data artifact rather than its own resource — runningsync_rolesaftersync_effective_settingssilently pushed the effective settings snapshot into history, andswamp data get claude-compliance <orgId>would return whichever spec synced most recently, not a specific one.
Changed:
- These methods now write to a fixed instance name equal to their own spec name
(
"users","roles","groups","effectiveSettings") instead of the organization ID, matching the existing pattern used bycollect_activities("recent") andsync_organizations("all") — each spec's instance name is exclusive to that spec, since swamp's storage key is(modelId, name)and does not includespecName. An earlier draft of this fix used a single shared literal ("current") for all four specs, which reproduced the exact same collision under a different name; that was caught in review before release. get_group_membersnow writes tomember:<groupId>instead of the baregroupId. SincegroupIdis caller-supplied, an unnamespaced write could collide with one of the new fixed literals above (e.g. a group ID of"users"would have landed on the same data name assync_users).
Upgrade note: Data written under the old org-ID-keyed name by previous
versions is orphaned by this change — it remains in history (subject to each
resource's normal GC policy) but is no longer returned by
swamp data get claude-compliance <orgId>. Re-run sync_users, sync_roles,
sync_groups, and sync_effective_settings (or sync_directory) after
upgrading, then read them back with swamp data get claude-compliance users /
roles / groups / effectiveSettings. Group member data moves from
swamp data get claude-compliance <groupId> to
swamp data get claude-compliance member:<groupId> — update any CEL expressions
or scripts referencing the old form.
2026.07.07.1
Fixed:
collect_activitiessincefilter: the Compliance API expects the dotted range parametercreated_at.gte, not the bracketedcreated_at[gte], which returned HTTP 400 (Unknown query parameter: 'created_at[gte]'). Thesinceargument now filters activities correctly.
2026.07.03.1
Fixed:
- Organization ID mapping: The Anthropic compliance API returns org identifiers
in the
uuidfield, notid.resolveOrgIdandsync_organizationsnow correctly preferuuidoverid, fixing auto-discovery failures. - Activity schema:
actor.id,actor.email,actor.name, anddetailsare now nullable+optional, matching actual API response shapes (e.g.api_actorhasapi_key_idbut noid/email/name).
Changed:
collect_activitiesnow writes to the"recent"instance (was"latest"). swamp reserves"latest"for internal use. If you have CEL expressions referencingdata.latest("claude-compliance", "latest"), update them todata.latest("claude-compliance", "recent").
2026.07.02.1
Added: Initial release. Compliance API observation model with 8 methods: sync_organizations, sync_users, sync_roles, sync_groups, get_group_members, sync_directory (fan-out), sync_effective_settings, collect_activities. Seven versioned resource specs for CEL queries.
Added 1 reports
2026.07.15.1
Fixed:
sync_users,sync_roles,sync_groups,sync_effective_settings, and thesync_directoryfan-out all wrote their resource using the organization ID as the instance name. Since every one of those specs shared the same instance name, each sync method's write landed as a new version of the same data artifact rather than its own resource — runningsync_rolesaftersync_effective_settingssilently pushed the effective settings snapshot into history, andswamp data get claude-compliance <orgId>would return whichever spec synced most recently, not a specific one.
Changed:
- These methods now write to a fixed instance name equal to their own spec
name (
"users","roles","groups","effectiveSettings") instead of the organization ID, matching the existing pattern used bycollect_activities("recent") andsync_organizations("all") — each spec's instance name is exclusive to that spec, since swamp's storage key is(modelId, name)and does not includespecName. An earlier draft of this fix used a single shared literal ("current") for all four specs, which reproduced the exact same collision under a different name; that was caught in review before release. get_group_membersnow writes tomember:<groupId>instead of the baregroupId. SincegroupIdis caller-supplied, an unnamespaced write could collide with one of the new fixed literals above (e.g. a group ID of"users"would have landed on the same data name assync_users).
Upgrade note: Data written under the old org-ID-keyed name by previous
versions is orphaned by this change — it remains in history (subject to
each resource's normal GC policy) but is no longer returned by swamp data get claude-compliance <orgId>. Re-run sync_users, sync_roles,
sync_groups, and sync_effective_settings (or sync_directory) after
upgrading, then read them back with swamp data get claude-compliance users / roles / groups / effectiveSettings. Group member data moves
from swamp data get claude-compliance <groupId> to swamp data get claude-compliance member:<groupId> — update any CEL expressions or scripts
referencing the old form.
2026.07.07.1
Fixed:
collect_activitiessincefilter: the Compliance API expects the dotted range parametercreated_at.gte, not the bracketedcreated_at[gte], which returned HTTP 400 (Unknown query parameter: 'created_at[gte]'). Thesinceargument now filters activities correctly.
2026.07.03.1
Fixed:
- Organization ID mapping: The Anthropic compliance API returns org identifiers
in the
uuidfield, notid.resolveOrgIdandsync_organizationsnow correctly preferuuidoverid, fixing auto-discovery failures. - Activity schema:
actor.id,actor.email,actor.name, anddetailsare now nullable+optional, matching actual API response shapes (e.g.api_actorhasapi_key_idbut noid/email/name).
Changed:
collect_activitiesnow writes to the"recent"instance (was"latest"). swamp reserves"latest"for internal use. If you have CEL expressions referencingdata.latest("claude-compliance", "latest"), update them todata.latest("claude-compliance", "recent").
2026.07.02.1
Added: Initial release. Compliance API observation model with 8 methods: sync_organizations, sync_users, sync_roles, sync_groups, get_group_members, sync_directory (fan-out), sync_effective_settings, collect_activities. Seven versioned resource specs for CEL queries.
2026.07.07.1
Fixed:
collect_activitiessincefilter: the Compliance API expects the dotted range parametercreated_at.gte, not the bracketedcreated_at[gte], which returned HTTP 400 (Unknown query parameter: 'created_at[gte]'). Thesinceargument now filters activities correctly.
2026.07.03.1
Fixed:
- Organization ID mapping: The Anthropic compliance API returns org identifiers
in the
uuidfield, notid.resolveOrgIdandsync_organizationsnow correctly preferuuidoverid, fixing auto-discovery failures. - Activity schema:
actor.id,actor.email,actor.name, anddetailsare now nullable+optional, matching actual API response shapes (e.g.api_actorhasapi_key_idbut noid/email/name).
Changed:
collect_activitiesnow writes to the"recent"instance (was"latest"). swamp reserves"latest"for internal use. If you have CEL expressions referencingdata.latest("claude-compliance", "latest"), update them todata.latest("claude-compliance", "recent").
2026.07.02.1
Added: Initial release. Compliance API observation model with 8 methods: sync_organizations, sync_users, sync_roles, sync_groups, get_group_members, sync_directory (fan-out), sync_effective_settings, collect_activities. Seven versioned resource specs for CEL queries.
2026.07.03.1
Fixed:
- Organization ID mapping: The Anthropic compliance API returns org identifiers
in the
uuidfield, notid.resolveOrgIdandsync_organizationsnow correctly preferuuidoverid, fixing auto-discovery failures. - Activity schema:
actor.id,actor.email,actor.name, anddetailsare now nullable+optional, matching actual API response shapes (e.g.api_actorhasapi_key_idbut noid/email/name).
Changed:
collect_activitiesnow writes to the"recent"instance (was"latest"). swamp reserves"latest"for internal use. If you have CEL expressions referencingdata.latest("claude-compliance", "latest"), update them todata.latest("claude-compliance", "recent").
2026.07.02.1
Added: Initial release. Compliance API observation model with 8 methods: sync_organizations, sync_users, sync_roles, sync_groups, get_group_members, sync_directory (fan-out), sync_effective_settings, collect_activities. Seven versioned resource specs for CEL queries.
2026.07.02.1
Added: Initial release. Compliance API observation model with 8 methods: sync_organizations, sync_users, sync_roles, sync_groups, get_group_members, sync_directory (fan-out), sync_effective_settings, collect_activities. Seven versioned resource specs for CEL queries.
- 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
- License declared1/1earned
- Verified public repository2/2earned