Skip to content

jevengineeringgate

Risk gate for AI coding agents: Jev decides at five layers and Claude Code hooks enforce deny or ask deterministically.

Projectbeta

Overview

jevengineeringgate moves the yes/no, routing and relevance calls inside an agent loop from the frontier model to Jev, and enforces the result with host hooks rather than instruction-file rules. The README argues a prose rule like run the risk gate before risky actions cannot work, because it requires the agent to already know the action is risky; a PreToolUse hook runs on every tool call and returns deny, ask or nothing.

There are five layers: L0 is deterministic code with no model call and a deny floor that is never referred to the model; L1 is Jev on a tool call about to execute, cached for six hours; L2 is Jev on an incoming task; L3 is Jev on finished work and routing; and L4 is Jev deciding what to keep in context. L0 settles most calls so the gate stays usable. The author reports about 292 input tokens, 0.98 seconds and $0.0000123 per measured decision, thresholds fitted by a sweep over 26 labelled cases, and zero wrong or unsafe decisions with 25 of 26 primary-label hits at the current operating point. It documents lessons such as rewording a saturating clarify question. It ships 48 offline tests and an idempotent hook installer for Claude Code.

What the decision model decides

TypeQuestionAnswers
ChoiceShould this tool call be denied, asked about or allowed?deny · ask · allow
Yes / noIs a required input actually absent from this task?—
ScoreWhat is the risk / security severity of this action?(inferred)—

How it works

  1. L0 deterministic rules settle what they can
  2. L1-L2 Jev judges tool calls and incoming tasks
  3. L3 Jev verifies finished work and routing; L4 manages context
  4. Hooks emit deny or ask; humans handle uncertainty

Strengths

  • Hooks enforce decisions without relying on agent memory
  • Measured cost about $0.0000123 per decision
  • Thresholds fitted on labelled cases
  • 48 offline tests

Caveats

  • Threshold sweep uses only 26 cases
  • Adds about a second per gated call

Getting started

git clone, npm install, add TYPESAFE_API_KEY to .env, npm test, then `node bin/install-hooks.cjs`.

At a glance

Type
Project
Status
beta
Language
JavaScript
Runtime
Claude Code hooks (Node)
Has code
yes
Has tests
yes

Use cases and integrations

How curated lists describe it

Frequently asked questions

Why not just write a rule in CLAUDE.md?

A rule requires the agent to know an action is risky; a hook runs on every tool call regardless.

What does a decision cost?

About 292 input tokens, 0.98 s and $0.0000123, as measured by the author.

Does the model ever override the deterministic deny floor?

No, L0 denials are never referred to the model.

Related projects

  • Auditable Zig terminal agent pairing Codex for coding with Jev typed preflight and postflight checks under deterministic policy gates.

    CLIproductionZig
  • Claude Code plugin adding typed Jev decisions to hooks: task kind, command risk, failure class, completion; never grants permissions.

    PluginbetaJavaScript
  • Claude Code plugin adding Jev judgments to Bash, Write and Edit calls and their outputs; a semantic guardrail, not a sandbox.

    Pluginbeta
  • Local guard layer for coding agents that blocks dangerous tool calls by deterministic rules, with optional Jev judgments.

    CLIbetaTypeScript
  • Agent-ergonomic Jev CLI and PreToolUse hook that scores shell commands for hazards and screens fetched text for injection.

    PluginbetaTypeScript
  • PreToolUse firewall for Claude Code and Codex: shell-aware rules first, then Jev returns allow, ask or block, failing closed.

    HookbetaTypeScript