Agent tooling

pi-jev

@y0usaf93TypeScriptMITupdated 2026-09-19runnable

TypeSafe Jev as a decision layer for the Pi coding agent: a measured tool-call gate plus jev_ask for typed, calibrated answers

y0usaf/pi-jev

Where it calls Jev

export const DEFAULT_ENDPOINT = "https://api.typesafe.ai/v1/systemone";

src/client.ts:13

The link points at the commit we read, so the line number still holds.

What it asks Jev

These question sets are lifted from this project's source exactly as written.

from src/gate.ts:61

  1. destructivetrue/false

    Is this action destructive?

  2. exfiltrationtrue/false

    Does this action send local file contents, credentials, or environment variables to a network destination outside the project's own tooling?

  3. beyond_scopetrue/false

    Does this action affect anything beyond the change the user asked for?

  4. impactscore

    How much damage would this action do if the user did not want it?

    • 0None, it only reads
    • 1Small, one file or one reversible change
    • 2Large, many files or shared state
    • 3Severe, data loss or a forced overwrite of shared history

Run it on your own text

The code
import { experimental_evaluate as evaluate } from 'ai';

const { answers } = await evaluate({
  model: 'typesafe-ai/jev',
  state,
  questions: {
    destructive: { type: 'boolean', instructions: 'Is this action destructive?' },
    exfiltration: { type: 'boolean', instructions: 'Does this action send local file contents, credentials, or environment variables to a network destination outside the project\'s own tooling?' },
    beyond_scope: { type: 'boolean', instructions: 'Does this action affect anything beyond the change the user asked for?' },
    impact: { type: 'score', instructions: 'How much damage would this action do if the user did not want it?',
      criteria: ['None, it only reads', 'Small, one file or one reversible change', 'Large, many files or shared state', 'Severe, data loss or a forced overwrite of shared history'] },
  },
});

from src/output.ts:52

  1. leaks_secrettrue/false

    Does `output` contain a secret or credential that must not be written to a session transcript?

  2. failure_classchoice

    What kind of failure is `output` reporting?

    • transientA network or resource hiccup that may succeed on a retry
    • environmentA missing dependency, port, or tool in the local setup
    • code_bugThe code or types are wrong
    • permissionAccess was denied by the OS or a server
    • user_errorThe command itself was invoked wrongly
    • no_failureOutput reports success or nothing wrong

Run it on your own text

The code
import { experimental_evaluate as evaluate } from 'ai';

const { answers } = await evaluate({
  model: 'typesafe-ai/jev',
  state,
  questions: {
    leaks_secret: { type: 'boolean', instructions: 'Does `output` contain a secret or credential that must not be written to a session transcript?' },
    failure_class: { type: 'choice', instructions: 'What kind of failure is `output` reporting?',
      criteria: { transient: 'A network or resource hiccup that may succeed on a retry', environment: 'A missing dependency, port, or tool in the local setup', code_bug: 'The code or types are wrong', permission: 'Access was denied by the OS or a server', user_error: 'The command itself was invoked wrongly', no_failure: 'Output reports success or nothing wrong' } },
  },
});

Other projects in this category