Skip to content

Mastra Jev Moderation

One-file Mastra input processor that screens the last user message with Jev instead of an LLM verdict: a typed yes/no gate plus a log-only category label, in a single request that fails open behind a circuit breaker.

Stars
7
Language
TypeScript
License
MIT
Published by
Community
Author
CodeAlive-AI
Last verified
Oct 2026

About this project

Input moderation for Mastra agents on TypeSafe Jev: one file, one request per turn, no text to parse.

Quoted from the project's README. Read the full README.

Highlights

  • On one production assistant it blocked 9 of 9 hostile messages and 0 of 49 real ones over 58 Russian-language cases, at 0.39-0.44 s median.
  • The built-in Mastra processor on `gpt-oss-120b` took 1.97 s median for the same set at roughly 4x the price, and the README notes your domain is not theirs.
  • Fails open by design: a 5 s timeout, HTTP error, unparsable answer or open breaker lets the message through with one log line, and 3 failures open it for 60 s.
  • A blocked turn ends with a tripwire whose reason is `MESSAGE_BLOCKED`, so you check `isModerationBlock` rather than treating any tripwire as a block.

Watch out

Block only, with no output moderation, and it inspects the last message only up to `maxChars` of 8,000 characters, so earlier turns are not screened. The failure mode is fail-open, the opposite of what a security boundary wants, and it is all configuration: `policy.allow` and `policy.block` are plain English with no training or examples. API details were checked against Jev 1.13.0, and choice options must go in `criteria` because an `options` field is rejected with 422. Copy reviewed against the repository README on 2026-10-04, not from running it.

Questions about this entry

Short answers drawn from the linked project or page.

More Jev resources like this

35GitHub stars
Diff-aware test selector that sends the git diff to Jev with one question per test, then prints the native filter flags and hands them to vitest, jest, node, bun, Playwright, cargo, or go test.
Jev Agents & MCP#community#jevbest#catalog-import
15GitHub stars
Node CLI that lints a file tree against fuzzy natural-language rules in one Markdown file, judging each matched file with a swappable TypeSafe-backed judge.
Jev Agents & MCP#community#jevbest#catalog-import
10GitHub stars
Pi context extension that folds repeated reads, filters long command logs through Jev, and retrieves saved originals as searchable verbatim chunks.
Jev Agents & MCP#community#jevbest#catalog-import
Next.js service with a POST /api/migration-guard endpoint that asks Jev a SAFE or DANGER choice about a SQL statement plus target environment, returning HTTP 403 to halt a CI step or HTTP 200 to let Prisma migrations proceed against Postgres.
Jev Agents & MCP#community#jevbest#catalog-import
1GitHub stars
A Claude Code plugin that verifies every tool call before it runs, asking Jev five parallel questions about the plan, scope, prior action and stated intent, then allowing, asking or blocking. Fresh installs ship in audit mode.
Jev Agents & MCP#community#jevbest#catalog-import
16GitHub stars
Single-command harness that turns a plain-language stack description into synced docs plus blocking hooks for Claude Code, Codex, and Pi, with deterministic presets or one Jev chooser call.
Jev Agents & MCP#community#jevbest#catalog-import
Back to all resources

From the Jev community

Posts from builders shipping with Jev right now.

Follow @typesafeai