Poisoned Invoice Audit (Hijack vs Blocked)
- 1 · Input Prompt Ready
- 2 · Gate 1 Ingress Shield Armed
- 3 · Brain Thought Idle
- 4 · Action Tool JSON Idle
- 5 · Exec Sandbox 0 Net
- 6 · Gate 2 Tool Shield Armed
- 7 · Output Answer Idle
Standalone App & PWA
Install Tool-Calling Agent & Prompt-Injection Sandbox from its dedicated origin as an
offline PWA with OS .txt, .md, and .json
file_handlers and zero camera, microphone, or geolocation permissions.
Indirect Invoice Injection preset loaded. Run the agent with Shield ON vs Shield OFF to watch real dual-gate local defense.
Dual-gate Horizon Prompt Injection Guard (302.8 MB q8 on shared 3.7.5 CPU WASM) paired with Qwen3.5-0.8B (666.1 MB q4f16 on worker-isolated Transformers.js 4.3.2 WebGPU) for full multi-step tool calling, plus MNN-Pocket-0.3B (368.5 MB int8 on shared 3.7.5 CPU WASM) for live Gate 1 Shield + CPU fallback generation.
Dual-Gate Shield · Horizon Prompt Injection Guard Small (302.8 MB q8 · Apache-2.0)
Horizon-Labs/prompt-injection-guard-small · ModernBERT 141M (rev 8fcf1ab) ·
shared ../../lib/webai.js (3.7.5) CPU WASM
WebGPU Primary Brain · Qwen3.5-0.8B (666.1 MB q4f16 · Apache-2.0)
onnx-community/Qwen3.5-0.8B-ONNX · isolated Transformers.js 4.3.2 inside
agent-webgpu-worker.js only · WebGPU required
Universal CPU Fallback Brain · Alibaba MNN-Pocket-0.3B (368.5 MB int8 · Apache-2.0)
onnx-community/MNN-Pocket-0.3B-ONNX · shared ../../lib/webai.js (3.7.5) CPU
WASM int8 (~51 tok/s) — automatic CPU fallback for Gate 1 Shield + local generation on
--disable-gpu devices (0.3B rarely emits structured JSON tool calls; unexecuted tools are
honestly flagged UNGROUNDED)
Tool-calling agents fail in two places: direct jailbreaks in the user prompt (Gate 1) and indirect prompt injections smuggled inside retrieved documents, invoices, or ticket notes (Gate 2). Running a dedicated ModernBERT injection classifier at both boundaries keeps the reasoning LLM grounded in verified tool data without sending a single byte off-device.
Horizon-Labs/prompt-injection-guard-small (Apache-2.0, ModernBERT 141M, 302.8 MB
q8 on shared Transformers.js 3.7.5 CPU WASM) scores the incoming prompt before LLM prefill
and inspects every line returned by sandbox tools. Flagged indirect injections inside
INV-2026-409 are quarantined before the observation enters the next model turn.
On WebGPU browsers, onnx-community/Qwen3.5-0.8B-ONNX (666.1 MB q4f16, isolated
Transformers.js 4.3.2 in agent-webgpu-worker.js) drives ~60 tok/s multi-step JSON tool calls
and Gate 2 indirect-injection defense. On CPU-only browsers, onnx-community/MNN-Pocket-0.3B-ONNX
(368.5 MB int8 on shared 3.7.5 WASM) runs live alongside Gate 1 Horizon Shield (~51 tok/s),
honestly flagging UNGROUNDED whenever the 0.3B model skips structured tool JSON.
Every tool executes deterministically in memory: calc() runs a recursive-descent parser with
zero eval, lookup_invoice() reads a frozen local vault,
unit_convert() converts length/mass/temp/data/speed/time cleanly, and
regex_extract() rejects nested ReDoS quantifiers before constructing any RegExp.