Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Audit Logging and AI-SPM Integration

TL;DR — Every agent action in SCHEMABOUND is captured in a tamper-evident audit log and exported via pluggable transport traits to SIEM platforms, HTTP webhooks, or rotating log files. The pipeline treats adversarial prompt injections, LLM jailbreak attempts, and unauthorized role escalation as first-class security signals alongside conventional access-control events.

Architecture

The audit system is composed of four interlocking parts:

 Client Request
      │
      ▼
 InjectionGuard — scans input before gRPC executor sees it
      │
      ▼
 EventBus (hash chain) — global ordered handler + exporter chain
      │
      ▼
 MultiTransportExporter — trait-based pluggable transport layer

Transport Configuration

All transports are configured via the MultiTransportExporter trait hierarchy. Each transport implements its own configuration struct:

TransportConfig TypePurpose
StderrStderrExporterConfigOCSF NDJSON or raw JSON to stderr (default)
HTTP WebhookWebhookExporterConfigSingle-destination SIEM integration
Rotating FileFileExporterConfigLocal persistence with size-based rotation
OTLP/TracingOtlpExporterConfigOpenTelemetry-compatible distributed tracing

Example: Configuring Multiple Transports

#![allow(unused)]
fn main() {
use schemabound::audit::{MultiTransportExporter, StderrExporter, FileExporter};

let exporter = MultiTransportExporter::new(vec![
    Box::new(StderrExporter::default()),
    Box::new(FileExporter::try_new("/var/log/schemabound/audit.ndjson")?),
]);
}

Each transport implements ExportEvent independently — adding a new destination requires no changes to the core pipeline.

OCSF v1.1 Output

All exports default to OCSF (Open Cybersecurity Schema Framework) v1.1. OCSF is the interchange format used by major SIEM and AI-SPM vendors including Amazon Security Lake, Microsoft Sentinel, Splunk, and Wiz.

Class Mapping

SCHEMABOUND EventOCSF ClassClass UID
SessionRegisteredAuthentication2001
AccessDenied, PromptInjectionSignalRaisedSecurity Finding2004
QueryExecuted, QueryValidation*, QueryExecutionError, RowsFiltered, ColumnsRedactedDatabase Activity6003
PlanCreated, PlanCompleted, PlanFailed, LlmToolCallAuditRecordedAPI Activity6005

Severity Mapping

OCSF SeveritySCHEMABOUND Trigger
Critical (5)Plan failure with execution error
High (4)PromptInjectionSignalRaised with severity high, access denied events
Medium (3)PromptInjectionSignalRaised with severity medium
Informational (1)All other events

Prompt Injection Detection

The InjectionGuard scans every incoming query against a compiled set of patterns before the gRPC executor processes it. When a pattern matches, a PromptInjectionSignalRaised event is always emitted to the audit pipeline regardless of policy.

Injection Policy

#![allow(unused)]
fn main() {
use schemabound::audit::InjectionPolicy;

// observe: record signal, allow request (default during rollout)
let policy = InjectionPolicy::observe();

// block: record signal, reject request when severity ≥ medium
let policy = InjectionPolicy::block(Medium);
}

Use observe during a rollout period to build a baseline of true-positive rates before switching to block. The detection signal is available to your SIEM in either mode.

Chain Integrity Verification (Enterprise)

SCHEMABOUND includes a background worker that continuously verifies audit log integrity by checking:

  • Sequence monotonicity: Events are emitted in strict ascending order with no gaps
  • Hash continuity: Each event’s prev_hash matches the computed hash of the previous envelope

When a breach is detected — whether from corruption, truncation, or intentional modification — the worker emits an AuditChainIntegrityBreach event that flows through the same exporter pipeline as regular audit records. This enables SIEM correlation and automated incident response.

See Data Resilience Workers for operational details.