Heym writes an audit line for every security-relevant action: who did it, what they did it to, and whether it succeeded. Lines go to the backend's standard output through the winston.audit logger, alongside the request access log, and can be read from the Logs tab or with docker logs.
Audit logging is always on. There is nothing to enable and no environment variable to set.
Line Format
One action produces exactly one self-contained line:
2026-08-25 14:02:11 INFO [winston.audit] audit action=credential.delete outcome=success actor_id=8f2c1b04-3d5a-4f21-9c7e-1a2b3c4d5e6f actor_email=alex@example.com target=credential:3a91d7e2-55c8-4b19-b0a1-9e8d7c6b5a43 target_name="OpenAI Prod" credential_type=openaiEvery line carries these fields:
| Field | Description |
|---|---|
action | What happened, as resource.verb — see the table below. |
outcome | success, failure, or denied. |
actor_id | UUID of the user who performed the action. Absent only when nobody was authenticated. |
actor_email | Email of that user. On a failed login this is the address that was tried, not a confirmed account. |
target | The object acted on, as type:uuid. |
target_name | Human-readable name of that object, quoted when it contains spaces. |
Action-specific fields follow — for example credential_type, imported, grantee_email, team_name. Values containing a space, quote, or = are quoted; values longer than 256 characters are cut with a ...(truncated) marker.
Reading the Log
The audit logger is a child of the request logger, so both reach the same stream while staying separable:
# Only audit lines, no access-log noise
docker logs heym-backend 2>&1 | grep '\[winston.audit\]'
# Everything one user did
docker logs heym-backend 2>&1 | grep 'actor_email=alex@example.com'
# Failed logins and refused access
docker logs heym-backend 2>&1 | grep -E 'outcome=(failure|denied)'
# Everything that touched one credential
docker logs heym-backend 2>&1 | grep 'target=credential:3a91d7e2-55c8-4b19-b0a1-9e8d7c6b5a43'In the app, the Logs tab reads the same container output. It is gated by DOCKER_LOGS_ENABLED and the DOCKER_LOGS_ALLOWED_EMAILS allowlist.
What Is Logged
Every state change is logged. Reads are logged only where reading is itself the sensitive act — viewing a workflow's run history, opening a credential, downloading a file. Ordinary list and detail reads are not audited; the access log already records that a request happened, and auditing every GET would bury the lines that matter. The one exception is page views, which record where a signed-in user went in the app.
Authentication
| Action | Notes |
|---|---|
auth.register | outcome=denied when registration is disabled or when password sign-in is off (reason=password_login_disabled), failure when the email is taken. |
auth.login | outcome=failure records the attempted address and whether the email was unknown or the password wrong. outcome=denied with reason=account_deactivated when the password was right but the account is deactivated. A sign-in finished with a second factor carries mfa=totp or mfa=recovery. |
auth.mfa_challenge | The password was right and the sign-in now waits for a code: purpose=verify, or purpose=enroll for an account setting up its authenticator. Only with HEYM_REQUIRE_MFA. |
auth.mfa_verify | outcome=failure when a sign-in code was wrong or already used. Repeated failures for one account are worth alerting on. |
auth.mfa_enable | An authenticator was set up, at sign-in (during=sign_in) or from Settings. |
auth.mfa_replace | The account moved to a new authenticator from Settings → Security. outcome=failure when the password or current code was wrong. |
auth.mfa_recovery_codes_regenerate | New recovery codes replaced the old ones. |
auth.sessions_revoke | The user signed out every other session (scope=others). |
auth.logout | The actor is resolved from the refresh cookie, so a logout without one is logged with no identity. |
auth.token_refresh | outcome=denied with reason=refresh_token_replayed_or_revoked — a token-theft signal worth alerting on. |
auth.password_change | outcome=failure when the current password was wrong. |
auth.sso_login | Single sign-on. outcome=failure carries the reason the provider response was rejected; denied carries email_not_verified, domain_not_allowed, provisioning_disabled, or account_deactivated. |
sso_settings.update | An administrator changed the SSO configuration. Records enabled and password_login_disabled, never the client secret. |
sso_settings.test | An administrator ran the SSO connection test. |
Page Views
page.view is written each time a signed-in user opens a page in the web app, with the URL path in a path field:
2026-10-29 09:14:02 INFO [winston.audit] audit action=page.view outcome=success actor_id=8f2c1b04-3d5a-4f21-9c7e-1a2b3c4d5e6f actor_email=alex@example.com path="/?tab=traces"The path is the in-app route. Dashboard tabs are part of it (/?tab=traces), and so are the ids that name what is open, such as /workflows/<id>. Only a short list of query parameters that identify the page is kept (tab, dashboard, board, suite, workflowId, traceId); everything else in the query string and the whole fragment is dropped. Pages whose link carries a secret, such as /review/<token>, are logged with the placeholder :token instead of the secret.
The browser reports the path, so a page.view line shows where a user says they went. It does not prove that the server returned that page. Visits to the sign-in page and to links opened while signed out are not recorded, because no user is attached to them.
Workflows
workflow.create · workflow.update · workflow.delete · workflow.version_revert · workflow.run · workflow.history_view · workflow.history_unlock · workflow.live_run_unlock · workflow.history_clear · workflow.history_delete · workflow.run_history_encryption · workflow.share_add · workflow.share_remove · workflow.team_share_add · workflow.team_share_remove · workflow.execution_token_create · workflow.execution_token_revoke
workflow.run is written when a run is started through the API: the editor's Run button, the execute endpoint with a session, API key or webhook, the chat portal, and MCP tools. It records who started it, how, and how it ended:
[winston.audit] audit action=workflow.run outcome=success actor_id=8f2c1b04-3d5a-4f21-9c7e-1a2b3c4d5e6f actor_email=alex@example.com target=workflow:3a91d7e2-55c8-4b19-b0a1-9e8d7c6b5a43 target_name="Invoice triage" status=success trigger_source=Canvas execution_id=c1d2e3f4-0a1b-4c2d-8e3f-5a6b7c8d9e0f duration_ms=1235 test_run=trueexecution_id links the line to the run in Run History. outcome is failure when the run ended in error, cancelled or timeout. A run parked for human review or held in the concurrency queue is a success line with status=pending or status=queued. A call with no signed-in user, such as an anonymous webhook or a portal visitor, has no actor_id or actor_email. Inputs and outputs are never written.
Runs started by a schedule, a trigger node, a queue or an event are not audit lines. They execute on whichever instance claimed them and are recorded in Run History with their trigger source and the instance that ran them.
workflow.history_delete is written when someone deletes one run from History. It carries execution_id, and encrypted for a workflow run; a collaborator who tries gets outcome=denied with reason=not_owner. Deleting your own chat run is written with run_type=chat.
workflow.history_view is written when someone opens a workflow's run history. The small lookup that shows a workflow's latest run in the dashboard preview is not a history view and is not logged. workflow.history_view records owned=false when a collaborator reads someone else's run history. workflow.delete records outcome=denied with reason=not_owner when a collaborator tries to delete.
workflow.history_unlock is written each time someone unlocks an encrypted run, whoever they are: the owner, a collaborator, or an instance administrator. It carries execution_id, owned, permission (write or read) and admin. A user without access to the workflow gets outcome=denied, and a run that can no longer be decrypted gets outcome=failure with reason=undecryptable. workflow.live_run_unlock is written when someone confirms watching a still-running encrypted run on the canvas, with the same fields. workflow.run_history_encryption is written when the owner turns encryption on or off, with enabled and previous; a collaborator who tries gets outcome=denied with reason=not_owner.
[winston.audit] audit action=workflow.history_unlock outcome=success actor_id=8f2c1b04-3d5a-4f21-9c7e-1a2b3c4d5e6f actor_email=alex@example.com target=workflow:3a91d7e2-55c8-4b19-b0a1-9e8d7c6b5a43 target_name="Payroll intake" execution_id=c1d2e3f4-0a1b-4c2d-8e3f-5a6b7c8d9e0f owned=false permission=read admin=falseCredentials
credential.create · credential.update · credential.delete · credential.detail_view · credential.share_add · credential.share_remove · credential.team_share_add · credential.team_share_remove
credential.detail_view is audited because opening a credential decrypts it. A miss logs outcome=denied, which is what a credential-id enumeration attempt looks like.
Other resources
| Resource | Actions |
|---|---|
| Variables | variable.create · update · delete · bulk_delete · share_add · share_remove · team_share_add · team_share_remove |
| Vector stores | vector_store.create · update · delete · clone · upload · item_delete · items_delete_by_source · share_add · share_update · share_remove · team_share_add · team_share_update · team_share_remove |
| Alerts | alert.create · update · delete · event_acknowledge · share_add · share_remove · team_share_add · team_share_remove · disable_on_access_revoke |
| Data tables | data_table.create · update · delete · clone · row_create · row_update · row_delete · rows_clear · rows_bulk_create · import_csv · export_csv · share_add · share_remove · team_share_add · team_share_remove |
| Dashboards | dashboard.create · update · delete · widget_create · widget_delete · share_add · share_remove · team_share_add · team_share_remove |
| Boards | board.create · update · delete · column_create · column_update · column_delete · column_empty · card_create · card_update · card_delete · card_move · card_run · share_add · share_remove · team_share_add · team_share_remove |
| Drive | drive.upload · download · delete · delete_all · bulk_delete · share_create · share_revoke · team_sharing_update · bulk_team_sharing_update · chat_mount |
| Teams | team.create · update · delete · member_add · member_remove |
| Users | user.deactivate (with workflows_paused; outcome=denied with reason=last_break_glass_admin) · reactivate (with workflows_resumed) · sessions_revoke · mfa_reset. The administrator is the actor, the account is the target. user.memory_update is logged when Chat or an MCP client saves to the user's User Rules, with source (chat or mcp), mode (append or replace) and length; the user is both actor and target, and the text itself is never logged. |
| Folders | folder.create · update · delete · workflow_move |
drive.chat_mount is logged the first time a conversation opens a Drive file in the file sandbox, with the conversation id and whether the file was shared with the user.
Bulk operations are logged once per request with a count, not once per row. A CSV import of 5,000 rows produces one data_table.import_csv line carrying imported, rejected, and total.
Secrets Are Never Logged
An audit line records identifiers, names, and counts. It never records a credential's contents, a variable's value, a password, or a token.
Two things enforce this. Call sites are written to pass only safe fields, and the audit helper redacts as a backstop: any field whose name contains password, secret, token, api_key, value, authorization, cookie, or similar is replaced with *** before the line is built. Over-redaction is deliberate — an unhelpful line is better than a leaked credential.
Where a secret is genuinely relevant to the record, only its shape is logged. A file share records password_protected=true, never the password.
Heym Work
Heym Work also writes audit lines to its own stdout under winston.audit, using the
same formatting, outcomes, truncation and secret redaction as Heym. Local audit logging
is always on and needs no additional configuration.
Work records every /api/ request as work.request, including its authenticated actor,
route template, operation, UUID resource identifiers, HTTP status and duration. This
covers Work-only actions such as flow changes, preferences, pins, widget layouts and
demo content, as well as permission refusals, validation errors and server failures.
Health checks and static assets are excluded.
Calls Work makes to Heym are recorded independently as work.heym_request. Streamed
responses pass through immediately; an interrupted stream is a failure even if its
HTTP headers were already successful. These lines describe Work's HTTP operation,
not a workflow's final execution result. Request and response bodies, headers, raw
capability paths and query strings are never included.
Work's own scheduled activity records work.license_sync, work.heym_info_refresh,
work.compat_check and work.survey_delivery, including successful repetitions and
failures. Unexpected background failures produce work.background_job.
These additional records are produced locally. Work does not copy or consume Heym's
audit records, and they add no audit calls to Heym. The existing forwarding of Work's
privileged work.* events remains unchanged. Heym's workflow schedules and triggers
continue to execute and retain their histories in Heym.
# Work's own local audit output
docker logs heym-work 2>&1 | grep '\[winston.audit\]'Retention
Audit lines live only as long as the container's log output. They are not written to the database. Recreating the backend container discards its logs.
If you need audit history that survives a redeploy, ship the container's stdout somewhere durable — a log driver, a sidecar collector, or your platform's log aggregation — the same way you would for any other container log.
For Contributors
Emitting an audit line takes one call:
from app.services.audit_log import audit
audit(
action="credential.delete",
actor=current_user,
target_type="credential",
target_id=credential.id,
target_name=credential.name,
)The helper is synchronous, touches no database, and swallows its own errors, so an audit call cannot fail or slow a request.
Three rules when adding one:
-
Name the action
resource.verbin snake_case.backend/tests/test_audit_log.pywalks everyaudit()call underapp/api/and fails the build on a name that does not match, and on a covered resource that has lost all of its call sites. -
Only read attributes that are certainly present. The helper's
try/exceptprotects its own body, not the expressions you pass to it — anAttributeErrorintarget_name=workflow.nameis raised at the call site, beforeaudit()runs, and will break the request. Read ORM columns and locals, not optional or lazily-loaded attributes. -
Log the deletion before the delete. After
db.delete(row)the name and id you want to record may be gone. Place the call above it.