← Back to archive

Repo of the Day

drtikov/microbrainsforagents

Published: Nov 28, 2026

Open repository ↗

Sub-2ms CPU safety shield & smart tool router for AI agents (Claude Code, MCP). Stops bugs, destructive shell commands, and leaked secrets before execution—saving tokens, money, and your machine

Summary

Aetheris Microbrains (repo microbrainsforagents, pip package aetheris-microbrains) is a deterministic pre-flight policy engine and tool router that sits in front of an AI coding agent's tool calls. Running on CPU, it inspects diffs, shell commands, and MCP traffic and returns one of three verdicts — allow, ask the human, or deny — before the action executes. The README positions it as a safety shield for agents such as Claude Code, Cursor, Codex, Cline, and OpenHands.

What it is useful for

Cases documented in the README:

  • Flagging syntax mistakes in edits before they turn into failing test runs and wasted retry turns.
  • Blocking destructive shell commands such as rm -rf /, dd, and curl | sh.
  • Stopping hardcoded API keys from being written into source, guarding .env and .ssh/, and scrubbing secrets out of tool outputs.
  • Pausing on unfamiliar commands or sensitive reads with a LOW/MEDIUM/HIGH risk level and a plain-language reason, failing closed on timeout.
  • Auditing MCP servers for tool-schema poisoning: aetheris doctor --scan-mcp inspects .mcp.json servers and tool manifests.
  • CI: aetheris pr-gate --base main --format sarif runs a pre-merge diff gate and emits SARIF.
  • Acting as an MCP gateway that narrows the tool surface per turn and brokers $SECRET:<NAME> handles out-of-band, keeping secrets out of model context.

Integration depth differs per host: Claude Code, Google Antigravity, Hermes Agent, and OpenClaw are listed as "Full E2E Tested", while Cursor, Devin, Cline, Qoder, Qwen, OpenCode, Kilo Code, Pi, and OMP are "Hook & Installer Tested" or "Config & Contract Tested".

How engineers can use it

Installation is documented in the README:

git clone https://github.com/drtikov/microbrainsforagents.git
cd microbrainsforagents
pip install -e .

Then install the gate for your agent, for example aetheris install cursor --profile guardrails (add --shadow first to log decisions without blocking), or for Claude Code run python .claude/skills/microbrains/install_hook.py. That installer also supports --preset solo-dev|ci|paranoid, --dry-run, --self-test, and --remove.

For Python-based agents, call the API directly — mb.decide(...) for a verdict, and mb.narrow_tool_surface(...) for orchestrators such as LangGraph, CrewAI, or AutoGen. Verify an install with aetheris doctor --scan-mcp and aetheris verify-core, which checks that the security core stays on pure stdlib. Optional extras: pip install -e ".[mcp,ast]" adds MCP tools and tree-sitter polyglot AST grammars; ".[server,guard-ml]" adds a FastAPI worker and ONNX semantic guard.

Limitations worth knowing: the README notes Python subprocess cold start of roughly 200–500 ms, so use --auto-daemon, the native Rust shim, or the HTTP hook mode for warm sub-millisecond checks. Escalations fail closed on timeout, so unrecognized commands can stall work. Token and turn savings in the README's benchmark are modeled estimates rather than measured spend, and the README's scope, threat model, and alternatives sections set out where this approach fits.