Overview & Result
A lightweight guardrail for autonomous agent runtimes. By positioning Jev ahead of the main agent reasoning loop, it filters out prompt injections, jailbreaks, and out-of-scope tasks in ~400ms before expensive generative models are invoked.
How Jev fits in the loop
- Intercept incoming user requests at the agent runtime boundary.
- Call Jev Choice with predefined safety categories (Safe, Jailbreak, Off-topic, Policy-violation).
- Instantly reject or divert flagged requests to a safe fallback message.
- Pass approved requests forward to the Mastra agent execution loop.
How to reproduce
- Install mastra and clone the codealive-ai/mastra-jev-moderation repository.
- Configure the moderation middleware in your Mastra agent definition pipeline.
- Pass test prompts containing adversarial injections and safe user queries to observe instant classification and routing.
Why this build matters
Proves that safety guardrails can be low-latency, deterministic, and cost-effective rather than relying on slow, verbose LLM self-moderation.
Reported performance
Reported by authorLatency: ~0.4 s median latency
Published benchmark in repository tests across standard moderation test suites.
Limitations
- Focuses on text-based prompt injection and behavioral boundaries; cannot detect malicious compiled binaries.
- Edge cases with multi-turn prompt fragmentation need session-level tracking.
- High-stakes financial or administrative operations still require hard deterministic RBAC rules.