Skip to content

Jev Agents & MCP

Approval policies for coding agents: hooks, guards, and gateways

How the Jev guard family turns coding-agent permissions into auto-approve, deny, or ask: hooks that enforce, guards that fail safe, and gateways that gate generation.
Published
Category
Jev Agents & MCP
Resources cited
11
Reading time
5 min
Tags#coding-agents#guardrails#hooks#approvals

The policy space for a coding agent is three verdicts wide: auto-approve, deny, or ask. The newest guards disagree less on the verdicts than on where the gate lives and what happens when the decision model is unreachable — the line between a cosmetic gate and an enforcement point.

The hook is the enforcement point

Automater's runbook on Claude Code and Jev states the distinction bluntly: an MCP server tool the model can decline to call is a second opinion, whatever its name says. Its prescription is one PreToolUse hook contract that denies on a risky verdict and on every Jev failure, with deny rules behind it, keeping MCP for lookups. It also places the launch-week cast — jkudish/jev-mcp at 227 stars, itsmostafa/typesafe-mcp at about 200, and LangChain's AutoModeMiddleware blocking tool calls at or above 0.5 (counts as of September 21, 2026) — and the coding-agent article covers that MCP side. The capture is truncated, so read the contract as its promise.

Allow, ask, or deny

jev-guard is the reference contract: it checks every shell command, file write, and file read before it runs and returns ALLOW, ASK, or DENY. Most calls are decided locally in under a millisecond — the project's own framing of its fast path, with no independent benchmarks — while ambiguous or destructive calls go to System One. It works with Claude Code, Codex CLI, and Antigravity, including autonomous modes like --dangerously-skip-permissions and --yolo. On API failure it asks instead of allowing — a fail-closed posture — and catastrophic actions never run automatically; the failure-modes article covers that choice.

The OpenCode guard is the same shape in another harness: an OpenCode 2 plugin that sends every shell command, local or over FarHand's remote shell, to Jev first with six typed questions — verdict, host_litter, global_install, global_config, harmful, privacy. A command counts as safe only if the verdict is run at or above minConfidence and every risk sits below its threshold; anything else asks. If Jev is unreachable, times out, or no key is set, it still asks — and the guard only ever adds prompts, never turns one your settings requested into an allow — the property to check in any guardrail.

Narrow gates, one contract

GateSurfaceDecisionLimit
Claude Jev WardenWrite, Edit, MultiEdit in Claude Code80% quality bar; exit 2 below itbuilt for SVG illustration work
Pi Jev GuardProposed edits in PiMarkdown rules per violationa review aid, not a linter replacement
jev-auto-approvePull requests via GitHub ActionsApprove only if every question clears your thresholdcan approve or skip, never block

Warden, built on Jev 1.13, runs at the OS process boundary via Claude Code's PreToolUse hook: approved edits exit 0, substandard work exits 2 with feedback injected into the agent's context, under an 80% bar the project's own audit runs set. A stand-alone CLI (node bin/jev-audit.js path/to/illustration.svg) prints model, score, verdict, and confidence. Pi Jev Guard installs with pi install git:github.com/Reindeer-AI/pi-jev-guard, reads TYPESAFE_API_KEY from Pi's environment, and reviews only edits under one instructionRoot chosen at policy load (edits outside are skipped), returning exact instruction text and source line ranges per violation. /jev status and /jev reload manage the policy. jev-auto-approve approves a pull request only when all three default questions — ready to merge, covered by tests, needs a human — clear the configured confidence threshold; a miss becomes a skip with a comment naming it. The confidence-gates article covers that choice.

Pre-flight on the prompt

Two hooks judge prompts before the main model reads them. Jev Pre-flight Gate is a UserPromptSubmit hook for WorkBuddy (and a pre_llm_call shell hook for Hermes Agent) that has Jev judge each prompt in about a second and injects a verdict line with dimensions like task_type, risk, and scope plus routing hints. It is fail-open by design — no key, timeout, error, or empty answer passes the prompt through — and three consecutive failures trip a 10-minute circuit breaker. The README's own measurement: 300 to 400 tokens per turn, a net loss near 1% on simple requests and positive in expectation overall.

The Codex hook, codex-jev-preflight, asks Jev for task_type, complexity, risk, and execution_mode, validates them against their enums, and injects them as advisory context that cannot override system instructions or an explicit user request. It carries a persistent breaker for exhausted quotas. The caveat here is privacy: every prompt sends the first 24,000 characters to a third-party endpoint, so sensitive text needs filtering.

What the gateways gate

The gateways put the same decision in front of generation. jev-decision-gateway batches small bounded questions through Jev and lets a deterministic policy layer — not the model — own thresholds and the execution plan; its README's before/after cuts an agent loop from four LLM calls per iteration to one gateway.evaluate() plus one generation call at the tier Jev picked. Jev answers typed Choice, Score, and Noul questions, and the repo states plainly it cannot write prose, summarize, produce code, or reason open-endedly.

Two more gateways matter. JEV Gateway is session-aware and OpenAI-compatible — it serves POST /v1/chat/completions, ships task_aware, quality, and economy strategies, and records requests, decisions, and outcomes in SQLite. JEV Safety Gateway sits between nginx and an OpenAI-compatible backend, asks whether user input is harmful, blocks risky requests with a 403, and passes the rest through unchanged. It decodes base64 segments before judging so encoded payloads cannot dilute the signal, and can be configured fail-open or fail-closed when Jev is unavailable. The safety gateway's README publishes no benchmarks, and the project is AGPL-3.0-or-later.

What to copy

  • Put the gate where the model cannot decline it; keep MCP for lookups.
  • Pick the failure posture per surface and write it down.
  • Keep every gate additive: it may add a prompt, never remove one.
  • Treat guards as review aids — tests, linters, and deny rules stay behind them.

From the Jev directory

The resources behind this article.

3GitHub stars
A safety gate for AI coding agents that checks every shell command, file write, and file read before it runs and returns ALLOW, ASK, or DENY: most calls are decided locally in under a millisecond, while ambiguous or destructive ones go to TypeSafe's System One model.
Jev Tools & CLIs#community#catalog-import#logicrw
Automater's runbook for turning a Claude Code plus Jev check into enforcement: sort integrations by who invokes them, put the gate in a PreToolUse hook that fails closed with deny rules behind, and keep MCP for lookups.
Jev Guides & ArticlesArticle#community#catalog-import#madewithjev
Community
An OpenCode 2 plugin that sends every shell command — local or over FarHand's remote shell — to Jev first: six typed questions about global installs, host litter, harmful actions and privacy, and a permission prompt whenever something looks risky.
Jev Integrations & Adapters#community#catalog-import#logicrw
9GitHub stars
A GitHub Action that asks Jev one yes/no question per thing worth checking on a pull request and approves only when every answer clears your confidence threshold; otherwise it skips and comments with the numbers.
Jev Integrations & Adapters#community#catalog-import#logicrw
1GitHub stars
A quality gate for Claude Code built on TypeSafe Jev 1.13: a PreToolUse hook intercepts Write, Edit and MultiEdit before they touch disk, has Jev judge the draft, and blocks anything under the 80% quality threshold with exit code 2 and diagnostic feedback for the agent.
Jev Agents & MCP#community#catalog-import#logicrw
5GitHub stars
A Pi extension that checks proposed code edits against your repository's Markdown rules with TypeSafe Jev and returns the exact instruction text and source line range for each violation. Informative mode reports; enforcement mode blocks reviewed code.
Jev Integrations & Adapters#community#catalog-import#logicrw
1GitHub stars
UserPromptSubmit hook for WorkBuddy (and a pre_llm_call shell hook for Hermes Agent) that has Jev judge every prompt in about a second and inject the verdict as routing hints, aiming to cut main-model tool calls and turnarounds.
Jev Integrations & Adapters#community#catalog-import#logicrw
2GitHub stars
A Codex UserPromptSubmit hook that asks Jev for task_type, complexity, risk and execution_mode before a task starts and injects the result as advisory context, failing open on timeouts, quota errors and invalid responses.
Jev Agents & MCP#community#awesomejev#catalog-import
A provider-agnostic decision gateway that puts Jev in front of expensive generative LLMs: small bounded questions are batched through Jev, a deterministic policy layer builds the execution plan, and generation runs only when the policy says so.
Jev Integrations & Adapters#community#catalog-import#logicrw
0GitHub stars
A session-aware, OpenAI-compatible gateway that routes chat completions across provider pools by cost, quality, and capability rules, optionally asks configured decision providers typed choice questions with a deterministic fallback, and records requests, decisions, and outcomes in SQLite.
Jev Integrations & Adapters#community#catalog-import#logicrw
19GitHub stars
A pre-filtering reverse proxy that sits between nginx and an OpenAI-compatible LLM backend: it extracts user input from each request, asks TypeSafe's JEV whether it is harmful, blocks risky ones with a 403 and passes normal ones through unchanged, streaming included.
Jev Integrations & Adapters#community#catalog-import#logicrw
Back to all articles

More Jev articles

How Pydantic AI, Mastra, TanStack AI, DSPy, Spring AI, and LiteLLM expose Jev: where the typed decision sits in the loop, what each integration returns, and which big frameworks are only adjacent.
Jev Integrations & Adapters#agents#frameworks#integrations
Read article
Tool menus can outgrow the context that reads them. The catalog's Jev-based routers and gates narrow the list: benchmarked tool search, per-tool scoring, fail-closed approvals, and WebMCP in the browser.
Jev Agents & MCP#mcp#tool-routing#agents
Read article

From the Jev AI model community

Posts from builders shipping with Jev right now.

Follow @typesafeai