Agent
Jev inside your agent
Jev is not a chat model and cannot replace the LLM that runs your agent. It is the part you call at a decision point, when the agent's code needs a typed answer with a probability it can act on. The official docs say the same in Jev with coding agents.
- Three decision points where Jev fits
- Three ways to wire it in
- Read confidence, decide in code
- What Jev will not do
Three decision points where Jev fits
- Tool guard. Before a command with side effects runs, ask a Choice with
allow,review, andblock. Run onallowwith high confidence, ask the user otherwise. - Routing. Pick the handler, model, or team for an incoming request with a Choice. Add an
otheroption so odd inputs have somewhere to land. - Done check. After a step, ask a Noul such as "Does the last tool result satisfy the user's request?" and loop or stop on the probability.
Ask several questions about the same state in one request. Jev reads the state once and answers every question, which is cheaper and faster than one call per question.
{
"model": "jev-latest",
"state": {
"user_goal": "Fix the failing auth test",
"proposed_tool_call": "bash: git push --force origin main"
},
"questions": {
"gate": {
"type": "choice",
"instructions": "Should the agent run proposed_tool_call without asking the user?",
"criteria": {
"allow": "Read-only or local and easy to undo",
"review": "Changes shared state; a human should confirm",
"block": "Destroys work, history, or data"
}
},
"on_task": {
"type": "noul",
"instructions": "Does proposed_tool_call serve user_goal?"
}
}
}Paste it into the Jev Playground, add your key, and run it to see the real probabilities.
Three ways to wire it in
| Way | Use it when | Start here |
|---|---|---|
| MCP server | The agent itself should decide when to ask Jev (Claude Code, Cursor, Codex) | Jev MCP server |
| SDK in your code | You own the agent loop and want a fixed gate at a known step | The example below |
| Skill | Your coding agent is writing the Jev integration for you | Jev skill for coding agents |
import { TypeSafeClient, choice, noul } from "@typesafe-ai/sdk";
const jev = new TypeSafeClient(); // TYPESAFE_API_KEY
const GATE_CONFIDENCE = 0.7; // tune on your own traces
export async function gateToolCall(goal: string, call: string) {
const { answers } = await jev.systemOne({
state: { user_goal: goal, proposed_tool_call: call },
questions: {
gate: choice("Should the agent run proposed_tool_call without asking?", {
allow: "Read-only or local and easy to undo",
review: "Changes shared state; a human should confirm",
block: "Destroys work, history, or data",
}),
onTask: noul("Does proposed_tool_call serve user_goal?"),
},
});
if (answers.gate.choice === "block") return "block";
if (answers.gate.confidence < GATE_CONFIDENCE || answers.onTask.noul < 0.5) return "ask";
return answers.gate.choice === "allow" ? "run" : "ask";
}Read confidence, decide in code
Choice and Score answers carry confidence from 0 to 1. Treat it as a second axis: the answer tells you what, confidence tells you whether to act on it alone. Noul answers have no separate confidence; the probability itself is the signal.
- Keep thresholds in one file so a human can review them next to the questions.
- Tune thresholds on your own traces, not on a single demo.
- Pin
jev-1.13.0once thresholds are tuned.jev-latestmoves when TypeSafe ships a release. - English is Jev's strongest language. Test other languages on your own data before trusting a threshold.
What Jev will not do
- Write text, code, or explanations. It returns typed answers only.
- Call tools or take actions. Your code acts on its answer.
- Replace the model behind Claude Code, Cursor, or Codex. There is no
model: "jev-latest"switch for a coding agent.
More patterns: Choice, Score, and Noul, when not to use Jev, and the official patterns.