` telling the assistant to `curl … | sh` → `injection` p=0.99; a Hacker News thread *about* injection, a README, and the Claude Code hooks documentation → `discussion`/`benign`, p ≤ 0.08.
Results shorter than 200 characters and results of local edit/search tools are skipped. States above ~60k characters are truncated head+tail (injections like to hide at the end).
### Tuning
| Variable | Default | Effect |
| --- | --- | --- |
| `JEV_GUARD_DENY_SCORE` | `2.5` | risk position at which a call is denied |
| `JEV_GUARD_ASK_SCORE` | `1.5` | risk position at which approval is required |
| `JEV_GUARD_ASK_P` | `0.75` | approval probability at which approval is required |
| `JEV_GUARD_INJECT_P` | `0.6` | directed probability at which tool-result content is flagged |
| `JEV_GUARD_SKILL_P` | `0.8` | instruction-file probability that flags `unrelated_side_effects` |
| `JEV_GUARD_SKILL_SERIOUS_P` | `0.45` | instruction-file probability that flags exfiltration / covert execution / override / canary |
| `JEV_GUARD_TIMEOUT_MS` | `20000` | total time budget per Jev call, retries included (hosts kill hooks at ~30 s) |
| `JEV_GUARD_UNTRUSTED_P` | `0.7` | from-untrusted probability that denies a call outright |
| `JEV_GUARD_USER_P` | `0.85` | user-requested probability that turns ask into allow |
| `JEV_GUARD_SESSIONS` | `~/.jev-guard/sessions` | per-session memory directory |
| `JEV_GUARD_SCAN_CACHE` | `~/.jev-guard/scan-cache.json` | instruction-file scan cache |
| `JEV_GUARD_SKIP_TOOLS` | | comma-separated tool names never assessed |
| `JEV_GUARD_SKIP_SCAN` | | comma-separated tool names whose results are never scanned |
| `JEV_GUARD_FAIL_CLOSED` | unset | if set, an unreachable Jev **denies** instead of allowing |
| `JEV_MODEL` | `jev-latest` / `jev-1.13` / `typesafe-ai/jev` | model id for TypeSafe or `JEV_BASE_URL` / OpenRouter / the gateway |
| `JEV_BASE_URL` | unset | any System One server (`
/v1/systemone`), e.g. a local Kev; takes precedence over every key |
| `JEV_BASE_API_KEY` | unset | bearer key sent only to `JEV_BASE_URL` |
| `JEV_GUARD_CONFIG` | `~/.jev-guard/config.json` | where `jev-guard key` stores the key |
Scores must lie in 0–3 and probabilities in 0–1; anything else falls back to the default.
By default jev-guard fails **open** with a warning on stderr: a dead API must not freeze your agent. Flip it if you'd rather it did.
## CLI
```
jev-guard hook [--agent codex|copilot|agy] Command hook: JSON on stdin → JSON on stdout (Claude Code, Codex, Copilot, agy, Gemini, Cursor)
jev-guard acp --
ACP proxy
jev-guard check '' Assess one tool call; exit 0 allow, 1 ask, 2 deny
jev-guard scan [file] Scan a file or stdin; exit 2 if flagged
jev-guard scan-skills [paths...] Sweep skills/plugins/rules/CLAUDE.md files (default: every agent's user dirs + this project)
jev-guard install claude | codex | copilot | gemini | agy | cursor | pi | opencode
jev-guard key Save the key to ~/.jev-guard/config.json
```
`check` and `scan` are handy in CI and for calibrating thresholds against your own examples.
## Development
```bash
npm test # node:test with a fake Jev; also spins up the ACP proxy against a fake agent
```
The launch video is a [Remotion](https://www.remotion.dev/) composition in `video/`: `cd video && npm i && npm run render` → `assets/launch.mp4`. The narration is generated from `video/vo.json` with `npm run vo` (edge-tts via `uvx`, no key), one clip per scene; scene lengths and the typing cues in `src/Launch.tsx` are timed to those clips.
Layout: `src/jev.js` (one fetch, two backends) · `src/guard.js` (questions + policy) · `src/context.js` + `src/session.js` (what Jev gets to see) · `src/skills.js` (instruction-file sweep) · `src/hook.js` (Claude Code / Codex / Copilot / agy / Gemini / Cursor) · `src/acp.js` (proxy) · `src/opencode.js` (OpenCode plugin) · `extensions/jev-guard.ts` (pi) · `hooks/` (plugin hook manifests).
Verified end to end against the live API: Claude Code (`--plugin-dir`, headless) and OpenCode (`opencode run`, a `wrangler deploy --env production` came back as `jev-guard blocked this call`). Codex, Copilot CLI, Gemini CLI and Cursor are exercised at the payload level with their documented stdin/stdout shapes.
## Security and privacy
Only the tool call (name, arguments, cwd) or the tool result is sent to Jev, directly over TLS to `api.typesafe.ai` or `ai-gateway.vercel.sh` (with zero data retention requested). Nothing is stored or logged by jev-guard. Tool results can contain anything your agent just read, so review [TypeSafe's privacy policy](https://typesafe.ai/privacy) before pointing this at sensitive repositories.
jev-guard is a guardrail, not a sandbox: a hook can be misconfigured, an agent can bypass a tool path, Jev can be wrong. Keep your other controls.
## License
MIT