Aletheia Aegis: Deterministic sub-millisecond output guard for AI agents Aletheia released Aegis 0.3.0, an Apache 2.0 TypeScript output guard for AI agents that runs deterministic pattern and structural checks on CPU at 0.019 to 0.029 ms at p95, blocking credential leaks and life-safety violations outright before any model-based judge is called. The framework positions its deterministic-first design against running a second LLM as judge on 100 percent of outbound traffic, which Aletheia says costs 1,000 to 4,000 ms per turn and roughly $0.002 to $0.02 per evaluation. An optional semantic judge from Anthropic, OpenAI or Gemini handles subjective checks on pre-redacted payloads, and Aegis retains no prompt or response text by default, storing only verdict counts, signature IDs and timings. A deterministic, sub-millisecond guard for model outputs. Fail-closed on irreversible harm, fast enough to sit on every response, with an optional semantic judge for the cases patterns cannot settle. Aegis is the output plane of the Aletheia safety framework. It inspects generated text before it reaches a user, blocks credential leaks and life-safety failures outright, and flags everything else for audit or disclaimer. It runs offline by default, on CPU, with no response text retained. Version 0.3.0. Apache 2.0. TypeScript, Node.js 18/20/22. Built for platform, security, and AI infrastructure teams deploying tool-using agents into regulated or high-throughput production environments. Production agents need safety that does not break the product. The common approach, running a second LLM as judge on 100 percent of outbound traffic, fails on three counts at scale: 1. Latency. A 1,000 to 4,000 ms penalty per turn breaks streaming and multi-step agentic loops. 2. Cost. A secondary frontier model on every payload turns safety into a cost center, roughly $0.002 to $0.02 per evaluation, tens of thousands of dollars monthly at scale. 3. Reliability. A probabilistic model policing another probabilistic model inherits prompt injection, evaluator hallucination, and nondeterministic bypasses. Aegis takes the opposite starting point: enforce the non-negotiable invariants deterministically, at wire speed, and reserve model judgment for the small set of cases where semantics actually matter. That is the core design bet. Deterministic first, semantic second, fail-closed throughout. 1. Deterministic first. Pattern and structural checks run on every output. No network call, no model call, no variance. 2. Fail-closed on irreversible harm. Credential exfiltration and life-safety violations block immediately. They are never sent to an external judge and cannot be overruled by one. 3. Semantic judgment is optional and pre-redacted. When enabled, a judge sees only masked payloads, under strict rubrics, with injection defenses on the review path itself. 4. Zero retention by default. Telemetry stores verdict counts, signature IDs, and timings only. No prompt or response text in logs. 5. Honest boundaries. Aegis is a fast first-line filter, not a proof of completeness. Its limits are documented below, not buried. flowchart TB subgraph Host "Host application / Agent runtime" A Raw model response stream end subgraph Aegis "Aletheia Aegis: Runtime Safety Platform" direction TB B "Stage 1: Deterministic engine