DocumentationEvents and audit log

Events and audit log

Events and audit log

JSON schema of usage events, HMAC integrity chain, Windows DLPIA/Security log, local retention and SIEM export. No sensitive value is ever stored.

The agent emits metadata events for every intercepted request to an AI service. Each event describes the action without ever carrying the prompt content, the detected values, or a plain-text file name.

Events live in a page-encrypted SQLite database, events.dat, chained by HMAC fingerprint. Any deletion or change is detectable, even by a local administrator.

Usage event schema

Every intercepted request produces an event of type usage. The body is a stable JSON, versioned by the applied policy and catalog.

{
  "id": "018f3b2a-7c6d-7e4a-9f12-0a1b2c3d4e5f",
  "seq": 48213,
  "ts": "2026-10-18T09:42:11.837Z",
  "user_sid": "h:7a1c…",
  "session_id": "s-42",
  "channel": "web",
  "service_id": "openai-chat",
  "process_image": "msedge.exe",
  "process_signer": "Microsoft Corporation",
  "request_kind": "prompt",
  "size_bytes": 1842,
  "file_count": 1,
  "file_types": [{ "extension": "pdf", "size": 184320 }],
  "entities": {
    "pii.email":   { "count": 2, "max_score": 9820, "severity": "high", "exposed": 0 },
    "pii.iban":    { "count": 1, "max_score": 9910, "severity": "high", "exposed": 0 }
  },
  "outcome": "obfuscated",
  "bypass_reason": null,
  "bypass_text": null,
  "analysis_ms": 54,
  "decision_ms": 2180,
  "policy_version": "p-2026-10-14",
  "catalog_version": "c-2026-10-11",
  "model_versions": { "pii": "1.4.2", "health": "0.9.1" },
  "prev_hash": "b5e1…",
  "hash": "a7c2…"
}

Event body fields

Usage event fields (agent spec 9.4).
FieldTypeDescription
idUUIDv7Unique event identifier, time-ordered.
seqintegerLocal sequence number, continuous within a chain.
tsISO 8601 UTCProduction timestamp, millisecond precision.
user_sidstringWindows SID; pseudonymised to h:<hmac> depending on reporting settings.
session_idstringWindows session of the user.
channelenumweb, desktop, api, code_assistant, internal.
service_idstringAI service id in the catalog.
process_imagestringOriginating executable name, path stripped.
process_signerstringAuthenticode publisher if the process is signed.
request_kindenumprompt, upload, websocket.
size_bytesintegerTotal request size in bytes.
file_countintegerNumber of attached files.
file_typesarrayPer file: normalised extension and size.
entitiesobjectPer detected category: count, max score, severity, exposed count.
outcomeenumRequest outcome (see dedicated table).
bypass_reasonstringIdentifier of the reason picked by the user.
bypass_textstringFree justification, after entity replacement (redacted).
analysis_msintegerDetection library analysis time.
decision_msintegerTime between dialog opening and decision.
policy_versionstringApplied policy version.
catalog_versionstringApplied catalog version.
model_versionsobjectVersion of each BLOB model loaded for analysis.
prev_hashstringHMAC of the previous event in the chain.
hashstringHMAC of this event, sealing the chain.

Possible outcome values

Request outcomes — values of the outcome field.
ValueMeaningRequest sent?
cleanNo sensitive data detected.Yes
obfuscatedEntities replaced by their label.Yes
auto_obfuscatedAutomatic obfuscation, no user decision.Yes
editedUser manually edited the prompt.Yes
bypassedSent in clear after user justification.Yes
cancelledUser cancelled the request.No
blockedPolicy blocked with no user option.No
timeoutDecision dialog timed out.No
client_abortedClient application closed the connection.No
analysis_failed_openAnalysis impossible, fail-open rule: allowed.Yes
analysis_failed_closedAnalysis impossible, fail-closed rule: blocked.No
not_inspectableFlow not inspectable (pinning, end-to-end encryption).Yes
observedChannel in observation mode: traced, not blocked.Yes
rememberedMemorised choice reapplied identically.Yes / No

Other event types

  • config_changed — effective configuration changed: source, version, list of changed paths. No values.
  • config_rejected — configuration or catalog document refused: source and reason.
  • tamper — tampering detected: kind, short detail, severity.
  • lifecycle — start, stop, update, rollback, uninstall in progress.
  • sync — integrity anchor sent to the server.
  • data_loss — forced purge: number of lost events and covered period.

HMAC integrity chain

Each event carries two fingerprints that bind the database to its past.

hash = HMAC-SHA-256(
  integrity_key,
  prev_hash || canonical_json(event_without_hash)
)
  • Integrity key: per-device HMAC-SHA-256 key, wrapped by the TPM or machine-scope DPAPI.
  • Chaining: prev_hash is the previous event's hash. Breaking the chain is detected.
  • Anchors: every hour and on each upload, a signed (seq, hash) pair is sent to the server.
  • Verification: at startup and every 24 h, the agent re-verifies the chain from the last anchor.

Windows DLPIA/Security log

In parallel with internal storage, the agent writes a subset of events into a dedicated Windows ETW channel, DLPIA/Security, declared by the manifest installer/etw/dlpia.man.

  • Provider: DLP-IA-Security · GUID {A7C3D2E1-1F4B-4C8A-9E6D-2B3C4D5E6F70}.
  • Channel: DLPIA/Security, Admin type, value 16.
  • Template: every entry carries a redacted Detail and a business severity from 0 (Low) to 3 (Critical).
  • Clients collect the channel with Windows Event Forwarding, the Microsoft Sentinel agent or the Splunk Universal Forwarder.

Windows event ids

Business event to Windows id mapping (crates/dlpia-log/src/eventlog.rs).
IdSymbolLevelMeaning
1001LifecycleStartedInformationAgent started.
1002LifecycleStoppedInformationAgent stopped.
1003LifecycleAbnormalErrorAbnormal stop detected.
1004LifecycleUpdatedInformationAgent updated.
1005LifecycleRolledBackWarningAgent rolled back to previous version.
1006LifecycleUninstallInformationUninstall in progress.
2001UsageBypassedErrorUser bypass, reported within 5 s.
2002UsageBlockedWarningRequest blocked by policy.
2003UsageObfuscatedInformationRequest obfuscated or edited.
2004UsageCancelledInformationRequest cancelled by the user.
3001ConfigChangedInformationEffective configuration changed.
3002ConfigRejectedErrorConfiguration or catalog document refused.
4001TamperCaRemovedCriticalLocal CA removed from the store.
4002TamperWfpRemovedCriticalWFP filters removed.
4003TamperDriverUnloadedCriticalDriver unloaded.
4004TamperServiceKilledCriticalService force-stopped.
4005TamperExtensionMissingCriticalBrowser extension missing.
4006TamperBrowserPolicyCriticalBrowser policy removed.
4007TamperHostsRedirectCriticalHosts file redirect detected.
4008TamperConfigSignatureCriticalInvalid configuration signature.
4009TamperIntegrityChainCriticalIntegrity chain broken.
4010TamperBinaryModifiedCriticalAgent binary modified.
4011TamperClockRollbackCriticalSystem clock rolled back.
5001ModelUnavailableWarningDetection model unavailable.
5002DataLossErrorEvents lost before upload.
5003StoreResetWarningEvent database reset.
6001UnknownAiEndpointInformationAI endpoint discovered outside the catalog.
7001AdminActionInformationAdministrative action.

ETW manifest compilation

# Generate the message header and resources (WDK/SDK required)
mc.exe -um installer\etw\dlpia.man -r installer\etw\gen -h installer\etw\gen
rc.exe installer\etw\gen\dlpia.rc

# Register the channel (admin; binary carrying the resources)
wevtutil im installer\etw\dlpia.man `
  /rf:"%ProgramFiles%\DLP-IA\dlpia-svc.exe" `
  /mf:"%ProgramFiles%\DLP-IA\dlpia-svc.exe"

Local retention

Local event retention and purge.
LimitDefaultBehaviour
Age90 daysPurges older events except those not yet uploaded.
Size2 GBFIFO purge of the oldest already uploaded.
BothFirst limit reachedTriggers the purge.
Not uploadedPreservedIf size forces a purge, a data_loss event is produced.

Both limits are configurable, from 1 to 3650 days and up to the disk size. Low-storage endpoints shrink the window to 30 days.

Server-side retention

Aggregation server retention.
TypeDefaultConfigurable range
Raw events365 days1 to 3650 days
Daily aggregates1095 days90 to 3650 days
Alerts730 days30 to 3650 days
Audit log3650 daysNot reducible

SIEM export

Beyond the Windows channel, the agent and the server can export to an external SIEM. The configured pseudonymisation level applies to all exports.

Available SIEM export formats.
FormatTransportSource
Syslog RFC 5424TCP TLS, port 6514Agent or server.
OCSFJSON over HTTPSServer, via connector.
Splunk HECHTTPS, header Authorization: Splunk <token>Server.
Microsoft SentinelMicrosoft Monitoring AgentAgent via the ETW channel.
Google ChronicleJSON over HTTPSServer, via connector.
{
  "time": "2026-10-18T09:42:11.837Z",
  "severity": "high",
  "activity_name": "ai_prompt_obfuscated",
  "class_name": "Data Security Finding",
  "category_name": "Findings",
  "actor": { "user": { "uid_alt": "h:7a1c…" } },
  "process":  { "name": "msedge.exe", "publisher": "Microsoft Corporation" },
  "network": { "application": "openai-chat", "channel": "web" },
  "finding": { "types": ["pii.email", "pii.iban"], "exposed": 0, "count": 3 },
  "metadata": { "product": "MaelGard", "version": "2026.10" }
}

Pseudonymisation

Pseudonymisation levels at upload time.
LevelReported identityRe-identification
NominativeSID, UPN, machine nameDirect.
Pseudonymised (recommended default)HMAC-SHA-256(client_key, UPN) and same for machineOnly by the key holder, following a documented procedure.
AnonymousNo identity, only organisational unit or groupImpossible.

Redaction of text fields

  • The bypass_text field comes from the user, but the service replaces each detected entity before storing.
  • The Detail field of the Windows channel is redacted by the logging layer: no value crosses it.
  • File names are never written: only the extension (10 ASCII characters, otherwise other) and size are stored.
  • An automated test injects marker values and checks their absence at every log level, including trace.