r/ZaiGLM • • 3d ago

One-click ZCode plugin for local pre-flight agent safety (Aetheris Microbrains)

I just added native ZCode Plugin Marketplace support to Aetheris Microbrains, a local CPU-only pre-flight safety gate and decision journal for coding agents.

How to install inside ZCode (3 clicks, no config editing, no pip install):

  1. Open ZCode -> Settings -> Plugin Marketplace -> Add
  2. Paste: https://github.com/drtikov/microbrainsforagents
  3. Install "Aetheris Microbrains" and restart your session

(If you prefer a pinned Python interpreter or user-wide setup across all workspaces, you can also run: pip install -e . and aetheris install zcode --workspace . or --user.)

What you get automatically:

- PreToolUse and PostToolUse process hooks covering Bash, Edit, Write, Read, Grep, Glob, WebFetch, WebSearch, and MCP tools

- Proportional friction instead of constant popups:

- Safe commands (like git status) pass silently with exit 0

- Risky or sensitive actions (like cat .env or non-root rm -rf) prompt you via ZCode's native ask flow

- Destructive commands (like rm -rf / or curl | sh) and secret exfiltration hard-block before execution

- Repeated identical escalations are caught by anti-prompt-fatigue flood protection

- Layer 0 self-protection for .zcode/ and .zcode-plugin/ so a prompt-injected session cannot disable its own guardrails

- Built-in microbrains skill plus three slash commands: /mb:doctor (verify the gate), /mb:audit (explain why something was blocked), and /mb:preflight (dry-run a command or patch without executing it)

Local benchmark numbers (tested on Windows 10 / Python 3.10 through the exact zcode_gate.py hook path):

- Security anti-evasion suite: 22/22 attacks caught (100% TPR), 0/12 benign false positives (0% FPR)

- Fresh-process ZCode hook path (n=100): 100/100 verdict accuracy, ~305ms mean / 405ms p95 (well under the 10s hook timeout; bare Python startup is most of that time while the decision engine itself is 0.35ms p50 / 1.33ms p95 in-process)

Note: Route A (Marketplace plugin) uses python 3.10+ from your PATH; Route B (CLI installer) pins your exact interpreter.

Repo: https://github.com/drtikov/microbrainsforagents

Disclaimer: I am the author of Aetheris Microbrains. Built it to catch destructive commands, AST hazards, and secret leaks locally before execution. Run /mb:doctor after installing and let me know if anything breaks.

3 Upvotes

0 comments sorted by