Hugging Face Audit Logs
The Hugging Face Hub audit log records user and system actions across your organization, including repository management, membership and access control changes, SSO and OAuth events, billing changes, and Spaces and Jobs activity. These logs help security and compliance teams maintain audit trails, monitor administrative activity, and build detections on access to your Hugging Face resources.
Setup
Hugging Face supports API polling to collect audit log events from your organization via the audit-log export endpoint (GET /api/organizations/{name}/audit-log/export).
- Go to Sources in RunReveal
- Click the Hugging Face source tile
- Give it a name
- Fill in your Organization name and an Access Token
- Click Connect Source
Access Token Configuration
Prerequisites:
- Your organization must be on a Team or Enterprise plan. Audit logs are not available on free plans.
- The token must belong to an organization admin. A read/write org membership is not enough — Hugging Face only exposes audit logs to admins.
- Use the organization name (slug), not the display name — for example
my-orgfromhuggingface.co/my-org.
Which token type to use:
| Token type | When to use |
|---|---|
| Classic Read | Works under Hugging Face’s default org token policy when the token owner is an org admin. |
| Fine-grained | Required if your org policy is set to Only access via fine-grained tokens. Also recommended for production least-privilege use. |
A classic Read token means the token itself is read-scoped — it does not mean a read-only org member can export audit logs. The user who creates the token must still be an org admin.
Team and Enterprise orgs can also enforce token management policies:
| Org policy | Classic Read/Write tokens | Fine-grained tokens |
|---|---|---|
| Allow access via User Access Tokens (default) | Allowed | Allowed |
| Only access via fine-grained tokens | Blocked (403) | Allowed |
| Require administrator approval | Blocked (403) | Allowed after approval (auto-approved if an org admin creates it) |
Creating a classic Read token:
- Sign in to huggingface.co as an organization admin
- Open Settings → Access Tokens
- Click Create new token, choose Read, and give it a name
- Copy the token — it will only be displayed once
Creating a fine-grained token:
- Sign in as an organization admin
- Open Settings → Access Tokens (or use a preset such as read-only)
- Click Create new token and choose Fine-grained
- Name the token (for example
runreveal-audit-logs) - Attach your organization under resource access
- Use a Read-Only preset, or Custom with the org scopes you need
- Create the token and copy it once — it will not be shown again
If the org requires administrator approval, tokens created by an org admin for that org are auto-approved. Non-admin tokens stay pending until an admin approves them.
Team or Enterprise + org admin required: If Hugging Face returns an authorization error, confirm the organization is on a supported plan, the token belongs to an org admin, and any org token policy (fine-grained only / approval required) is satisfied. See Troubleshooting below.
Collected Events
Hugging Face audit events follow a scope.action naming convention. RunReveal stores the event type in the eventName field. Scopes include:
- org — membership, roles, invitations, SSO login/join, settings, token approval, and security configuration changes (e.g.
org.add_user,org.remove_user,org.sso_login,org.update_settings) - repo — repository lifecycle, secrets and variables, settings, and trusted publishers (e.g.
repo.create,repo.delete,repo.move,repo.update_settings) - collection — collection create and delete events
- spaces — storage, volumes, hardware, and sleep-time changes
- resource_group — resource group lifecycle and membership changes
- jobs / scheduled_job — job creation, cancellation, and schedule changes
- billing — subscription, payment method, and marketplace changes
- oauth — OAuth token activity
Event Data Structure
Each audit event includes:
- Event ID and Type — Unique identifier (
_id) and event type (type) - Timestamp — When the action occurred (
createdAt, RFC 3339) - Actor Information — Author username, ID, and type
- Network Context — Source IP address and resolved location (country, city)
- Token Context — When applicable, the token type, role, and last 4 characters used for the action
Data Collection
- Collection Method: API polling every 5 minutes
- Backfill: On first connection RunReveal ingests all available audit history (the export returns up to the last 100,000 events)
- Event Format: JSON with normalized fields for consistent querying
Verify It's Working
Once added the source logs should begin flowing within a minute.
You can validate we are receiving your logs by running the following SQL query.
Schema
The following columns are exposed for this source. RunReveal applies schema normalization across all sources, ensuring uniform field names and data types for cross-source queries and reusable detection logic.
Table: huggingface_logs (51 columns)
huggingface_logs (51 columns)| Column | Type |
|---|---|
workspaceID | String |
sourceID | String |
sourceType | String |
sourceTTL | UInt32 |
receivedAt | DateTime |
id | String |
eventTime | DateTime |
eventName | String |
eventID | String |
srcIP | String |
srcASCountryCode | String |
srcASNumber | UInt32 |
srcASOrganization | String |
srcCity | String |
srcConnectionType | String |
srcISP | String |
srcLatitude | Float64 |
srcLongitude | Float64 |
srcUserType | String |
dstIP | String |
dstASCountryCode | String |
dstASNumber | UInt32 |
dstASOrganization | String |
dstCity | String |
dstConnectionType | String |
dstISP | String |
| Column | Type |
|---|---|
dstLatitude | Float64 |
dstLongitude | Float64 |
dstUserType | String |
actor | Map(String, String) |
tags | Map(String, String) |
resources | Array(String) |
serviceName | String |
enrichments | Array(Tuple(data Map(String, String), name String, provider String, type String, value String)) |
readOnly | Bool |
rawLog | String |
auditID | String |
eventType | String |
message | String |
authorID | String |
authorUser | String |
authorType | String |
actorIP | String |
locationFormatted | String |
locationCountry | String |
locationCity | String |
tokenType | String |
tokenID | String |
tokenRole | String |
tokenLast4 | String |
tokenDeleted | Bool |
Troubleshooting
Authorization error / HTTP 403 on audit-log export
RunReveal polls GET /api/organizations/{name}/audit-log/export. When Hugging Face rejects the request, source logs look like:
The important part is HTTP 403 with {"error":"Authorization error."}. The cannot unmarshal object... text is a follow-on parse failure: Hugging Face returned an error object instead of the expected JSON array of events.
Common causes:
- Token owner is not an org admin — Membership with read or write is not enough. Create the token while signed in as an admin of that organization.
- Organization is not on Team or Enterprise — Audit-log export is a Team & Enterprise feature.
- Org token policy blocks classic tokens — If the org requires fine-grained tokens only, classic Read/Write tokens return
403. Create a fine-grained token scoped to the organization instead. - Fine-grained token pending, denied, or revoked — Under approval policies, pending/denied tokens get
403. Enterprise orgs can also revoke tokens. Check the token status under Settings → Access Tokens, or ask an org admin to approve it. - Wrong or expired token — Regenerate the token and update the Access Token on the RunReveal source.
- Wrong organization slug — Use the org name in the Hub URL (
huggingface.co/<org>), not the display name.
Verify outside RunReveal:
- HTTP 200 with a JSON array — the token works; update the same token and org name on the RunReveal source.
- HTTP 403 with
{"error":"Authorization error."}— fix plan, admin role, or org token policy before retrying in RunReveal.
Org admins can review and change token policy under Hugging Face Tokens Management (docs).
Helpful Links
- Hugging Face Audit Logs - Overview of the organization audit log and available event types
- Hugging Face Hub API - Hub REST API reference
- Access Tokens - Creating and managing access tokens
- Tokens Management - Org token policies (fine-grained only, admin approval)