Repository: github.com/drtikov/microbrainsforagents
When an autonomous AI agent writes code, edits files, or runs commands in your terminal, it works blindly. If the generated code contains a typo, a syntax error, a leaked API key, or a dangerous command, the agent tries to execute it anyway. This breaks your environment, wastes 30–60 seconds, and burns money on extra LLM turns just to read the traceback and retry.
Aetheris Microbrains is an ultra-fast (< 2 ms) local coprocessor written in pure NumPy that runs on your local CPU and stands directly between the LLM's plan and actual execution on your machine.
It acts like an instant pre-flight security check:
text [ AI Agent / LLM ]
│ Generates code diff, tool call, or shell command
▼
⚡ [ Aetheris Microbrains ] ── (< 2 ms local CPU pre-flight gate)
├── 🛑 Broken syntax, leaked secrets, or "rm -rf"?
│ ↳ Instant local veto. Zero cloud tokens wasted on retries.
├── 🔍 Ambiguous, dangerous, or uninspected action?
│ ↳ Safe escalation to the user (returns "ask").
└── ✅ Verified safe?
↳ Allowed to run.
Why Use It?
Cuts API Bills & Saves Tokens:
- Smart Tool Pruning (Top-K Narrowing): Passing definitions for 30+ tools in every single prompt turn burns thousands of redundant tokens. Microbrains narrows the catalog down to the 4 most relevant tools for the current step, saving up to 39% of schema tokens while keeping the tool the agent actually needs 97–99% of the time.
- Zero Paid Retries for Typos: Syntax errors and missing brackets are intercepted locally in 1.3 ms before reaching remote models or runtime containers.
Guards Your Machine & Credentials:
- Protects sensitive environment files (
.env*, .ssh/, .git/hooks/, credentials). - Blocks destructive terminal commands (
rm -rf, curl | sh, DROP DATABASE). - Catches obfuscated code injection (
eval, exec, base64 execution, dynamic getattr).
Built for Claude Code, Codex, and Agent Frameworks:
- Ships with a ready-to-use CLI hook (
python -m aetheris_microbrains.hook) conforming directly to Claude Code's official hookSpecificOutput (PreToolUse) standard.
Why Microbrains Are Particularly Useful in OpenClaw
OpenClaw is a persistent personal AI assistant running locally on your computer to orchestrate workflows, terminal commands, messaging apps, scripts, and browsers. In an autonomous environment like OpenClaw, the risks of unchecked execution are amplified, making Microbrains a natural fit:
1. Protection Against Accidental "Self-Destruction" on Host Machines
Because OpenClaw operates directly on your operating system with terminal and file access, a single hallucination in command flags (like a flawed rm path or an unverified script with shell=True) can delete user files or corrupt configurations.
- In OpenClaw: Microbrains acts as an uncompromising Layer 0/1 gatekeeper. Any destructive shell command or attempt to touch
.env / .ssh is immediately blocked or routed to the user for explicit confirmation (ask).
2. Lower Latency & Costs in Always-On Background Runs
OpenClaw is designed to run persistently and respond to background events, chat messages, and scheduled tasks. Feeding a large LLM full JSON schemas for every installed tool, integration, and MCP server on every micro-turn becomes very expensive and slow.
- In OpenClaw: Microbrains dynamically trims the tool surface before prompt construction (
narrow_tool_surface), shrinking per-step token load by 30–40% and noticeably reducing Time-to-First-Token (TTFT).
3. Honest Escalation for Third-Party & MCP Tools
A common flaw in security plugins is a binary mindset: either blindly allow everything or paranoidly block normal work.
- In OpenClaw: When OpenClaw invokes an uninspected third-party MCP tool (like sending an external webhook, messaging, or cloud deployment) without diff or shell context, Microbrains does not blindly auto-approve it. Instead, it returns
escalate (in hook mode: permissionDecision: "ask"). OpenClaw can simply confirm with the user before executing.
4. Zero Lag & Zero GPU Overhead
Microbrains doesn't require launching a heavy local neural network or reserving GPU VRAM. It is pure Python/NumPy, consumes negligible memory, and evaluates decisions in 1 to 2 milliseconds—meaning zero noticeable overhead for your local assistant.Repository: github.com/drtikov/microbrainsforagentsWhat Is It in Plain English?
When an autonomous AI agent writes code, edits files, or runs commands in your terminal, it works blindly. If the generated code contains a typo, a syntax error, a leaked API key, or a dangerous command, the agent tries to execute it anyway. This breaks your environment, wastes 30–60 seconds, and burns money on extra LLM turns just to read the traceback and retry.Aetheris Microbrains is an ultra-fast (< 2 ms) local coprocessor written in pure NumPy that runs on your local CPU and stands directly between the LLM's plan and actual execution on your machine.It acts like an instant pre-flight security check:text
[ AI Agent / LLM ]
│ Generates code diff, tool call, or shell command
▼
⚡ [ Aetheris Microbrains ] ── (< 2 ms local CPU pre-flight gate)
├── 🛑 Broken syntax, leaked secrets, or "rm -rf"?
│ ↳ Instant local veto. Zero cloud tokens wasted on retries.
├── 🔍 Ambiguous, dangerous, or uninspected action?
│ ↳ Safe escalation to the user (returns "ask").
└── ✅ Verified safe?
↳ Allowed to run.Why Use It?
Cuts API Bills & Saves Tokens:
Smart Tool Pruning (Top-K Narrowing): Passing definitions for 30+ tools in every single prompt turn burns thousands of redundant tokens. Microbrains narrows the catalog down to the 4 most relevant tools for the current step, saving up to 39% of schema tokens while keeping the tool the agent actually needs 97–99% of the time.
Zero Paid Retries for Typos: Syntax errors and missing brackets are intercepted locally in 1.3 ms before reaching remote models or runtime containers.
Guards Your Machine & Credentials:
Protects sensitive environment files (.env*, .ssh/, .git/hooks/, credentials).
Blocks destructive terminal commands (rm -rf, curl | sh, DROP DATABASE).
Catches obfuscated code injection (eval, exec, base64 execution, dynamic getattr).
Built for Claude Code, Codex, and Agent Frameworks:
Ships with a ready-to-use CLI hook (python -m aetheris_microbrains.hook) conforming directly to Claude Code's official hookSpecificOutput (PreToolUse) standard.
Why Microbrains Are Particularly Useful in OpenClawOpenClaw is a persistent personal AI assistant running locally on your computer to orchestrate workflows, terminal commands, messaging apps, scripts, and browsers. In an autonomous environment like OpenClaw, the risks of unchecked execution are amplified, making Microbrains a natural fit:1. Protection Against Accidental "Self-Destruction" on Host Machines
Because OpenClaw operates directly on your operating system with terminal and file access, a single hallucination in command flags (like a flawed rm path or an unverified script with shell=True) can delete user files or corrupt configurations.
In OpenClaw: Microbrains acts as an uncompromising Layer 0/1 gatekeeper. Any destructive shell command or attempt to touch .env / .ssh is immediately blocked or routed to the user for explicit confirmation (ask).2. Lower Latency & Costs in Always-On Background Runs
OpenClaw is designed to run persistently and respond to background events, chat messages, and scheduled tasks. Feeding a large LLM full JSON schemas for every installed tool, integration, and MCP server on every micro-turn becomes very expensive and slow.
In OpenClaw: Microbrains dynamically trims the tool surface before prompt construction (narrow_tool_surface), shrinking per-step token load by 30–40% and noticeably reducing Time-to-First-Token (TTFT).3. Honest Escalation for Third-Party & MCP Tools
A common flaw in security plugins is a binary mindset: either blindly allow everything or paranoidly block normal work.
In OpenClaw: When OpenClaw invokes an uninspected third-party MCP tool (like sending an external webhook, messaging, or cloud deployment) without diff or shell context, Microbrains does not blindly auto-approve it. Instead, it returns escalate (in hook mode: permissionDecision: "ask"). OpenClaw can simply confirm with the user before executing.4. Zero Lag & Zero GPU Overhead
Microbrains doesn't require launching a heavy local neural network or reserving GPU VRAM. It is pure Python/NumPy, consumes negligible memory, and evaluates decisions in 1 to 2 milliseconds—meaning zero noticeable overhead for your local assistant.