jev-tool-permissions
Vercel AI SDK layer that uses Jev to auto-approve, ask a human or block each tool call, and to prune irrelevant tools before a turn.
Overview
jev-tool-permissions adds two jobs to agents built on the Vercel AI SDK, using Jev through the Vercel AI Gateway. The pre-flight approval gate decides auto-approve, ask-human or block before a tool call executes; when no deterministic allow or deny rule decides first, it asks Jev three questions in one round trip: is the call reversible, is it in scope (both booleans), and how risky is it on a five-level score. Risk at or above the block threshold blocks; a combined safety score above the auto-approve threshold (default 0.95) passes; everything in between asks a human.
Tool-list pruning asks one relevance yes/no per tool not decided by a rule and drops those below a deliberately low keep threshold of 0.2, saving context when agents carry 50 to 200 MCP tool definitions. Both are fail-closed: on error or timeout the gate defaults to ask-human. The README argues an LLM judge is too slow and costly for the hot path of every tool call. The package has no runtime dependencies beyond the ai peer dependency.
What the decision model decides
| Type | Question | Answers |
|---|---|---|
| Yes / no | Is this tool call reversible? | — |
| Yes / no | Is this tool call in scope for the task? | — |
| Score | How risky is this tool call (5 levels)? | — |
| Yes / no | Is this tool relevant to the current task? | — |
How it works
- Deterministic allow/deny rules run first without the model
- Remaining calls get three Jev questions in one evaluate() call
- Block if risk >= threshold; auto-approve if safety >= 0.95; otherwise ask a human
- Separately, prune tools with relevance below 0.2 before each turn
Strengths
- Fail-closed: errors default to ask-human
- Asymmetric thresholds tuned to the cost of each mistake
- Prunes unused tool definitions to save context
- No extra runtime dependencies
Caveats
- Depends on the AI SDK's experimental evaluate API and Vercel AI Gateway
- Thresholds need per-application tuning
Getting started
npm install jev-tool-permissions aiAt a glance
- Type
- Library
- Status
- beta
- Language
- TypeScript
- Runtime
- Node (Vercel AI SDK)
- Has code
- yes
Use cases and integrations
How curated lists describe it
Adds tool-call approval and tool-list pruning to the Vercel AI SDK.
logicrw/awesome-jev-projects
Frequently asked questions
What happens if Jev fails?
The approval gate defaults to ask-human, never auto-approve.
Why not use an LLM judge?
The README argues it is too slow and expensive for a check that runs on every tool call.
How does pruning save tokens?
It drops tool definitions judged irrelevant to the task before each turn.
Related projects
Two stdlib-only Hermes Agent plugins: a Jev pre-tool gate with a jev_ask tool, and a skill router that names one skill per turn.
Agent skillbetaPythonClaude Code kit wiring Jev into a tool-call guard, sub-agent sizing, file search, a browser agent, review, belay and compaction.
ProjectbetaPythonDiscontinued DeepSeek Harness decision layer whose policies let Jev only narrow permissions and fail closed; successor is jevcore.
ProjectprototypeTypeScriptComposio agent SDK with an optional TypeSafe provider that uses Jev to shortlist and pick tools and closed-set arguments.
ProjectproductionTypeScriptDeepSeek Harness plugin with 12 opt-in Jev or Luna Decisions judgments: skill and file selection, supervision, filtering and approval help.
PluginbetaTypeScriptClaude Code hook that decides which agent or skill should handle a request using YAML rulebooks plus one Jev Choice with confidence bands.
HookbetaPython