Skip to main content

Anthropic/compliance

@webframp/anthropic/compliancev2026.07.07.1· 1d agoMODELS
01README

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.create

Methods

  • 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)
02Release Notes

2026.07.07.1

Fixed:

  • collect_activities since filter: the Compliance API expects the dotted range parameter created_at.gte, not the bracketed created_at[gte], which returned HTTP 400 (Unknown query parameter: 'created_at[gte]'). The since argument now filters activities correctly.

2026.07.03.1

Fixed:

  • Organization ID mapping: The Anthropic compliance API returns org identifiers in the uuid field, not id. resolveOrgId and sync_organizations now correctly prefer uuid over id, fixing auto-discovery failures.
  • Activity schema: actor.id, actor.email, actor.name, and details are now nullable+optional, matching actual API response shapes (e.g. api_actor has api_key_id but no id/email/name).

Changed:

  • collect_activities now writes to the "recent" instance (was "latest"). swamp reserves "latest" for internal use. If you have CEL expressions referencing data.latest("claude-compliance", "latest"), update them to data.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.

03Models1
@webframp/anthropic/compliancev2026.07.07.1anthropic/compliance.ts

Global Arguments

ArgumentTypeDescription
complianceKeystringCompliance Access Key (sk-ant-api01-...) from claude.ai org settings (use vault reference)
orgId?stringOrganization ID to scope queries. Omit to auto-discover from /v1/compliance/organizations.
fn collect_activities(activity_types?: string, since?: string, limit?: string)
Collect recent compliance activities. Use activity_types to filter (e.g. 'user.login', 'conversation.create').
ArgumentTypeDescription
activity_types?stringComma-separated activity type filter (e.g. 'user.login,conversation.create')
since?stringISO-8601 timestamp — collect activities created after this time
limit?stringMax activities to collect per page (default 100, max 5000)
fn sync_organizations()
Discover organizations visible to the compliance key.
fn sync_users()
Sync all directory users for the organization. Paginates automatically.
fn sync_roles()
Sync roles defined for the organization.
fn sync_groups()
Sync groups for the organization. Use get_group_members for member detail with SCIM source attribution.
fn get_group_members(groupId: string)
Get members of a specific group, including SCIM source attribution (direct vs scim).
ArgumentTypeDescription
groupIdstringGroup ID to fetch members for
fn sync_effective_settings()
Observe effective runtime settings: data retention, content redaction, IP allowlist, SSO mode, code execution egress.
fn sync_directory()
Fan-out: sync users, roles, and groups for the organization in one method call.

Resources

activities(1h)— Compliance activity feed (audit trail, 6-year retention)
organizations(24h)— Organizations visible to the compliance key
users(1h)— Directory users for an organization
roles(24h)— Roles defined for an organization
groups(24h)— Groups defined for an organization
groupMembers(1h)— Members of a specific group with SCIM source attribution
effectiveSettings(1h)— Effective runtime settings (retention, redaction, IP allowlist, SSO mode)
04Previous Versions2
2026.07.03.1Jul 3, 2026

2026.07.03.1

Fixed:

  • Organization ID mapping: The Anthropic compliance API returns org identifiers in the uuid field, not id. resolveOrgId and sync_organizations now correctly prefer uuid over id, fixing auto-discovery failures.
  • Activity schema: actor.id, actor.email, actor.name, and details are now nullable+optional, matching actual API response shapes (e.g. api_actor has api_key_id but no id/email/name).

Changed:

  • collect_activities now writes to the "recent" instance (was "latest"). swamp reserves "latest" for internal use. If you have CEL expressions referencing data.latest("claude-compliance", "latest"), update them to data.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.1Jul 3, 2026

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.

05Stats
A
100 / 100
Downloads
0
Archive size
14.7 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
  • License declared1/1earned
  • Verified public repository2/2earned
06Platforms
07Labels