jevbooks

← All projects

mastra-jev-moderation

CodeAlive-AI/mastra-jev-moderation

Mastra input moderation on Jev: one file, one typed request.

What it is

A Mastra input processor that moderates agent messages with TypeSafe Jev instead of an LLM, for teams that want a fast, cheap, fail-open block gate with no text to parse.

How it uses Jev

Jev answers two typed questions in one request over the last message's text: a `noul` probability for `blocking` (the gate) and a `choice` for `category` (logs only). The turn aborts when P(block) ≥ 0.7.

Primitives:noulchoice

Technique worth stealing

Ask a typed evaluation model for a probability instead of parsing a verdict out of generated text, so hostile input cannot produce an unparsable answer.

Try it

Copy `jev-moderation.ts` into the project, install `zod`, set `TYPESAFE_API_KEY`, and wire it as an `inputProcessor`.

View on GitHub

judged by Jevjev-1.13.0

Evidence

Each line is one question put to Jev about the README. ≥ 0.60 reads as yes, ≤ 0.40 as no; in between Jev is not making a call.

  • Jev-centricyes0.95
  • Shows a System One patternyes0.78
  • Handles uncertaintyyes0.95
  • Measuredyes0.97
  • Runnableyes0.92
  • Worth recommendingunclear0.59
  • Model replicano0.03
  • Problem scopescore on a 0–2 scale1.33
  • About Jevyes0.99

Signals by Jev jev-1.13.0, card written by DeepSeek V4.1 Flash from the README on 20 Sept 2026.