Skip to content

zod-jev

Adds Jev semantic rules to Zod 4 schemas: Zod checks the shape, Jev checks the meaning, all rules in one request.

LibrarybetaMIT

Overview

zod-jev composes Jev semantic checks into Zod 4 schemas. Shape rules stay in Zod, while judgments only a model can make, such as whether a body contains personal data, whether a price is plausible for an item, or whether a category matches a description, become calibrated probabilities that your code thresholds. A single parseAsync sends every semantic rule of the schema to Jev in one request and turns the probabilities into ordinary Zod issues.

semantic() returns the same schema type as the base, so methods like extend, strict and toJSONSchema still work. Adding rules barely changes latency because Jev answers questions about the same state in parallel. It fails closed: if a judgment is unavailable, it reports an issue rather than passing. The README cites 78 unit tests plus opt-in integration tests against the live API. MIT licensed on npm.

What the decision model decides

TypeQuestionAnswers
Yes / noDoes the body ask for a refund or a reversal of a charge?yes · no
Yes / noDoes the body contain no personal data?yes · no

How it works

  1. Wrap a Zod schema with z.semantic and rules.
  2. Call safeParseAsync.
  3. All rules go to Jev in one request.
  4. Failing or unavailable judgments become Zod issues.

Strengths

  • No new schema dialect.
  • One request per parse.
  • Fails closed.

Caveats

  • Requires a TypeSafe key.
  • Semantic checks add network latency to validation.

Getting started

npm install zod-jev; const z = createJevZod();

At a glance

Type
Library
Status
beta
Language
TypeScript
Runtime
Node library (Zod 4)
Has code
yes
Has tests
yes
License
MIT

Use cases and integrations

How curated lists describe it

  • Adds semantic rules to Zod validation, such as checking whether text matches a description or contains personal information.

    logicrw/awesome-jev-projects
  • Pairs local Zod shape validation with Jev semantic validation.

    cobanov/awesome-jev
  • Zod validates the shape, Jev validates the meaning: semantic checks on request bodies become calibrated probabilities you threshold in code.

    hellogumbo/awesome-jev
  • Adds Jev semantic checks to Zod 4 schemas. Zod validates the shape; Jev validates the meaning.

    MrJev/awesome-jev

Frequently asked questions

What does Jev check?

Semantic rules such as refund intent or presence of personal data.

What if Jev is unavailable?

It reports an issue; it never silently passes.

Does it change my schema type?

No, semantic() returns the same schema type.

Related projects

  • jevctl: Node CLI for typed Jev judgments (verify claims, screen agent hijacks, classify) with exit codes for CI gating.

    CLIbetaTypeScript
  • Go utilities for TypeSafe: a grep-like qgrep CLI, a kubectl plugin for asking questions about pod logs, and an SDK.

    ServicebetaGo
  • Python SDK for typed Jev judgments that masks state before sending and returns 'undecided' instead of raising on any failure.

    LibrarybetaPython
  • Native macOS agent app wiring 23 LLM providers into a task loop, listed with an optional Jev command-risk advisor via a TypeSafeKit client.

    LibraryproductionSwift
  • Published Jev client and claim check from the Fake/Real evidence-review site, where Jev filters sources and judges each claim.

    ProjectproductionTypeScript
  • Python/TypeScript/Go chatbot safety library checking user input and bot replies with Jev and returning one actionable verdict per message.

    LibraryproductionPython