Skip to content
System One

y0usaf/pi-jev

Extension making Jev the decision layer for the Pi coding agent: a measured tool-call gate plus a jev_ask tool. Judges whether an action is destructive, exfiltrates data or exceeds scope, then blocks or warns on calibrated thresholds.

y0usaf/pi-jev on GitHub

Stars
144
Forks
9
Language
TypeScript
License
MIT
Last push
22 Sep 2026

Read from GitHub on . Counts change daily.

Reported by the author

Gate latency
~300msa judgement costs one round trip of roughly 300 msgithub.com

pi-jev adds Jev as a decision layer in front of the Pi coding agent’s tool calls. Before a bash, write or edit call runs, a gate asks Jev four typed questions in one request: is this destructive (a noul question, threshold 0.90), does it send local data or secrets off-machine (noul, 0.70), does it affect more than what the user asked for (noul, 0.85), and how much damage would follow if the user didn’t want it (a four-level score, threshold 2.50). Because all four questions go in one request, a judgment costs a single round trip, reported at roughly 300 ms.

By default the extension runs in shadow mode: a flagged call produces a notification and a footer status but isn’t blocked. Enforce mode asks for confirmation before a flagged call runs, though headless sessions that can’t show a prompt fall back to the same warning unless blocking is explicitly turned on. Every error path fails open, so a missing key, timeout, rate limit or malformed response lets the tool call proceed rather than stalling the agent, and identical input is judged once per cache window, 120 seconds by default, so repeated calls don’t each cost a new request.

A separate output judge reads what a bash call actually printed, since the gate only sees the agent’s intent going in and can’t catch, for example, a credential echoed into the transcript.

How it uses Jev

 * can be exercised on its own with `node --input-type=module`.
 */

export const DEFAULT_ENDPOINT = "https://api.typesafe.ai/v1/systemone";
export const DEFAULT_MODEL = "jev-latest";
export const DEFAULT_TIMEOUT_MS = 20_000;
export const DEFAULT_RETRIES = 2;

/** Text, or structured data (chat logs, records, current application state). */
export type JevState = string | Record<string, unknown> | unknown[];

/** Yes/no question. Returns the probability that the answer is yes. */

View in src/client.ts

Open on GitHub

More like this

Use cases this is tagged with