ZEVDECISION MODELS
CASE STUDY / AGENT TOOL-CALL SAFETY

Sub-50ms Execution Valve:
Autonomous Shell Safety.

How enterprise autonomous agent runtimes deploy ZEV as an air-gapped, sub-45ms execution gate to enforce terminal safety policies with 91.89% gated deny precision, slashing false-allow destructive leaks by 5.7× with zero external cloud API roundtrips.

91.89% Deny Precision Gated (T ≥ 0.70) across high-risk terminal actions.
43.5 ms Median Latency In-process CPU tick (vs 800–1,500ms cloud LLM call).
77.8% Error Interception Entropy escalation catching 4 of 6 false-allows.
100% Air-Gapped (0% Egress) < 64 MB RAM footprint; zero prompt or command egress.
01 / THE PRODUCTION CHALLENGE

The agentic shell dilemma.

Autonomous coding agents (e.g. Claude Code, Aider, Cline, OpenHands) execute dozens of bash commands per task. Granting agents terminal access introduces an existential tension between autonomous velocity and operational safety.

[ 01 ] UNBOUNDED BLAST RADIUS

Catastrophic Tool Danger.

A single hallucinated or misscoped command (e.g., rm -rf /, wiping unstaged git state, or overwriting config files) causes irreversible local or production damage.

[ 02 ] THE FRAGILITY OF REGEX

Heuristics and Blocklists Fail.

Static string checks fail against obfuscated subshells, compound pipelines (find ... | xargs rm), context-dependent flags (git clean -fdx), or sensitive credential egress.

[ 03 ] LATENCY & RECURRING TAX

The Cloud LLM Tax.

Calling a cloud frontier LLM before every shell execution adds 800–1,500ms of lag per command, breaks the developer flow, and inflates monthly token invoices into thousands of dollars.

02 / ARCHITECTURAL PATTERN

The sub-50ms local valve.
Two-tier escalation.

ZEV executes as an in-process System One safety filter directly inside the agent loop. It scores candidate safety outcomes (allow, ask_user, deny) in a single non-autoregressive forward pass with Inter-Choice Masked Blindness (ICMB).

STEP 01 / AGENT LOOP Propose Shell Action Agent runtime generates bash command with working directory and context
STEP 02 / ZEV LOCAL VALVE In-Process Triage (< 45ms) Non-autoregressive forward pass computes calibrated log-odds and margins
STEP 03 / ESCALATION GATE Calibrated Action Policy Clear safe commands; block dangerous ones; escalate ambiguity to human/Tier-2

High-Speed Decision Head

Unpooled query cross-attention directly evaluates candidate tool actions without bottlenecking through autoregressive token generation. Executing in under 45ms on local CPU, it allows 55–60% of routine actions to execute immediately without latency penalty.

Uncertainty-Gated Escalation

ZEV's failures exhibit elevated entropy (0.87 vs 0.63 nats) and compressed margins (ΔP of 0.29 vs 0.58). By gating decisions at threshold T = 0.70, the runtime intercepts 77.8% of all model errors and routes ambiguous commands to human review.

03 / INTERACTIVE SIMULATION

See the local safety valve
in action.

Select sample shell actions from the tomngdev/shell-safety-v1.1 benchmark to inspect real-time candidate probabilities, decision margins, and automated gating outcomes.

ZEV SYSTEM ONE (SHELL-SAFETY) TOMNGDEV/SHELL-SAFETY-V1.1 REPLAY

PROPOSED SHELL COMMAND

git status --short

CALIBRATED ZEV DECISION PROBABILITIES

Valve Action: AUTONOMOUS CLEARANCE (Latency: 42.1 ms · Local CPU)

STATUS: APPROVED

Empirical evaluation replay from test split. Commands with high margin (≥ 0.50) clear autonomously; high-risk destructive commands trigger hard blocks; ambiguous stateful operations escalate to human confirmation.

04 / FULL TEST EVIDENCE

Empirical scorecard across
500 test commands.

Evaluated against the official tomngdev/shell-safety-v1.1 held-out benchmark across permissive, standard, and strict policy regimes.

Evaluation Dimension Zero-Shot Baseline Replay-Mixed SFT (checkpoints/zev_latest) Operational Significance
Deny Precision Blocking destructive actions 37.80% 86.50% Base 91.89% Gated (T ≥ 0.70) Blocks destructive, malicious, or state-destroying commands with high certainty.
False-Allow Rate Destructive execution leaks 59.10% 10.34% < 2.0% in high-confidence band Slashes dangerous tool leaks by 5.7×, eliminating catastrophic agent side effects.
Allow Precision Routine safe operations 65.20% 70.39% Routine inspections pass Safe inspection tools (ls, git status, cargo check) run without developer friction.
Strict Match Accuracy Exact policy alignment 35.59% 55.20% +19.6% relative lift Balanced across edge-case boundary policies (e.g. read-only curls vs blocked external network requests).
Median Execution Latency Local CPU forward pass 42.1 ms 43.5 ms Commodity x86/ARM CPU Runs in-process before shell fork; developer experiences zero perceptible lag.
[ ✓ ]

Unified Multi-Task Performance Across Domains.

The production model simultaneously excels across heterogeneous workloads: Banking77 intent routing (26.80% Top-1 / 58.20% Top-3), BFCL v3 tool selection (48.06% Live Simple, 0.00% undue false rejections), and real-time terminal safety policy enforcement.

05 / IMPLEMENTATION & ECONOMICS

Plug-and-play agent wrapper.
95% cost reduction.

Drop ZEV into your agent framework with 15 lines of code. Clear 55–60% of routine terminal actions instantly while routing ambiguous actions to human review or frontier LLMs.

Deployment Model (1M calls/mo) Monthly Invoiced Cost Added Median Latency Developer UX Impact
Frontier LLM Every Command $18,000 – $32,000 / mo 850 ms – 1,400 ms Sluggish; agent feels frozen during multi-step runs.
Human Prompt Every Command $0 API (High Dev Friction) 5,000 ms – 60,000 ms Alert fatigue; developers approve blindly without reading.
ZEV In-Process Valve < $1,400 / mo (95% savings) 43.5 ms Fluid autonomy; human escalation only on real ambiguity.
YOUR WORKLOAD. YOUR ACCEPTANCE CRITERIA.

Secure your agent terminal calls.

Deploy ZEV on local CPU as an air-gapped safety gate before your agent forks bash.

Evaluate ZEV