Langfuse launches AI Gateway Learn more
DocsAudit Logs

Audit Logs

Where is this feature available?
  • Hobby
    Not Available
  • Core
    Not Available
  • Pro
    Not Available
  • Enterprise
    Available
  • Self Hosted
    Enterprise Edition

Langfuse's audit logging system provides comprehensive tracking of all system activities, capturing detailed information about who performed what actions, when they occurred, and what changes were made. This feature is essential for enterprise security, compliance requirements, and incident investigation.

What are Audit Logs?

Audit logs are immutable records of all significant activities within your Langfuse organization and projects. They capture:

  • Who: User or API key that performed the action
  • What: The specific action taken (create, update, delete)
  • When: Precise timestamp of the action
  • Where: Organization and project context
  • Details: Complete before/after state for modifications

These logs provide a complete audit trail for security monitoring, compliance reporting, and forensic analysis.

Audit logs can also record who read your data. See read access.

Viewing Audit Logs

The audit log viewer is available in the Enterprise Edition and provides:

Audit Logs Interface

Access Control

  • Available to users with auditLogs:read permission
  • Typically accessible to project OWNERs and ADMINs
  • Controlled through Langfuse's role-based access control system

Scope and navigation

  • Project scope: View audit logs for the currently selected project
  • Pagination: Browse audit logs from newest to oldest

Exporting Audit Logs

You can export audit logs directly from the UI. Thereby you can analyze your data externally or create backups of important information.

How to use:

  • Navigate to your audit logs table
  • Click the export button on the top right

Event Types and Data Capture

Auditable Resources

Langfuse tracks specific actions across all system resources. The following table shows the exact resource types and actions that are logged. When read-access logging is on, access events add list and read on traces, observations, scores, sessions, and experiments; download on traces and observations; and export on batch exports.

ResourceActions
Annotation Queuecreate, delete, update
Annotation Queue Itemcomplete, create, delete
API Keycreate, delete, update
Batch Actioncreate, delete
Batch Exportcreate, download, export
Blob Storage Integrationupdate
Commentcreate, delete
Datasetcreate, delete, update
Dataset Itemcreate, delete, update
Dataset Rundelete
Evaluation Templatecreate
Experimentlist, read
Jobcreate, delete, update
LLM API Keycreate, delete
Membershipcreate, delete
Membership Invitationcreate, delete
Modelcreate, delete, update
Observationdownload, list, read
Organizationcreate, delete, update
Organization Membershipcreate, delete, update
PostHog Integrationdelete, update
Projectcreate, delete, transfer, update
Project Membershipcreate, delete, update
Promptcreate, delete, promote, setLabel, update, updateTags
Prompt Protected Labelcreate
Scorecreate, delete, list, read, update
Score Configcreate, update
Sessionbookmark, list, publish, read
Stripe Checkout Sessioncreate
Tracebookmark, delete, download, list, publish, read, updateTags

State Capture

For update operations, Langfuse captures:

  • Before State: Complete resource state prior to modification
  • After State: Complete resource state after modification

States are stored as JSON, providing full context for any modifications made to your data.

User Attribution

Identity Sources

Audit logs distinguish between different types of actors:

  • User Actions (USER type): Actions performed by authenticated users through the web interface
  • API Key Actions (API_KEY type): Programmatic actions via API keys

Context Information

Each entry includes:

  • User ID: For user-initiated actions
  • API Key ID: For programmatic actions
  • Organization ID: Organizational context
  • Role Context: User's organizational and project roles at the time of action

Read access

By default, audit logs record changes. With read-access logging on, Langfuse also records an access event when a user or API key reads traces, observations, scores, sessions or experiments through one of the covered views, API routes and MCP tools. Use these events to answer questions such as "who opened this trace?" or "which traces did this user see in a search?".

Access events appear in the audit log viewer next to change events.

Turn on read-access logging

Read-access logging is off by default.

Organization setting

  1. Go to Organization settings → Audit Logs.
  2. Turn on Access Logging.

Langfuse records reads in every project of the organization from then on. Reads from before you turned it on are not recorded. Turning it on or off is recorded as a change event.

To change the setting, you need permission to update the organization (the organization OWNER or ADMIN role). The setting is available on Langfuse Cloud Enterprise plans and on self-hosted instances with an Enterprise or Government license key.

On Langfuse Cloud HIPAA (hipaa.cloud.langfuse.com), read-access logging is always on for every organization, and the setting is not shown.

Self-hosted: instance setting

Instance administrators can set read-access logging for all organizations with LANGFUSE_AUDIT_LOG_ACCESS_EVENTS on the web container:

ValueBehavior
org (default)Each organization decides with the Access Logging setting.
enforcedReads are recorded in every organization. The organization setting is hidden.
disabledReads are never recorded. The organization setting is hidden.

Requirements:

  • An Enterprise or Government license key (LANGFUSE_EE_LICENSE_KEY) on the web and worker containers. Without one, nothing is recorded, even with enforced.
  • Langfuse v4.82.0 or later.

If Langfuse runs behind a load balancer or reverse proxy, also set LANGFUSE_TRUSTED_PROXY_COUNT to the number of proxies in front of it. Otherwise access events from the Langfuse UI carry no client IP address, and events from the public API and MCP carry the address of your proxy.

VariableDefaultContainerDescription
LANGFUSE_AUDIT_LOG_ACCESS_EVENTSorgweborg, enforced or disabled, see above.
LANGFUSE_TRUSTED_PROXY_COUNT0webNumber of proxies in front of Langfuse that append to X-Forwarded-For. The client IP is the N-th entry from the right. 0 ignores the header.

How recording works

  • Recorded before data is returned. Langfuse writes the access event before it returns any data. If that write fails, the read fails with an error, so no data is returned without a record. A batch export whose event cannot be written is marked as failed and does not run.
  • One event per request. Opening a trace sends several requests, so one trace view produces several events.
  • Lists record what was shown. A list or search records its request parameters, the number of rows returned and the id of every returned row, up to 10,000 ids per event.
  • Refused reads. A read in the Langfuse UI that is refused for missing permissions is recorded with the outcome denied. Public API and MCP calls are recorded only when they succeed.
  • Retention. Audit log retention is not configurable yet, and project data retention does not apply to audit logs. If your compliance program requires you to keep access records for a set period, export them regularly and store the exports yourself.

What is recorded

SurfaceRecorded reads
Langfuse UITrace and observation detail views, including input and output; the tracing, sessions, scores and experiments tables; session, score and experiment detail views; trace and observation downloads; creating a batch export
Public APIGET /api/public/v2/observations, GET /api/public/v3/scores, GET /api/public/experiments, GET /api/public/experiment-items
MCP servergetObservation, getScore, listObservations, listScores, listExperiments, listExperimentItems

Not recorded:

  • Aggregates: counts, filter options, metrics and dashboards, including the metrics API and the MCP tool queryMetrics.
  • Prompts, datasets, comments and media.
  • Scheduled blob storage exports.
  • Other public API routes.
  • Anonymous viewers of public traces.

Downloading the file of a finished batch export is recorded as a change event in the regular audit log.

View and export access events

Access events appear in the project's audit log viewer (Project settings → Audit Logs), together with change events. You need the auditLogs:read permission, which the project OWNER and ADMIN roles have.

  • The Event column tells access events from change events.
  • The Outcome column shows whether the read succeeded or was denied.
  • Filtering by event, actor, resource or time is not available yet.

The export from the audit log viewer contains all events of the project, including for each access event its route, request parameters, result count and the ids of the returned rows.

The client IP address, user agent and request id are recorded but not shown in the viewer or the export yet. On self-hosted instances, query ClickHouse to read them.

Access event fields

FieldContent
timestampWhen the read happened.
org_id, project_idThe organization and project that were read.
event_kindaccess for reads, change for changes.
actor_type, user_id, api_key_idWho read the data: USER, API_KEY or SYSTEM.
actor_name, actor_emailThe user's name and email at the time of the read. They remain after the user leaves the organization.
user_org_role, user_project_roleThe user's roles at the time of the read.
surfacetrpc (Langfuse UI), public-api, mcp, or internal-api (trace and observation downloads).
routeThe UI procedure, API route or MCP tool, for example GET /api/public/v2/observations.
resource_type, actionWhat was read and how, for example trace and read, observation and list, or batchExport and export.
resource_refsTyped ids of the returned rows: trace:<id>, observation:<id>, score:<id> and session:<id>.
paramsThe request's filters, search and pagination as JSON, cut at 2 KB. A cut value ends in ...[truncated].
result_countThe number of rows returned.
outcome, outcome_reasonsuccess, or denied with UNAUTHORIZED or FORBIDDEN.
ip, user_agentThe client's IP address and user agent.
request_idThe OpenTelemetry trace id of the request, if it was sampled.

Self-hosted: query ClickHouse

Self-hosted instances can query the audit_logs table in their ClickHouse database directly, for example with clickhouse client.

Who accessed a trace:

SELECT timestamp, actor_type, actor_email, api_key_id, ip, surface, route, action, outcome
FROM audit_logs
WHERE org_id = '<org-id>'
  AND project_id = '<project-id>'
  AND event_kind = 'access'
  AND has(resource_refs, 'trace:<trace-id>')
ORDER BY timestamp DESC;

What a user read during a period:

SELECT timestamp, route, resource_type, action, result_count, params
FROM audit_logs
WHERE org_id = '<org-id>'
  AND event_kind = 'access'
  AND user_id = '<user-id>'
  AND timestamp >= '2026-11-01 00:00:00'
  AND timestamp < '2026-11-08 00:00:00'
ORDER BY timestamp;

GitHub Discussions


Was this page helpful?

Last updated on