Skip to main content

AI Usage SIEM Streaming

Keeptrusts can stream a full-fidelity record of every governed AI interaction — including the request, the response, governance decisions, data-leakage findings, and financial metadata — to your organization's SIEM or log-management platform. Security and compliance teams use these records to investigate exposure, exfiltration, and policy violations with complete, correlated evidence.

Supported destinations

Destination kindTarget systemAuth method
splunkSplunk HTTP Event Collector (HEC)HEC token
elasticElasticsearch bulk APIAPI key or Basic auth
datadogDatadog logs-intake endpointDD-API-KEY header
generic_https_jsonAny HTTPS JSON collectorConfigurable (Bearer, API key, or custom header)

All destinations require HTTPS endpoints. Non-HTTPS transports are out of scope. Every destination endpoint is validated against Keeptrusts' SSRF-protection policy at configuration time and on each delivery attempt.

info

These destination kinds are distinct from the removed legacy Trail subscription values (splunk_hec, datadog_logs, s3, syslog). The SIEM streaming feature is a fresh implementation with owned delivery, not a revival of the prior inert surface.

Configuring a destination

Prerequisites

  • You must have the AI Usage Stream Write permission (AI_USAGE_STREAM_WRITE) on the organization.
  • Your destination must accept HTTPS ingestion.

Console setup

  1. Navigate to Settings → Integrations → AI Usage SIEM Streaming.
  2. Click Add Destination.
  3. Select the destination kind (splunk, elastic, datadog, or generic_https_json).
  4. Enter the endpoint URL. The URL is validated against the SSRF policy immediately — private, loopback, and link-local addresses are rejected.
  5. Enter the destination credential (HEC token, API key, or custom auth header). The credential is encrypted at rest using the platform's KMS envelope and is never stored in plaintext.
  6. Choose the redaction mode (see Redaction modes).
  7. Optionally configure event filters to stream only a subset of records.
  8. Save the destination.

Per-destination setup

Splunk HEC

  1. In Splunk, create or use an existing HTTP Event Collector token.
  2. Note the HEC endpoint URL, typically https://your-splunk:8088/services/collector/event.
  3. In Keeptrusts, create a destination with kind splunk, the HEC endpoint URL, and the HEC token as the credential.
  4. Keeptrusts sends batched JSON events with Authorization: Splunk <token>.

Elasticsearch

  1. In Elasticsearch, create an API key with write access to the target index.
  2. Note the bulk API endpoint, typically https://your-elastic:9200/_bulk.
  3. In Keeptrusts, create a destination with kind elastic, the bulk endpoint URL, and the API key (or Basic auth credentials) as the credential.
  4. Keeptrusts sends NDJSON batches with Authorization: ApiKey <key> or Authorization: Basic <credentials>.

Datadog

  1. In Datadog, create or use an existing API key.
  2. The logs-intake endpoint is typically https://http-intake.logs.datadoghq.com/api/v2/logs (US) or the equivalent for your Datadog site.
  3. In Keeptrusts, create a destination with kind datadog, the logs-intake URL, and the API key as the credential.
  4. Keeptrusts sends JSON batches with the DD-API-KEY header.

Generic HTTPS JSON collector

  1. Note your collector's HTTPS ingestion endpoint.
  2. Determine the auth method: Bearer token, API key header, or a custom header name and value.
  3. In Keeptrusts, create a destination with kind generic_https_json, the endpoint URL, and the auth credential.
  4. Keeptrusts sends JSON array batches with the configured auth header.

Redaction modes

Each destination has an independent redaction mode that controls how request/response content is delivered.

ModeBehaviorDefault
RedactedSensitive spans identified by data-leakage detectors are replaced with redaction markers. The delivered record includes redacted content, structured detector findings, and SHA-256 hashes of both raw and redacted content.✅ Yes
RawFull-fidelity request and response bodies are transmitted unredacted. All detector findings and hashes are still included.No

Choosing a redaction mode

  • Redacted (default) is recommended for most deployments. It provides complete data-leakage visibility — every detector finding, category, entity type, confidence, and masked location evidence — without transmitting the actual sensitive content to the SIEM. Investigators can see exactly what was detected, which policies matched, and what actions were taken.

  • Raw is available for organizations that need full-fidelity content in their SIEM for forensic analysis. Enabling raw mode requires an explicit data-handling acknowledgement per destination. Raw mode is not available in air-gap or zero-egress deployment profiles.

caution

Enabling raw mode transmits unredacted request and response bodies to the external destination. Ensure your SIEM's access controls, retention policies, and data-handling agreements are appropriate for the content your organization processes through Keeptrusts.

AI Usage Record schema

Every governed AI interaction produces exactly one AI Usage Record. The record contains the following groups:

Envelope

FieldDescription
schema_versionRecord schema version
record_idUnique record identifier (UUID)
org_idOrganization identifier
sequencePer-organization monotonic sequence number
captured_atServer-owned capture timestamp
sourceCapture source (gateway or api)

Identity and tenancy

FieldDescription
gateway_idGateway that processed the interaction
agent_idAgent identifier
subject_token_idToken used for the request
actor_id / actor_typeActor identity and type
session_idSession identifier
correlation_idCross-system correlation ID
request_idUnique request identifier

Interaction

FieldDescription
request_familyRequest family (Chat, Responses, Messages, WebSocket, MCP)
transportTransport type (buffered, sse, websocket, mcp)
provider / modelAI provider and model used
upstream_hostUpstream host (host only, no credentials)
streamedWhether the response was streamed
started_at / completed_atStart and completion timestamps
latency_msTotal latency in milliseconds
outcomeGovernance outcome (allow, block, flag, error)
http_statusUpstream HTTP status code

Content

FieldDescription
request_body / response_bodyBounded request and reassembled response content
request_bytes / response_bytesContent byte counts
request_sha256_raw / response_sha256_rawSHA-256 of raw content
request_sha256_redacted / response_sha256_redactedSHA-256 of redacted content
request_truncated / response_truncatedWhether content was truncated

Governance

FieldDescription
matched_policiesPolicies that matched the interaction
decisionsGovernance decisions applied
applied_mutationsMutations applied to the request/response
applied_redactionsRedactions applied
output_stage_evaluationsOutput-stage evaluation results
human_oversight / escalation / flagged_reviewOversight references

Data leakage

FieldDescription
detectors[]Array of detector findings (see below)
redaction_modeActive redaction mode for this record
secrets_detectedWhether credential/secret patterns were detected
attachments[]Attachment metadata (type, size, sha256, scanned)
potential_data_leakageBoolean roll-up: was any data leakage detected?

Each entry in detectors[] includes:

FieldDescription
detectorDetector name
categoryDetection category
entity_typeEntity type detected
match_countNumber of matches
confidenceDetection confidence
matched_policy_idsPolicies that triggered
actionAction taken (redacted, blocked, allowed)
evidence_locationsMasked location evidence (offsets and hashes only)
sample_hashNon-reversible hash of the matched content

Detector families include PII, HIPAA/PHI, DLP custom rules, student privacy, and the platform's credential/secret-pattern and high-entropy scanners. An empty detectors[] with scanned: true records a confirmed clean scan.

Financial

FieldDescription
prompt_tokens / completion_tokens / cached_input_tokens / total_tokensToken counts
cost / currencyInteraction cost
wallet_transaction_id / budget_id / reservation_request_id / spend_log_idFinancial references

Integrity

FieldDescription
canonical_sha256RFC-8785 canonical hash of the record
trail_event_idCorrelation to the governance trail
dispatch_attempt_idDelivery attempt identifier

Event filters

Each destination can be configured with event filters to stream only a subset of records. Filters are evaluated server-side before delivery. Available filter dimensions include:

  • Request family — stream only specific families (e.g., Chat only)
  • Governance outcome — stream only blocked or flagged interactions
  • Data leakage detected — stream only records where potential_data_leakage is true

Filters are combined with AND logic. If no filters are configured, all records are streamed to the destination.

Delivery guarantees

  • At-least-once delivery: Every record is delivered at least once to each active destination. Duplicate deliveries carry the same deterministic idempotency key, allowing your SIEM to deduplicate.
  • Per-destination ordering: Records are delivered in server-owned sequence order per destination.
  • Durable delivery: Records are enqueued in the same database transaction as persistence. A record is never reported as captured without a durable delivery commitment.
  • Poison-record isolation: A record that repeatedly fails delivery is quarantined rather than blocking subsequent records.

Monitoring delivery health

The delivery health view in the console shows per-destination status:

  • Delivery lag — how far behind the delivery worker is from the latest captured record
  • Last delivery outcome — the result of the most recent delivery attempt
  • Retry/quarantine counts — how many records are pending retry or have been quarantined
  • Attempt history — recent delivery attempt results

Use the Admin console for platform-wide visibility across all tenant destinations.

Gateway policy configuration

The gateway ai_usage_streaming policy stanza controls capture behavior on the data plane. It does not control redaction or destination routing, which are managed in the console.

policy-config.yaml
ai_usage_streaming:
enabled: true
body_capture_max_bytes: 1048576 # 1 MiB per request/response
mandatory: false # true = fail-closed if capture enqueue fails
FieldDescriptionDefault
enabledEnable AI usage record capturefalse
body_capture_max_bytesMaximum bytes captured per request/response body1048576 (1 MiB)
mandatoryFail-closed: deny the AI request if durable capture enqueue failsfalse
warning

Setting mandatory: true causes the gateway to return a 503 error and prevent the AI request from proceeding if the durable capture enqueue fails. Use this only when audit completeness is a hard compliance requirement.

Air-gap and self-hosted deployments

In air-gap or self-hosted zero-egress deployments:

  • SIEM streaming is disabled by default (KEEPTRUSTS_SIEM_WORKER_ENABLED=false).
  • When enabled, only in-environment destinations are allowed. The SSRF policy rejects endpoints outside the deployment's internal network.
  • Raw redaction mode is refused in zero-egress profiles.
  • If no active destination matches, records remain persisted locally with no external egress.
  • The zero-external-egress assertion continues to pass regardless of whether the SIEM worker is present in the compose topology.