SSyncropel Docs

Audit threads

Which thread holds the audit trail for each governance area (consent, federation, secrets, tokens and more), what each record looks like, and how to read it.

Where the audit trail lives

Some areas (consent, federation pairs, secrets, impersonation, graph traversal, portability, snapshot/restore, tokens and service accounts, provisioning, subscriptions, API usage) write a dedicated audit record on a th_audit_<domain> thread in addition to the normal record. Other areas (sync pairs, namespaces, decisions) use their normal thread as the audit trail. Both give you the same detail.

Why some areas have their own thread

Every governance action is recorded in full. You can read the normal thread (th_namespace_registry, th_sync_control, and so on) and get the same answer you would get from a dedicated audit thread. Dedicated threads exist to make subscribing easier, not to change what is recorded.

A domain has its own th_audit_<domain> thread when at least one of these holds:

  • C1: it affects other actors or instances. The change is visible to parties beyond the actor who made it (consent grants bind two namespaces; federation pairs bind two instances).
  • C2: it is security-sensitive. The audit record must be written before the operation returns (secret read or write, impersonation start or end).
  • C3: it produces a high volume of events worth watching. Roughly 100 or more events a day in normal use, with enough consequence to justify a dedicated stream (graph traversal denials per namespace, secret access).

If none of these holds, the normal thread is the audit trail.

Catalog of audit threads

ThreadBody kind(s)Pattern
th_audit_consentcore.consent_state_change.v1One LEARN record per grant or revoke; mirrors th_consent
th_audit_federation_pairssyncropel.federation.pair_state_change.v1LEARN per pair lifecycle transition; mirrors th_federation_pairs
th_audit_impersonationcore.impersonation.event.v1LEARN per impersonation entry/exit; no separate operational thread
th_audit_graph_traversal_<namespace>graph.consent_check.v1 (denials), related kindsOne thread per namespace; written when a peer's request is denied
th_secret_auditsecret.access.v1, secret.rotation.v1, secret.value_invalidated.v1DO synchronous BEFORE return; every read/write/list/delete
th_audit_portabilitycore.portability.event.v1LEARN per export/import; per-actor and instance scope
th_audit_snapshotscore.snapshot.event.v1LEARN per snapshot create / restore; security-sensitive instance-level op
th_audit_tokenscore.token_lifecycle_event.v1LEARN per token mint / revoke + SA create / delete / rotate; mirrors api_tokens_thread(<ns>) / service_accounts_thread(<ns>)
th_audit_provisioningcore.provisioning.requested.v1, core.provisioning.completed.v1LEARN at provisioning request + completion; kept on the hosting service's own instance, not on yours
th_audit_subscriptionscore.subscription.* (12-member family)LEARN at every subscription lifecycle event (created, payment, cancellation, etc.); kept on the hosting service's own instance, not on yours
th_audit_api_usagecore.api.usage.v1, core.api.error.v1, etc.LEARN per managed inference call; cost + token + tier tracking

There are eleven audit-thread families.

Areas that use their normal thread

DomainOperational threadAudit records
Sync pairth_sync_controlLEARN with topic: pair_state (lifecycle transitions) + topic: pair_removed (terminal)
Namespacesth_namespace_registryLEARN with topic: namespace_entry (create / archive / unarchive / delete)
decision approve/reject(the original decision-gate proposal thread)DO with body.fulfills or body.cancels: the decision IS the audit

These areas do not meet C1, C2 or C3 strongly enough for their own thread. The normal thread is the audit trail, and reading it gives you the same detail.

Reading the audit trail

Read one audit thread

Use the records endpoint with a thread= filter, and since= to read only newer records:

TOKEN=$(cat ~/.syncro/token)

# Every consent state-change event in the last 24 hours
curl -s -H "Authorization: Bearer $TOKEN" \
  "http://localhost:9100/v1/records?thread=th_audit_consent&since=$(date -u -d '24 hours ago' +%s)" \
  | jq '.data[]'

# Every secret access event (synchronous-before-return; high frequency)
curl -s -H "Authorization: Bearer $TOKEN" \
  "http://localhost:9100/v1/records?thread=th_secret_audit&limit=100" \
  | jq '.data[] | {clock, actor, body}'

# Per-namespace graph traversal denials
curl -s -H "Authorization: Bearer $TOKEN" \
  "http://localhost:9100/v1/records?thread=th_audit_graph_traversal_default" \
  | jq '.data[]'

Read a normal thread as an audit trail

For the areas without a dedicated thread, read the normal thread the same way. The records carry the same fields you would expect on an audit thread (actor, clock, body):

# Every namespace lifecycle event
curl -s -H "Authorization: Bearer $TOKEN" \
  "http://localhost:9100/v1/threads/th_namespace_registry/records" \
  | jq '.data[] | select(.body.topic == "namespace_entry") | {clock, actor, body}'

# decision-gate decisions on a specific proposal thread
curl -s -H "Authorization: Bearer $TOKEN" \
  "http://localhost:9100/v1/threads/<proposal_thread_id>/records" \
  | jq '.data[] | select(.act == "DO") | select(.body.fulfills or .body.cancels)'

Bulk export to SIEM

spl audit export covers system actors, decision verdicts, dispatch completions, and governance denials. It does NOT include the per-domain audit threads above. For full coverage, combine the export with reads of those threads.

See Audit export for the SIEM bridge.

# SIEM stream (system, decisions, dispatch, governance)
spl audit export --since 24h --categories system,decision,dispatch,governance > /var/log/spl-audit.jsonl

# Add per-domain audit threads as needed
for thread in th_audit_consent th_audit_federation_pairs th_audit_impersonation \
              th_secret_audit th_audit_portability th_audit_snapshots th_audit_security \
              th_audit_tokens; do
  curl -s -H "Authorization: Bearer $TOKEN" \
    "http://localhost:9100/v1/threads/$thread/records" \
    | jq -c '.data[]' >> /var/log/spl-audit.jsonl
done

There is no single call that subscribes to all audit threads. Poll them with the loop above.

Notes for compliance reports

For SOC2, PCI or NIST 800-53 reports, this is the simplest account:

  • Cross-actor and cross-instance governance (consent grants, federation pairs, graph traversal denials) is traced in the dedicated th_audit_* threads listed above.
  • Security-sensitive credential and identity operations (secrets, impersonation) are traced in dedicated audit threads, written before the operation returns.
  • Single-instance administrative operations (namespace lifecycle, decisions, sync pair lifecycle) are traced in the normal record on the relevant thread.
  • Token and service-account lifecycle is traced in th_audit_tokens records (core.token_lifecycle_event.v1), written alongside the normal records on api_tokens_thread(<namespace>) and service_accounts_thread(<namespace>).

If an auditor asks why the pattern differs between areas, the answer is the C1, C2 and C3 criteria above.

On this page