Audit logging is only available on the Enterprise plan.
Self-hosted deployments require data plane v2.6.0 or later for audit logging. On earlier versions, administrative events are recorded but aren’t queryable.
Grant access
Members of the Owners permission group can read organization audit logs by default. To let anyone else read them, grant the organization-level Read audit logs permission in Settings > Permissions.The Read audit logs permission grants read access to audit log entries for the organization. It does not grant access to modify the audited resources.
View the audit log
To view recent organization activity, go to Settings > Audit log. The table lists actions performed by members of your organization, with the most recent events first. Use the controls above the table to customize the view:- Time range: Select Last 24 hours, Last 7 days, or Last 30 days. The default is Last 7 days.
- Filters: Narrow results by fields such as actor, event type, or resource.
- Columns: Show or hide columns. ID, details, and before and after change columns are hidden by default.
Query the audit log
Users with the Read audit logs permission can query audit logs with SQL using theaudit_logs() data source, identified by your organization’s ID (for example, audit_logs('my-org-id')). No additional configuration is required to query them.
Run a query from the Query page, the bt sql CLI, or the API.
Examples:
Recent activity across the organization
All actions taken by a specific member
Permission and access control changes in the last 30 days
What gets logged
Each audit log entry records a single event: what happened, who performed it, and what changed.Fields
Each organization audit log entry includes:
For create events,
before_changes is null. For delete events, after_changes is null. For update events, both fields contain the changed resource values. Readonly events contain neither.
Events
Braintrust records organization audit log events for these resource categories:
Some operations emit multiple audit log entries. For example, inviting a user can create an organization member entry, permission group membership entries, access grants, and an API key entry. Bulk operations create one audit log entry per changed resource.
Audit logs can take a few minutes to show up after an action occurs.
Sensitive values
Braintrust excludes or redacts sensitive values in audit logs:- API key hashes and raw keys are not included. Audit entries include the API key preview name when available.
- AI provider secrets are redacted. Audit entries include a secret preview and omit encrypted secret material and key names.
- Webhook action URLs (
config.action.url) in project automation configurations are redacted. When a webhook URL changes,event_details.redacted_fields_changedlistsconfig.action.url. - String values in
query.readqueries are masked. See Recorded queries. - Resource IDs, organization IDs, project IDs, creation timestamps, update timestamps, and deletion timestamps are omitted from
before_changesandafter_changeswhen they would add noise to the change diff.
Audit data reads and modifications
Administrative actions are logged automatically with no setup. Row-level auditing of data reads and modifications is different: these events can be high volume, so Braintrust records them only when you opt in.query.read events are particularly high volume. When enabled, query.read covers both SQL queries run manually and ones run implicitly by the Braintrust UI when you browse logs, experiments, and traces.
Braintrust records the following events for data rows:
How you enable row-level audit logging depends on your deployment.
Enabling
query.read audit logging counts toward your processed data usage. Because these events can be high volume, this may result in additional charges.query.read auditing per organization through Terraform or Helm. See Enable read auditing for the strict and best-effort modes and the variables to set.
Recorded queries
Eachquery.read event records the parsed query in event_details.query, with string values masked:
- Letters and digits in string values are replaced by
*, so'secret123'becomes'*********'. This includes strings inside arrays and objects, and object keys. Numbers aren’t masked. - Object IDs passed to table functions such as
project_logs('<project-id>')stay visible. - Queries that can’t be parsed are recorded as
<Failed to parse query>.
event_details.query_hash is a SHA-256 hash of the original query, so you can match repeated runs of the same query.
On self-hosted deployments running data plane versions earlier than v2.20.0, SQL queries are recorded as <Failed to parse query>, and string values in some clauses, such as span_filter and custom_columns, aren’t masked.
Async queries and applied scorers
Row-level audit logging also records changes to async queries and to scorers applied to an experiment with Apply scorers. These events use theproject_automation and project_score event types:
- Submitting an async query records
project_automation.created, with a SHA-256 hash of the query inevent_details.query_hash. Canceling an async query recordsproject_automation.updated, withconfig.statuschanging topaused. - Fetching async query results records
query.readwithquery_sourceset toasync_query. Itsquery_hashmatches the one inproject_automation.created, so you can link result downloads to the query that produced them. - Applying scorers to an experiment records
project_score.created, with the scorers and scope inafter_changes.config.online. Pausing or resuming them recordsproject_score.updated, with the previous and new status inconfig.online.status.
Retention
Audit logs are retained indefinitely for the lifetime of your organization’s Enterprise subscription, giving you a permanent record of administrative activity for compliance and regulatory requirements. Unlike logs, experiments, and datasets, they aren’t subject to your plan’s retention window or to retention automations. If your organization leaves the Enterprise plan, Braintrust stops recording new audit log events.Next steps
- Access control to learn how organization permissions work.
- Manage permissions to grant Read audit logs to a permission group.
- SQL reference to learn about how to query audit logs with SQL.