101AITools

    Guide

    Jev for coding agents: routing, tools, loops, and risk gates

    Key takeaways

    • “Jev engineering” means control decisions leave the LLM and become typed API calls.
    • Hot path: model route, tool pick, context keep/drop, loop detect, risk gate.
    • Hard-wire non-negotiable gates; optionally expose MCP tools for softer judgments.
    • Cost story (Oct 2026 list): ~$0.042/M input, output free; latency often 70 to 500 ms.
    • Peers: Laya, Cloudflare Clef.

    Table of contents

    1. The problem in the loop
    2. Five decisions to extract
    3. Wiring patterns
    4. Thresholds and logging
    5. Related guides
    6. FAQ

    The problem in the loop

    Claude Code, Codex, Cursor, and similar agents are strong at writing and reasoning. Between edits they still ask structured questions hundreds of times: which model, which tool, is this safe, are we stuck?

    Answering those with another LLM call is slow, spendy, and still returns prose you parse.

    Jev is TypeSafe’s System One model for that layer. Last verified: October 2026. Primer: what is a System One decision model. Broader list: top 10 Jev use cases.

    Five decisions to extract

    1. Model-tier routing

    Choice or Score over difficulty. Easy refactors stay on a small model; ambiguous architecture work jumps tiers. Your spend dial lives in code.

    2. Tool selection

    Choice across shell, search, browser, apply-patch, and custom tools. Pass recent messages and the candidate tool list as state. Shortlist first if the catalog is large.

    3. Context keep vs drop

    Noul or Score on whether a file, span, or memory still matters. Agents that never forget drown their own context window. Agents that forget too eagerly thrash.

    4. Loop detection

    Noul: “are we repeating the same failing action?” When probability is high, break, summarize, or ask the user. Do not wait for the LLM to notice politely.

    5. Destructive-action risk gate

    Noul + Choice (allow / confirm / block) before rm, force-push, production migrate, mass email. This gate should be hard-wired, not an optional MCP suggestion.

    Wiring patterns

    PatternUse when
    Direct POST /v1/systemone (or SDK)Safety and routing must always run
    MCP tools for Choice/Score/NoulAgent may request extra judgments
    BothProduction default for serious agents

    Batch related questions over the same state so you pay for tokens once. Example: tool Choice + destructive Noul + loop Noul in one request after a proposed shell command.

    Compatible hosts can substitute Laya or Clef if your client only needs the wire shape. For edge + images, Clef is the natural peer.

    Thresholds and logging

    1. Log state hash, question ids, probabilities, action taken, and human override.
    2. Start with confirm-heavy thresholds on money and prod risk.
    3. Revisit weekly against false blocks and missed incidents.
    4. Remember: high confidence means a peaked distribution, not “the model is right.”

    Architecture companion: decision model vs LLM for routing.

    GuideWhy
    Jev reviewProduct and pricing
    Top 10 Jev use casesNon-agent patterns
    Jev vs Laya vs ClefHost choice

    FAQ

    See frontmatter FAQ for schema-ready Q&A (also rendered on the live guide page).

    3 curated tools below.

    ToolBest forPricingBilling note
    JevProductivityPaidPaid Service
    LayaAI AgentFreemiumFree Trial
    Cloudflare ClefAI AgentFreemiumFree Trial

    Frequently asked questions

    • Why use Jev inside a coding agent?

      Coding agents make hundreds of structured judgments between edits. Jev answers those as typed Choice, Score, and Noul probabilities in roughly 70 to 500 ms with input-only billing, instead of another slow generative call you still have to parse.

    • What decisions should leave the LLM?

      Move control decisions out: big vs small model, which tool, whether context is stale, whether the agent is looping, and whether a shell command looks destructive. Keep planning and code generation on the LLM.

    • How do I wire Jev into Cursor or Claude Code?

      Two patterns: call the Decision API directly from your loop for hard gates, and optionally expose primitives via an MCP server so the agent can request judgments. Most builders do both.

    • What threshold should I use for destructive actions?

      There is no universal number. Start conservative (confirm on modest p(destructive)), log outcomes, and tune. Confidence is not a correctness guarantee; it is how peaked the distribution is.

    • Can Laya or Clef do the same agent jobs?

      Yes, if they speak a compatible System One shape for your client. Clef helps when the agent already runs on Workers AI or needs image state. See our use-case guides for each.