A free web demo shows whether an AI coding guardrail would allow or block a shell command
A Hugging Face forum post shares a demo where you paste a command and see if a guardrail would allow it, ask you first, or block it.
The short version
- Paste a shell command and see one of three answers: allow, review (ask the user) or block
- The page also shows which step in the guard made the decision
- The model, Laya (~322M), runs on CPU at about 0.1–0.3 s per call
- Input is capped at 4,000 chars, with 20 requests/min per visitor; nothing is logged
- The guard behind it, laya-guard, is MIT-licensed with hooks for Claude Code, Codex, Cursor, Gemini CLI and 7 more agents
Why it matters
If you let an AI tool run commands on your computer, the question is what stands between a bad command and your files. A demo like this lets you see how one check behaves before you trust it. It also shows that a useful guardrail can be small and cheap enough to run on your own machine.
What the Space does
As discuss.huggingface.co reported, a developer has published a Space, which is a small hosted demo app on Hugging Face. You paste in a shell command, the kind of text instruction an AI coding agent might run on a computer, and the page tells you what a guardrail would say before the command executes.
There are three possible answers: allow, review (which means ask the user), or block. The page also says which step in the process made the call.
The guard behind it
The demo is a front end for laya-guard, a free, MIT-licensed tool that runs locally. According to the post, it judges every tool call on the device using a mix of regex (simple pattern matching) and Laya, a small AI model of about 322M parameters.
The project lists hooks for Claude Code, Codex, Cursor and Gemini CLI, plus 7 more agents. A hook is a point where the guard can step in before the agent acts.
How the demo is hosted
The author shared build notes for others doing the same. The model runs on a CPU at roughly 0.1–0.3 seconds per call. The Space is set up as a ZeroGPU Space, which normally gives visitors GPU time, but it includes one GPU function that is never called, so no visitor's GPU quota is used.
The author says this lets a free account host a small CPU model, since the CPU Basic tier now requires PRO. Model files are downloaded when the Space is built, so a Space that wakes up does not have to fetch them.
Limits and privacy
The demo caps input at 4,000 characters and a 32 KB request body. It allows 20 requests per minute per visitor and 300 per minute overall. The author says nothing is logged.
The author asks for feedback, especially examples of commands the guard gets wrong. That is the most useful way to test it: its quality is not independently measured in the post.
What to watch
- How often does the guard misjudge commands, as users report them?
- Will more coding agents and tools adopt local guardrails like this?
Try it
Try a few harmless commands and a few clearly risky ones to see how the guard sorts them. Never paste passwords, keys or private file paths into a public demo.
Sources and links
Liked it? Say why
Add a line for other readers.
No account needed. We never show your email. Comments with links, ads or abuse are held and not shown. Your comment shows after a quick check.
Listen to the AI Wire headlines
Listen to the AI WireListen to our daily AI shows every morning: on your commute, in the shower, wherever you are
Listen to the daily showsFirst reported by discuss.huggingface.co · Read the original. Written by the SI Agent News Desk from the reporting above.Written with AI from the source above. Every number is checked against the source. Spot a mistake? Corrections.
