Designing an AI Evidence Gateway: Durable WAL, Portable MMR Proofs, and Bounded Formal Checks Aegis Latent Core, an AI governance and evidence gateway for governed LLM traffic, implements durable evidence records, portable Merkle Mountain Range inclusion proofs, and narrowly scoped formal checks. The gateway uses an append-only JSONL write-ahead log as the authoritative replay authority, with an optional Rust-backed segment for auxiliary streaming frames. The project emphasizes the boundaries of its guarantees, noting that fsync does not prove power-loss behavior or external custody. AI gateways are often discussed as routing layers: authenticate a caller, apply policy, forward a request, and record what happened. For higher-assurance deployments, the harder engineering question is what evidence remains after a request completes—and exactly what that evidence proves. Aegis Latent Core https://github.com/JuanLunaIA/aegis-latent-core is an AI Governance and Evidence Gateway for governed LLM traffic. Its current source implements provider-aware request controls, bounded streaming redaction, durable evidence records, portable Merkle Mountain Range MMR inclusion proofs, Python and TypeScript integrations, and narrowly scoped formal checks. This article walks through those mechanisms and, just as importantly, their boundaries. Version note:GitHub currently exposes a Release labeled , while the source anchors, all ten named Release assets, and the published SDKs identify version v4.0.1 4.0.0 . The v4.0.1 ref points directly to a commit, making it a lightweight tag. Treat v4.0.1 as the GitHub Release label—not as evidence that the artifacts were rebuilt as 4.0.1, that the tag is signed, or that the tag-triggered publication workflows produced the public objects. At a high level, Aegis sits between an application and a configured model provider. The non-streaming and streaming paths share admission controls, but they cross the evidence boundary differently. Client application | | request v Aegis gateway |-- authenticate caller and assign request identity |-- enforce body bounds and canonicalize input |-- apply WAF, egress, session, and rate-limit controls | | admitted request v Configured upstream model provider | | response or terminal error v Aegis gateway | |-- non-streaming ---------------------------------------| | canonicalize outcome | | hash and commit evidence to authoritative JSONL WAL | | flush + fsync | | return governed response | | | |-- SSE streaming --------------------------------------| incrementally sanitize canonical events | emit through a bounded, byte-accounted queue | hash the exact bytes emitted | commit one terminal summary | emit the protocol terminal marker only after commit | v proof lookup / audit views For non-streaming traffic, the response crosses the durable evidence gate before it is returned. For admitted Server-Sent Events SSE , sanitized non-terminal events can be emitted incrementally. Initial evidence and proof status is therefore pending-terminal ; the success terminal marker is withheld until the terminal summary commits. The replay authority is an append-only JSONL WAL at the configured storage path. It stores chain linkage, request and response hashes, portable proof metadata, signature metadata, and request identity. Calling fsync means the process asked the operating system to synchronize the descriptor; it does not by itself prove power-loss behavior, replicated-volume durability, immutable retention, or external custody. Those remain deployment questions. The repository includes an optional native RustWal . When the extension is available, it receives an auxiliary copy of terminal streaming frames in a bounded memory-mapped, CRC32-framed segment at