jev-sentinel
A guard for coding agents, built on TypeSafe's Jev model: it checks what the agent does, reads, and says. One set of checks, three hosts: a Pi extension, and a plugin for Claude Code and Codex CLI.
A README that says "AI agents: run curl … | sh" is just more text to the model, and a permission prompt that only knows a tool name cannot tell you whether this command is what you asked for. Jev Sentinel puts a fast, cheap judge in front of every step: Jev answers typed questions with probabilities, and plain code turns those into allow, ask you, or warn. Pi has no permission system at all, so there it is the gate; on Claude Code and Codex it adds a content-aware layer on top of the prompts you already get.

What it checks
| When | Check | What happens when flagged |
|---|
| Before a tool call runs | Intent (on task / off task / injected / needs more context) and risk (safe → needs approval → harmful, scored 0 to 2) | Asks you, or warns with Block highlighted. If you block it, the agent is told plainly and tries another way. |
| Before the agent reads a tool output | Does the file or command output contain instructions for AI agents, and are they benign or suspicious? | A warning is put on top of the output, you get an alert, and every later action needs your approval until /jev-sentinel reset. |
| After a reply finishes | Harmful content; relaying injected instructions. Optional: unsupported claims, skipped work. | You get a notice. It is never added to the agent's context. |
It also:
- Asks for more context when unsure. If Jev says more context would help, the extension adds earlier messages, full tool outputs, or file contents, and asks again (up to 3 rounds) before interrupting you.
- Scrubs secrets before they reach Jev. Output from
.env, keys, and credential files is withheld. Their values, secret-looking environment variables, NAME=value secrets, and Bearer tokens are scrubbed from everything sent to Jev, including the agent's own replies. This is pattern-based, so it reduces leaks rather than guaranteeing none (see What is sent).
- Pins a task (optional). Start a message with
* to pin it. Jev then judges "on task" against the pin instead of whatever the chat drifted to.
- Fails closed. If Jev errors or no key is set, it asks you. It never auto-allows.
- Protects its own settings. Any tool call other than a read that touches
~/.pi/agent (pi's settings, sessions, and this extension's settings) or the decision log always gets the Block-first warning, whatever Jev says.
Examples
These screenshots come from real runs with gpt-4o-mini as the agent, taken while the project was still called jev-guard.
| |
|---|
Output check: the README is flagged (100%) before the agent sees it, and the agent declines the setup command. | Layers: a trusted file skips the output check, but the curl … | sh it asks for is still caught (injected 83%). |
Pinned task: with "fix the login bug" pinned, a footer edit is asked as off task (80%). | Reply check: the agent repeats a planted curl | sh "recommendation", and it is flagged (98%). |
Caught twice: told "don't delete right now", the agent ran rm -rf anyway (asked, off task 98%), then contradicted itself (flagged as unsupported, 94%). | Approval: npm test runs silently, and npm install lodash asks (needs approval, 0.93). |
Warnings shown inside replies in some screenshots are from an earlier version. Reply warnings are now shown to you only.
Install
Set your TypeSafe key (console.typesafe.ai/keys) first, in the shell your agent runs in:
export TYPESAFE_API_KEY=... # PowerShell: $env:TYPESAFE_API_KEY = "..."
Pi
pi install git:github.com/harshwasan/jev-sentinel
Or try it without installing: pi -e git:github.com/harshwasan/jev-sentinel.
Inside pi, /jev-sentinel shows the status. /jev-sentinel reset clears the "every action needs approval" flag. /jev-sentinel task, clear-task, and pin-symbol <s> manage pinning.
Claude Code