Audit Logs

ExploreSelf-hostDocumentationBlogSign In
Documentation
Overview
Getting Started
Getting StartedPlatform IntegrationsAgentPlaybooks in ClaudePortable Bot TeamsHermes Memory ProviderHermes for OrganisationsAgentPlaybooks Tools in HermesCLI & Editor PluginsSecure Secret InputPython SecretsCross-platform Agent BackupsRelease DistributionTeam CollaborationAudit LogsFederated MCP & OpenAPI ToolsMCP Registry PublishingRoadmap
Core Concepts
PlaybooksSkillsMemoryMCP Integration
Reference
ArchitectureAPI ReferenceManagement APIDeveloper GuideSelf-HostingSecurity documentation packOn-prem Backup and RestoreSelf-hosted mTLSEnvironment Setup
View on GitHub
DocsAudit Logs

Audit logs (export, retention, tamper evidence)

Download an evidence bundle

Owners and auditors can use Details → Download audit ZIP, or authenticated GET /api/playbooks/:guid/audit/bundle (the same credentials as audit export). The response is private/no-store and is not saved as a public file.

The ZIP includes JSONL and spreadsheet-safe CSV, verification of those exact rows, the retention checkpoint, a manifest with file SHA-256 checksums and collection times, and a data-category inventory covering account/authentication, profiles/sharing, content, credentials, audit records, browser and provider data. It contains audit metadata, not vault values or a complete account-data export. Protect it as potentially personal/confidential data.

The bundle accepts no filters and includes up to 500 retained rows. Above that limit it returns 413, never a silently truncated ZIP; request an operator database export and hash-chain verification instead. A broken or concurrently changing chain returns 409; retry or investigate. It is not an atomic database snapshot. Retention purges and playbook/account deletion must be understood: audit rows/checkpoints survive deletion; a purge removes a chain prefix and keeps a checkpoint. Backups and SIEM copies have separate retention.

Doctor is local-only and is not run by this download. Retain a separate apb doctor --json report with the inspected project revision if needed. Checksums and hash links are not a signature, trusted timestamp, proof that all events were logged, or protection against complete rewriting by a privileged operator. ISO 27001/42001 preparation and applicable AI Act/GDPR reviews may use these records as supporting evidence; this is not certification or a guarantee of legal compliance. The operator determines applicability and organisational obligations.

The audit_logs table is the playbook audit trail: federated MCP calls, vault operations (secret.*), configuration changes, and memory/canvas writes in one place, read at GET /api/playbooks/:guid/audit. A row never holds a secret value, a full outbound URL, or an API key.

This page covers the compliance controls for EU and self-hosted deployments: export, optional SIEM forwarding, retention, the per-playbook hash chain, and the read-only auditor role.

Who can read the trail

CallerAudit read / export / verifySecret valuesWrites

Owner (session or user API key with playbooks:read or audit:read)YesYes (existing vault rules)Yes
Auditor collaboratorYesNoNo
Playbook API key with role auditorYesNoNo
Editor collaborator (session)NoYesContent and secrets; key metadata only
Viewer/coworker/admin playbook keysNoPer existing permissions and reveal policyPer existing permissions

A playbook API key that performs vault operations still cannot read the record of them. Invite an auditor from Sharing, or mint a playbook key with the Auditor role (audit:read + playbooks:read only).

Export

GET /api/playbooks/:guid/audit?format=jsonl&since=2026-01-01T00:00:00.000Z&until=2026-12-31T23:59:59.000Z&actor=apb_live_abcd&action=secret.
GET /api/playbooks/:guid/audit/export?format=csv
Authorization: Bearer <jwt_or_user_api_key_or_auditor_playbook_key>

format is json (default on /audit), jsonl (default on /export), or csv. Filters: action (alias of operation), actor (actor_id), actor_type, since, until, secret, limit.

CLI (user API key from apb login or AGENTPLAYBOOKS_API_KEY):

apb audit export <guid> --format=jsonl --since=2026-01-01T00:00:00Z --action=secret.
apb audit export --format=csv > trail.csv   # every playbook this key may audit
apb audit verify <guid>

Hash chain

Each row stores prev_hash and hash = sha256(canonical JSON of the row including prev_hash). The first row of a playbook chains from 64 zero hex digits. GET /api/playbooks/:guid/audit/verify and apb audit verify recompute the chain in order and report the first broken link (prev_hash or hash).

Online verification checks at most 500 rows. Larger trails return HTTP 413 before their contents are loaded; a partial trail is never reported as verified. Operators can verify the entire trail with npm run audit:chain, using DATABASE_URL or the documented Docker Compose environment. This keeps large hash-chain computations outside the HTTP Worker's CPU budget.

A production database needs migration 20261024120000_audit_logs_compliance.sql to add the columns and backfill existing rows. Do not apply it without approval and a backup. Operator steps (preflight, pg_dump, in-DB copy, postflight hash-chain check, rollback) are in scripts/ops/audit-migration/RUNBOOK.md. Apply that migration before merging the app change; the previously deployed app tolerates the additive schema.

Retention

Unset AUDIT_RETENTION_DAYS (or 0 / forever) keeps the current behaviour: logs have no automatic expiry. They survive playbook/account deletion and are removed only by a retention purge; checkpoints remain.

Set a positive integer to enable scheduled purge. The purge deletes rows older than the cutoff, writes an audit_chain_checkpoints row with the last purged hash so the remaining chain still verifies, then inserts audit.retention_purge as a new chain entry.

# systemd / cron on a self-hosted instance
curl -X POST -H "Authorization: Bearer $AUDIT_CRON_SECRET" \
  https://your-instance/api/cron/audit-purge

Owners can also purge one playbook explicitly:

apb audit purge <guid> --days=365 --yes

Optional forwarding (off by default)

After a successful insert, the API may forward the event without blocking the caller. Failures retry with backoff and are logged; an unreachable SIEM does not fail the vault or federated call.

VariableDefaultPurpose

AUDIT_SYSLOG_URLunset (off)udp://host:514, tcp://host:514, or tls://host:6514 (RFC 5424)
AUDIT_SYSLOG_HOSTNAMEagentplaybooksRFC 5424 HOSTNAME
AUDIT_SIEM_WEBHOOK_URLunset (off)HTTPS POST of the export JSON object
AUDIT_SIEM_WEBHOOK_SECRETunsetHMAC-SHA256 key for the body. High-entropy random, ≥32 bytes (openssl rand -base64 32), not a human password. Required when the webhook URL is set; a shorter value fails closed.
AUDIT_SIEM_HMAC_HEADERX-Audit-SignatureHeader carrying sha256=
AUDIT_RETENTION_DAYSunset (keep forever)Positive integer for scheduled purge
AUDIT_CRON_SECRETunset (endpoint hidden)Bearer token for POST /api/cron/audit-purge (CRON_SECRET is also accepted)

Syslog uses Node sockets (self-hosted Node). The HTTPS webhook works on Cloudflare Workers as well. Forwarding is best-effort; pull export if you need a guaranteed copy.

Writing the row itself is best-effort too — an audit outage must not take the vault down — with one exception: a successful secret.reveal. The secrets reveal endpoint and the runtime loader (/secrets/resolve) release plaintext only after its audit row is written, and answer 503 otherwise.

Edit this page on GitHub
On this page
Download an evidence bundleWho can read the trailExportHash chainRetentionOptional forwarding (off by default)