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
- Synthesia launches Syren Video: prompt-to-video agent powered by Opus 5.5, free to try — heyshrutimishra · 2026-10-11
- Codex lead jokes 'the day we reach perfection it will be resets from there onwards' — xiaohu · 2026-10-11
- One MCP server for X, Instagram, WhatsApp, Telegram and Gmail with per-action approvals — gauthi3r_XBorg · 2026-10-11
- Dev ports Sega MegaDrive game natively in under a day with single Codex/Claude session — ssh4net · 2026-10-11
- Grok Bot Negotiated His Internet Bill Down $15/Month Over Live Chat — jarrodwatts · 2026-10-11
- banteg surprised Codex cloud auto-configures its environment just by reading the repo — banteg · 2026-10-11