Dev builds laya-guard: a 322M local model vets every coding agent command in ~90ms on CPU
Extreme_Ad5709 · reddit · 2026-10-11
A Reddit user open-sourced laya-guard, which uses a 322M-parameter local model (Apache-2.0) to review each shell command from coding agents before execution — no paid API needed.
- How it works: regex policies first catch known-dangerous patterns (rm -rf /, curl … | sh, secrets, auth bypass); trivial commands like ls, git status, npm test skip the model unless they involve piping, chaining, redirection, -exec-style flags or sensitive paths; everything else is judged by the model on CPU in 85–90ms with an allow/review/block verdict.
- Self-reported results: blocks 25 of 27 attacks on AgentDojo v1 (judge-level) while keeping 92 of 97 benign tasks; scores 48/50 on a custom 50-command shell set.
- Caveats: training data is mostly Korean, so English natural-language commands get overblocked; hooks fail open if the server is down.
- Ships with hooks for Claude Code, Codex CLI, Cursor, Gemini CLI, Copilot CLI and 6 more agents; install via pip install laya-guardrail.
Related event: Open-Source laya-guard Screens Coding Agent Commands Locally(2 posts)→
More from coding & agent
- NVIDIA's GTC talk breaks down coding agent anatomy and where security fits in — nvidia · 2026-12-02
- One prompt, agents auto-produce a trending song video in 2h41m — then fix their own pipeline — tetsuoai · 2026-12-02
- Dev ports GTA 6 to Apple Metal on M1 Pro with Gemini's help, hits 10 FPS — oyacaro · 2026-12-02
- Why a single passing agent test is mathematically meaningless — abenko83 · 2026-12-02
- Wayfindr: open-source local MCP gateway with built-in credential governance — whatisbread_ · 2026-12-02
- auto-optimize speeds up GPN-Star variant-effect scoring by 1.87x-3.80x in open PR — jmschreiber91 · 2026-12-02