Skip to content

Tail and Query the Audit Stream

Use Audit when a request is denied, Approval is required, Delegation behaves unexpectedly, or an operator needs evidence for a run.

  • A zone and known time window or request ID.
  • A trusted Admin client for automation; application credentials cannot read zone audit.
  • Durable event-ID deduplication if exporting continuously.
  1. Open the web console for your deployment.
  2. Select Audit.
  3. Filter by zone, decision, event type, or request ID.
  4. Open the event detail to inspect metadata, determining policies, and diagnostics.
  5. Open the decision trace from the event for a full request-level view.
import { AdminClient } from '@caracalai/admin'
const admin = new AdminClient({
apiUrl: process.env.CARACAL_API_URL!,
adminToken: process.env.CARACAL_ADMIN_TOKEN!,
})
const events = await admin.audit.list(process.env.CARACAL_ZONE_ID!, {
decision: 'deny',
limit: 25,
})
const trace = await admin.audit.explain(process.env.CARACAL_ZONE_ID!, events[0].request_id!)
console.log(trace.final_decision, trace.denied)
FilterUse it for
Request IDStitch together STS, Gateway, adapter, and explain events.
DecisionFind denies, allows, or partial decisions.
Event typeFocus on Policy, Session, Delegation, Approval, or admin changes.
Time windowInvestigate a run, incident, or rollout.

Poll admin.audit.list with a bounded time window and persist the last processed event identity. Caracal does not expose a supported external audit-stream subscription API; Redis topics are runtime internals, not an application integration contract. Use Admin API list/export surfaces and forward events after deduplication.

FieldTypeMeaning
idstringUnique event id; use as the dedup key.
zone_idstringZone the event belongs to.
event_typestringWhat happened: exchange, decision, replay_detected, revocation, lifecycle events.
request_idstringnull
decisionstringnull
evaluation_statusstringnull
metadata_jsonobjectnull
occurred_at / ingested_atstringEvent time and audit-service ingest time (RFC 3339).

Event detail (admin.audit.explain) adds the determining policies, policy-set version, manifest hash, and diagnostics for decision events - fetch it lazily from the SIEM for alerts rather than shipping it wholesale. Alert first on decision: "deny" spikes, replay_detected, and delegation events for sessions outside your expected label set.

  • request ID;
  • zone ID;
  • application ID;
  • resource identifier;
  • requested scopes;
  • final decision;
  • determining policies;
  • diagnostics;
  • session or Delegation IDs when present.

Related page: Audit and Request Traces.

Generate one allow, deny, approval, Delegation, and Gateway result. Confirm request correlation, ordering in the destination, replay-safe deduplication by event ID, and credential redaction. Expected result: an operator can move from a SIEM alert to the Caracal request trace without querying internal Redis.

Use Debug Authorization Decisions to turn a correlated deny into a focused correction.