Skip to main content

Audit event schema

ThreatLens records two complementary things for every governed interaction:

  1. The decision record — one immutable row per request capturing what was decided and why.
  2. Governance events — an append-only stream of typed events (classification, policy, routing, identity, admin changes) that can be streamed to a SIEM.

Together they form the evidence trail behind every decision. For the admin view, see the audit log.

The decision record​

One record is written per governed request. It is designed to answer "what did the model see, where did it go, and why" — without ever storing the raw sensitive content.

FieldMeaning
request_idUnique ID for the request
tsTimestamp
user_email, user_groupWho made the request
client, client_typeWhere it came from (workspace, gateway, files…)
classificationThe resolved data class
risk_level, risk_scoreInherent risk of that class + computed score
decisionThe action actually applied (policy actions)
intended_decisionWhat enforce mode would have done (used in monitor mode)
shadow_actionThe would-be action recorded while monitoring
enforcement_modemonitor or enforce at the time
policy_code, policy_versionThe rule that fired + matrix version
decision_reasonHuman-readable explanation
provider, model, model_roleThe destination resolved
requested_destination, approved_destination, actual_destinationWhere it was asked to go, what was approved, where it actually went
redaction_details, output_dlpWhat was masked inbound and outbound
prompt_tokens, completion_tokens, tokens, costUsage and cost
prompt_hashHash of the prompt (not the content itself)
prev_hash, record_hashTamper-evident hash chain
retention_expiryWhen the record is eligible for deletion
fp_reported_at, fp_reporter_email, fp_reasonFalse-positive feedback, if reported
Immutable and content-safe

Records are append-only and chained (prev_hash → record_hash) so tampering is detectable. ThreatLens stores hashes and redacted excerpts, not raw sensitive payloads.

Governance event taxonomy​

Events carry a type, a severity (info · low · medium · high · critical), a source, and a structured payload. The catalog:

Request lifecycle​

EventWhen
prompt.submittedA request enters the gateway
sensitive_data.detectedA detector matched sensitive content
prompt_injection.detectedA prompt-injection pattern matched
policy.evaluatedThe matrix was evaluated for the request
policy.violationThe request breached policy

Routing & model​

EventWhen
model.route.selectedA destination/model was chosen
model.request.allowedSent as-is
model.request.redactedSent after redaction
model.request.blockedStopped before the model

Grounding (retrieval)​

EventWhen
grounding.document.retrievedA source document was retrieved
grounding.chunk.allowedA chunk passed access-trim + DLP
grounding.chunk.blockedA chunk was withheld (ACL or DLP)
grounding.answer.low_confidenceThe grounded answer was low-confidence

Identity & access​

EventWhen
user.login, user.login_failed, user.logoutLocal/admin sign-in lifecycle
user.sso_loginSSO sign-in
user.invited, user.enabled, user.disabled, user.deletedUser lifecycle
user.role_changedA role/group assignment changed

Administration​

EventWhen
admin.setting_changedAny control-plane change — policy matrix, providers, custom rules, SSO, vault, password/lockout admin actions, and more

Control-plane changes are also recorded with old_value / new_value, source IP, and actor for the RBAC audit log — every administrative mutation is captured.

Agentic events (roadmap)

Event types under agent.* (plan created, tool-call requested/allowed/blocked, approval required, action executed) are reserved for governed agentic workflows.

Export​

Events can be streamed to your SIEM via a governed destination. Export requires the export_audit_logs permission.