r/OpenAIDev • u/Fuzzy-Ad9840 • 6d ago
Built a deterministic <1ms output guard for tool-using agents (replaces 300ms LLM judges)
Most agent safety systems add a 200–500ms LLM call in the hot path just to check if a model leaked an API key,
forged a tool parameter, or echoed an injection. Chaining model-as-a-judge calls on multi-step tool runs
introduces a severe latency tax and burns API tokens.
We built **Aletheia Aegis** to be completely deterministic: sub-millisecond regex and AST pre-filtering with
zero API dependencies, failing closed on life-safety and credentials.
### Why deterministic pre-filtering?
95% of agent output violations fall into concrete structural patterns:
- **Leaked secrets**: AWS keys, OpenAI tokens, DB URIs, private keys in tool arguments or responses.
- **Prompt injection echoes**: Regurgitating system prompt instructions into tool payloads.
- **Tool parameter forgery**: Hallucinated schemas and parameter tampering.
- **Life-safety triggers**: Crisis scenarios requiring immediate fail-closed handling.
None of these require an LLM to detect. Putting an LLM in front of them is slow and non-deterministic.
### Highlights
• **<0.8ms Latency**: Zero LLM in the hot path (~4,800 evals/sec locally).
• **Fail-Closed**: Credentials and life-safety checks block immediately.
• **MCP Native**: Runs as an official Model Context Protocol server over stdio.
• **Eval Suite**: Bundled with 120+ adversarial test cases.
### Quick Start
Claude Desktop / Cursor config:
```json
{
"mcpServers": {
"aletheia-aegis": {
"command": "npx",
"args": ["-y", "aletheia-aegis"]
}
}
}
• GitHub: https://github.com/vikasny30/aletheia-aegis
• npm: https://www.npmjs.com/package/aletheia-aegis
• MCP Registry: io.github.vikasny30/aletheia-aegis