What is laya-guard?
Laya-guard checks commands proposed by AI coding agents before they run, then allows them, holds them for review, or blocks them. It combines regex rules with a small multilingual model that runs on the user's machine, without requiring an API key. It is aimed at developers who want a local safety layer for coding agents on macOS or Linux, and includes hooks for 11 agents plus a localhost dashboard.
laya-guard Features:
Command Verdicts: Each proposed command receives an allow, review, or block verdict, along with the policy and reason behind it.
Chain Inspection: The guard splits command chains such as commands joined with && or ;, judges each part, and applies the most restrictive verdict.
Local Judging: Regex rules handle known patterns, while a roughly 322-million-parameter multilingual model judges other commands on the local CPU.
Agent Hooks: Install hooks for 11 supported coding agents, with a settings diff shown and a backup made before changes are written.
Protected Files: An opt-in Claude Code hook checks file tools against protected paths such as credential stores, environment files, private keys, and shell startup files.
Activity Dashboard: The localhost dashboard displays verdicts, recent calls, policies, reasons, and timings without storing command text.
laya-guard Benefits:
Reduced Exposure: Checking commands before execution helps prevent an agent from reading credentials or running destructive commands without your oversight.
Private Review: Because judgments run locally and verdict logs omit command text, sensitive commands need not be sent to an external judging service.
Fewer Interruptions: Safe commands and known rule matches can be handled immediately, leaving your attention for actions that need review.
Clear Decisions: Seeing the policy and reason for a verdict makes it easier to understand why an action was allowed, held, or blocked.
Offline Resilience: When the local server is unavailable, hooks can still apply regex checks and send uncertain actions to you or block them when review is unavailable.
Use Cases:
Credential Protection: Use the guard when an agent may inspect private keys, environment files, credential stores, or other sensitive local files.
Command Safety: Put it in front of coding-agent commands that could download and run scripts, delete files, or expose secrets.
Agent Rollout: Install hooks as you introduce Claude Code, Codex CLI, Cursor, or another supported coding agent to a development machine.
Session Review: Audit recent Claude Code or Codex sessions to see which commands the guard would have held before installing a hook.
File Access Review: Record paths named by agent tool calls, then use the footprint summary to identify project files that may merit protection.

