cd /news/ai-agents/a-space-to-test-what-a-coding-agent-… · home › topics › ai-agents › article
[ARTICLE · art-155875] src=discuss.huggingface.co ↗ pub= topic=ai-agents verified=true sentiment=↑ positive

A Space to test what a coding-agent guardrail says about a shell command

A developer built a Hugging Face Space that lets users paste a shell command an AI coding agent might run and see whether the laya-guard guardrail returns allow, review or block, plus which step made the decision. The guard is laya-guard (MIT licensed), a free local guardrail that judges every tool_call on-device using regex plus Laya and provides hooks for Claude Code, Codex, Cursor, Gemini CLI and 7 more agents. The Space runs a small CPU model via gr.Server (a FastAPI subclass) with GET / and POST /api/judge routes, uses preload_from_hub to fetch model files at build time, and relies on an unused @spaces.GPU function so a free account can host it now that CPU Basic requires PRO.

read1 min views3 publishedOct 23, 2026

Hi all! I made a small Space where you can paste a shell command an AI coding agent might run and see what a guardrail would answer before it runs: allow, review (ask the user) or block, and which step decided it.

How it’s built, in case it’s useful to anyone doing the same:

@spaces.GPU function to exist, so there’s one that is never called and visitors’ GPU quota isn’t touched. That’s how a free account can host a small CPU model now that CPU Basic needs PRO.gr.Server (a FastAPI subclass): GET /, POST /api/judge. GRADIO_SSR_MODE=false is needed for the custom / route.preload_from_hub pulls the model files at build time, so a woken Space doesn’t download them. The guard itself is laya-guard (MIT), hooks for Claude Code, Codex, Cursor, Gemini CLI and 7 more agents: GitHub - scs0209/laya-guard: Free local guardrail for AI coding agents: every tool_call judged on-device (regex + Laya), allow/review/block · GitHub

Feedback welcome, especially commands it gets wrong.

── more in #ai-agents 4 stories · sorted by recency
── more on @laya-guard 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
→ Live at https://your-agent.zahid.host ✓
Get free account → Pricing
from €0/mo · no card required
LIVE [news/a-space-to-test-what…] indexed:0 read:1min 2026-10-23 · —