Audit Logs
Audit logs record administrative actions on the Zerq platform: who created, changed, deleted or switched on or off a collection, proxy, workflow, client, profile, policy, credential or AI Gateway setting, who revealed a stored secret, and who exported the audit trail, when, from where, and with what result. Unlike request logs (which record API traffic through the gateway), audit logs record calls to the management API, whether they come from the console, the Management MCP or a script.
Audit logging is on when the backend runs with AUDIT_ENABLED=true. Each management API call that matches a rule in the backend's config/audit_rules.yaml writes one entry; calls that match no rule are not recorded. See What is audited.
Audit log guides
Who can see audit logs?
Audit logs are visible only to users with an Auditor role (a role listed in OIDC_AUDITOR_ROLES). Management roles are separate tiers, not a hierarchy: viewer, modifier and admin roles do not include audit access, and an auditor-only account cannot change anything. This allows compliance teams to review platform changes without privileges to modify the platform.
To access audit logs:
- Sign in to the management UI with an account that has the Auditor role
- Click Governance → Audit Logs in the sidebar
Accounts without the Auditor role do not see the menu item, and the page shows a notice instead of entries. The audit API (GET /api/v1/audit/logs, GET /api/v1/audit/logs/:id, GET /api/v1/audit/verify and GET /api/v1/audit/export) requires the Auditor role too: it returns 401 without a valid token and 403 without the role.
What's recorded
Every audit log entry includes:
| Field | Description |
|---|---|
Timestamp (timestamp) | When the management call finished (UTC, millisecond precision). created_at holds the same time and is what retention uses |
Actor ID (actor_id) | The email claim of the caller's management token, or anonymous (see Actors) |
Actor type (actor_type) | The roles in the caller's token, comma-separated, for example zerq-modifier,zerq-viewer; anonymous when there are none |
Resource type (resource_type) | What kind of object the call targets, from the matching audit rule: proxy, workflow, collection, policy, client, profile, credential, an AI Gateway type such as ai_provider, log, developer_portal or audit_log |
Action (action) | What the call did, in lower case from the matching audit rule: create, update, delete, toggle_status, update_workflow, rotate_credentials, reveal_credentials, reveal_secret, export and the others listed under What is audited |
IP address (ip_address) | Address of the connection to the backend. X-Forwarded-For is not used, so behind a load balancer, ingress or reverse proxy this is that proxy's address, not the caller's |
User agent (user_agent) | Browser or tool that made the request |
Request ID (request_id) | The management request's ID (also returned in the X-Request-ID response header), for correlating with other systems |
Trace ID (trace_id) | The request's trace, when tracing is on |
URL (metadata.url) | The path and query string that was called, for example /api/v1/proxies/665f1c2ab9e4d07a3c81f52e/workflow. For a call on an existing object (update, delete, status change, reveal) the object's ID is in the URL; for a create it is in the response body |
Request body (metadata.request_body) | What was submitted, with secret values masked. For a partial update this is only the fields that were sent |
Response body (metadata.response_body) | What the API returned, with secret values masked. Empty for routes whose audit rule sets omit_response_body |
Status code (metadata.status_code) | HTTP status of the management API response |
Chain fields (seq, prev_hash, hash, key_id) | The entry's place in the tamper-evident chain; see Tamper evidence |
There is no separate resource ID or HTTP method field: the URL identifies the object, and each action belongs to one method and path (see the table below).
Every matching call is recorded with its outcome, not only successful changes: validation errors, server errors, calls without a valid token (401) and calls refused by the role check (403) are recorded too. Filter on the status code to separate changes that happened from attempts.
Entries are written in the background, so writing one does not delay the response. A failed write is logged by the backend and counted in zerq_logs_writes_total{log="audit",result="error"} (see Metrics); the management call itself is not failed, so alert on that counter.
Actors
actor_idis theemailclaim of the OIDC access token. The token's subject (sub) is not stored, so give machine identities (CI pipelines, Management MCP agents) tokens that carry an email claim. A token without one is recorded asanonymous.actor_typelists every role in the token's role claim (OIDC_ROLE_CLAIM_PATH, defaultroles), not only the role that allowed the call. It shows whether a change came from a modifier, admin or auditor identity; it does not say whether the caller was a person or a service.- Calls rejected before authentication (missing, malformed or invalid token) are recorded with actor ID and actor type
anonymous. Calls rejected by the role check (403) are recorded with the caller's email and roles, so a viewer trying to reveal a credential shows up by name. - When management authentication is turned off (
OIDC_ENABLED=false), every management API entry's actor isanonymous(developer portal entries below are not affected). - Management MCP tools call the management API with the caller's own token, so their changes are recorded under that identity like console changes. Their user agent is the Go HTTP client default (for example
Go-http-client/1.1) and their IP address is that of the backend's internal call toMANAGEMENT_API_BASE_URL, not the agent's. - Developer portal entries:
request_login_linkrecords the email address that was entered (not yet verified) with actor typedeveloper_portal_user;validate_tokenrecords the email in the sign-in link with actor typedeveloper_portal_useronce the link's signature and claims (purpose, expiry, client and email) check out, including when the client or email is then refused (a link rejected before that is recorded asanonymous);issue_ai_keyrecords the email from the portal session with actor typeanonymous.
What is audited
The shipped config/audit_rules.yaml records these calls (:clientId and :id stand for IDs):
| Resource type | Action | Management API call |
|---|---|---|
proxy | create, update, delete | POST /api/v1/proxies, PUT and DELETE /api/v1/proxies/:id |
proxy | update_workflow | PUT /api/v1/proxies/:id/workflow (see Workflow changes) |
workflow | create, update, delete | POST /api/v1/workflows, PUT and DELETE /api/v1/workflows/:id |
workflow | publish, restore, activate, deactivate | POST /api/v1/workflows/:id/publish, POST /api/v1/workflows/:id/versions/:version/restore, POST /api/v1/workflows/:id/activate and /deactivate |
workflow | import | POST /api/v1/workflows/import |
workflow | run | POST /api/v1/workflows/:id/run (response not stored) |
workflow | read_run_data | GET /api/v1/workflows/runs/:id/data (response not stored) |
collection | create, update, delete | POST /api/v1/collections, PUT and DELETE /api/v1/collections/:id |
collection | toggle_status | PUT /api/v1/collections/:id/status |
collection | import_openapi | POST /api/v1/collections/import/openapi |
policy | create, update, delete | POST /api/v1/policies, PUT and DELETE /api/v1/policies/:id |
policy | toggle_status | PUT /api/v1/policies/:id/toggle-status |
client | create, update, delete | POST /api/v1/clients, PUT and DELETE /api/v1/clients/:id |
client | toggle_status | PUT /api/v1/clients/:id/status |
profile | create, update, delete | POST /api/v1/clients/:clientId/profiles, PUT and DELETE /api/v1/clients/:clientId/profiles/:id |
profile | rotate_credentials | POST /api/v1/clients/:clientId/profiles/:id/rotate |
profile | set_auth_type | PUT /api/v1/clients/:clientId/profiles/:id/auth-type |
profile | reveal_credentials | POST /api/v1/clients/:clientId/profiles/:id/credentials/reveal (response not stored) |
profile | issue_ai_key, revoke_ai_key | POST (response not stored) and DELETE /api/v1/clients/:clientId/profiles/:id/ai-key |
credential | create, update, delete | POST /api/v1/credentials, PUT and DELETE /api/v1/credentials/:id |
credential | reveal_secret | POST /api/v1/credentials/:id/reveal (response not stored) |
ai_provider | create, update, delete | POST /api/v1/ai/providers, PUT and DELETE /api/v1/ai/providers/:id |
ai_provider | test_connection | POST /api/v1/ai/providers/:id/test (response not stored) |
ai_model | create, update, delete | POST /api/v1/ai/models, PUT and DELETE /api/v1/ai/models/:id |
ai_model | toggle_status | PUT /api/v1/ai/models/:id/status |
ai_guardrail | create, update, delete | POST /api/v1/ai/guardrails, PUT and DELETE /api/v1/ai/guardrails/:id |
ai_guardrail | test_connectors | POST /api/v1/ai/guardrails/test/connectors (response not stored) |
ai_budget | create, update, delete | POST /api/v1/ai/budgets, PUT and DELETE /api/v1/ai/budgets/:id |
ai_settings | update | PUT /api/v1/ai/settings |
ai_log | delete | DELETE /api/v1/ai/logs/:id |
ai_playground | chat | POST /api/v1/ai/playground/chat (response not stored; the answer is in AI Logs) |
log | delete | DELETE /api/v1/logs/:id (one request log entry) |
developer_portal | request_login_link, validate_token | POST /api/v1/developer-portal/request-link, POST /api/v1/developer-portal/validate-token |
developer_portal | issue_ai_key | POST /api/v1/developer-portal/ai/profiles/:id/ai-key (response not stored) |
audit_log | export | GET /api/v1/audit/export (response not stored; see Exporting) |
Calls that match no rule are not recorded. With the shipped rules that includes reads (other than audit exports), validating, opening or test-running a workflow, duplicating a collection (POST /api/v1/collections/:id/duplicate) and collection file imports (POST /api/v1/collections/import, POST /api/v1/collections/:id/import, POST /api/v1/collections/bulk-import). Changes made outside the management API, such as direct database edits, are not recorded either.
Audit rules match the HTTP method and the request path. Paths are matched case-insensitively and a trailing slash is ignored, the same way management routing does, so /API/v1/credentials/ is audited like /api/v1/credentials.
Secret masking
Audit entries never store secret values. Before a request or response body is written:
- In JSON bodies, the values of secret fields are replaced with
[REDACTED]and the field itself is kept, so you can still see that it was set or changed. This covers fields such aspassword,passphrase,secret,client_secret,private_key,certificate,api_key,token,access_token,refresh_token,id_token,connection_string,connection_uri,credentials,authorizationandcookie, fields ending in_secret,_key,_token,_password,_passphrase,_certificate,_connection_stringor_connection_uri, and fields containingpassword,secretorprivate_key(for examplepassword_hash), in any naming style (clientSecret,Client-Secret). - Name and value pairs are masked by name too: in
{"key": "Authorization", "value": "..."}(or withname,headerorparamholding the name) thevalueis masked. - Empty strings,
nulland booleans are kept, so you can see that a secret was cleared or a flag was switched. - Fields that name an environment variable (
*_env_var,*_use_env) are kept, because they hold the variable name, not the secret. The credential API'sstored_secretslist is kept too: it names which secret fields are set, never their values. - On credential, profile and developer portal routes,
key,uriandadditional_paramsare masked too, and a body that is not JSON (or a bare JSON string) is stored as[REDACTED]. Elsewhere a body that is not JSON is stored as sent. - Routes whose audit rule sets
omit_response_body: true(secret reveals, AI key issue, provider and connector tests, playground chats and audit exports) store no response body.
Workflow changes
Saving a proxy's workflow is recorded as resource type proxy, action update_workflow. This covers the console's workflow editor and the update_proxy_workflow Management MCP tool (PUT /api/v1/proxies/:id/workflow), including turning a workflow on or off. The request body holds the saved workflow definition and workflow_enabled, with secret values masked as above. Opening, validating or test-running a workflow changes nothing and is not recorded.
Restoring a proxy version (History → Restore, POST /api/v1/proxies/:id/versions/:version/restore or the restore_proxy_version MCP tool) is recorded as resource type proxy, action restore_version. Listing and comparing versions is not recorded.
Changes through the workflows API (/api/v1/workflows, also used by the workflow Management MCP tools) are recorded as resource type workflow:
| Action | Change |
|---|---|
create | A workflow was created (blank, from a template, or copied from a proxy) |
update | A workflow's draft was saved |
publish | The draft was published as a new version |
restore | An earlier version was made the draft |
activate / deactivate | The workflow was switched on or off |
delete | The workflow and its versions were deleted |
The workflow id is in the recorded URL. When proxies run the workflow, publish, activate and deactivate also update those proxies; the response body lists them in synced_proxies. Workflow definitions in recorded responses have secret values masked as ********. Listing workflows, reading versions or usages, and validating change nothing and are not recorded.
Importing a workflow from an export file (POST /api/v1/workflows/import, Management MCP import_workflow) is recorded as resource type workflow, action import; exporting one is a read and is not recorded (the file has no secret values). Running a standalone workflow by hand (POST /api/v1/workflows/:id/run, Management MCP run_workflow) is recorded as resource type workflow, action run, and reading a run's saved node outputs (GET /api/v1/workflows/runs/:run_id/data) as workflow, read_run_data. Neither stores the response body (it holds the run's data). Listing run history is not recorded. See Manual runs and run history.
Saving a proxy in the console's proxy form also sends the proxy's current workflow_enabled and workflow_definition, so that save is recorded as proxy / update with the workflow fields in its request body.
Searching and filtering
Use the search bar and filters to find specific events. Results are newest first. The same filters are query parameters of GET /api/v1/audit/logs (with page and limit, 10 per page by default and at most 100):
| Filter | API parameter | Example |
|---|---|---|
| Search | search | Searches actor ID, actor type, resource type, action, IP address, user agent, request ID, URL, request and response bodies, and the status code when the search is a number |
| Actor ID | actor_id | [email protected]: all actions by one identity |
| Actor Type | actor_type | admin: entries whose role list contains that role |
| Resource Type | resource_type | proxy, credential, ai_provider |
| Action | action | update_workflow, toggle_status, reveal (both reveal actions) |
| IP Address | ip_address | Find actions from a specific IP |
| Request ID | request_id | Trace a specific management request |
| URL | url | An object's ID, or a path such as /api/v1/credentials |
| Status Code | status_code | 403 for refused calls; this filter is an exact match |
| Start Date / End Date | start_date, end_date | A time range (RFC 3339 in the API, for example 2026-01-01T00:00:00Z) |
Text filters are case-insensitive and match part of the field (they are regular expressions), so update also finds update_workflow. Use ^update$ for an exact match.
Audit log detail view
Click the view icon on any audit log entry to see the full detail:
- Entry ID, timestamp, actor ID, actor type, action and resource type
- IP address, request ID, trace ID (a link to your tracing UI when
NEXT_PUBLIC_TRACE_URL_TEMPLATEis set on the console; see Tracing), status code and URL with query parameters - User agent string (browser version, API client, etc.)
- Complete request body (what was submitted), with secret values masked
- Complete response body (what was returned), with secret values masked; not shown when none was stored
Use cases
Compliance review
"Who changed the rate limit policy between Jan 1 and Jan 31?"
- Filter by Resource Type =
policy - Filter by Action =
update(addtoggle_statusin a second search for switches on and off) - Set the date range to January
- Click Search, then use Export CSV or Export NDJSON for the compliance report (the export uses the filters on screen)
Security investigation
"Did anyone create unauthorized credentials, or read stored secrets, recently?"
- Filter by Resource Type =
credentialand Action =create - Then clear Resource Type and filter by Action =
revealto see everyreveal_secret(credential) andreveal_credentials(profile) call - Review actor IDs, roles and IP addresses; Status Code =
403shows attempts that were refused
Change rollback
"What was the collection configuration before it was changed?"
- Find the
updateevent for the collection (filter by URL with the collection's ID) - Open the detail view: the Request body shows what was sent, and the Response body usually shows the resulting configuration
- The previous state comes from the earlier events for the same object: the
createentry (search for the ID to find it, since a create has the ID only in its response body) and any later updates - Secret values are masked in every entry, so they cannot be restored from the audit log
Access separation
In regulated environments, the Auditor role allows compliance teams to view all recorded changes without the ability to modify the platform. This enforces separation of duties as long as your identity provider does not also give reviewers a modifier or admin role. Each entry's actor type shows which roles the caller held.
Tamper evidence
Every audit entry is part of a hash chain: it gets a sequence number (seq), the previous entry's hash (prev_hash) and its own hash over its content (every field above except the hash itself, including seq, prev_hash and key_id). Changing an entry in the database, deleting one, or reordering them breaks the chain.
-
Verify integrity on the Audit Logs page (or
GET /api/v1/audit/verify, auditor role) recomputes every hash and reports the number of entries checked, the first and lastseq, how many are signed (HMAC) or unsigned (plain SHA-256), how many predate the chain, and any problems (up to 100):Problem Meaning hash mismatchThe entry was changed (or, for an entry signed before key versioning, its key is not configured). broken link,missing entriesEntries were removed or reordered. unknown keyThe entry was signed with a key that is neither AUDIT_CHAIN_KEYnor inAUDIT_CHAIN_PREVIOUS_KEYS, so it cannot be checked.unsigned entry after signed entries,newest entry is not signedEntries were rewritten with plain SHA-256 by someone without the key, or the backend lost its AUDIT_CHAIN_KEY. -
Set
AUDIT_CHAIN_KEYon the backend to sign the chain with HMAC-SHA256. Keep the key outside the database (secret manager), so someone with write access to MongoDB cannot recompute valid hashes. Without it, the chain uses plain SHA-256 and detects changes made without knowledge of the scheme. -
Each signed entry records the
key_idof its key (a fingerprint, not the key), and the hash covers it. To rotate the key, set the new key asAUDIT_CHAIN_KEYand add the old one toAUDIT_CHAIN_PREVIOUS_KEYS(comma-separated; keys must not contain commas). New entries are signed with the new key and the chain continues; entries signed with the old key keep verifying for as long as it is listed. The report shows the currentkey_id. -
Entries written before the chain existed are reported as not covered. When retention removes old entries, verification starts at the oldest remaining one.
Exporting
Export CSV and Export NDJSON on the Audit Logs page (or GET /api/v1/audit/export?format=csv|ndjson, auditor role, with the same filter parameters as the list) download every entry matching the filters, oldest first, up to 100,000 entries per export (narrow the date range for more). CSV columns are seq, timestamp, actor_id, actor_type, resource_type, action, ip_address, user_agent, request_id, trace_id, url, status_code, request_body, response_body, prev_hash, hash and key_id; NDJSON has one complete entry per line. Exports include the chain fields, so an archived export can be checked later with the right key.
On the page, the export uses the filters as they are on screen: the search box, every advanced filter and the date range, with the end date covering the whole chosen day. That includes filters you typed but have not yet applied with Search, so press Search first to see in the list the entries you are about to export. The list uses the same filters, so a searched list and its export match.
Every export is itself recorded in the audit log (resource audit_log, action export) with the auditor, the time and the filters in its URL, and so is every refused export attempt (no valid token, or no auditor role). The exported entries are not stored again in that record. In CSV exports, values that start with =, +, -, @, a tab or a carriage return are prefixed with ' so spreadsheets do not run them as formulas.
Audit log retention
Audit entries are kept until AUDIT_LOG_RETENTION_DAYS is set (unset or 0 keeps everything); then entries whose created_at is older than that many days are deleted every hour. Set it to meet your regulatory requirements: many financial and healthcare regulations require 5-7 years of audit log retention. See Retention.
Integration with SIEM
Stream every audit entry as it is written to Splunk (HTTP Event Collector), an OpenTelemetry Collector (and from there Elastic, Microsoft Sentinel, Datadog or Loki) or a webhook. See Log Streaming and Retention. You can also query the audit API (GET /api/v1/audit/logs) programmatically with an auditor token.
Related docs
- Request Logs — per-request traffic logs with body and latency
- Dashboard — real-time metrics and trend charts
- Audit and Compliance — using logs for compliance workflows