
microbrainsforagents
Sub-2ms CPU safety shield & smart tool router for AI agents (Claude Code, MCP). Stops bugs, destructive shell commands, and leaked secrets before execution—s…
Install with your AI
Paste into Claude Code, Cursor, or any agent — it reads the repo and wires the tool into your project.
Install and set up microbrainsforagents (git-clone project) into my current project. Found on https://claudeers.com/microbrainsforagents Repo: https://github.com/drtikov/microbrainsforagents Homepage/docs: — Detected install method: git-clone → git clone https://github.com/drtikov/microbrainsforagents Category: automation. Platforms: cli, api, desktop, web, mobile. Read the repo's README for exact setup and env vars, then install it and wire it into my project. Claudeers Health Verdict: unknown; community-verified: false. Confirm the source before running anything.
git clone https://github.com/drtikov/microbrainsforagents
// compatibility
| Platforms | cli, api, desktop, web, mobile |
|---|---|
| Operating systems | — |
| AI compatibility | claude |
| License | NOASSERTION |
| Pricing | open-source |
| Language | Python |
Aetheris Microbrains
Aetheris Microbrains is a super-fast, lightweight safety guard and tool router for AI agents (like Claude Code, Codex, SWE-agent, or custom LLM bots).
Think of it as an instant pre-flight check or an "airbag" for your AI: before an agent runs a command or applies code to your computer, Microbrains inspects it in under 2 milliseconds on your CPU—stopping syntax bugs, leaked passwords, and dangerous commands before they ever happen.
[ User / Task ]
│
▼
┌───────────────────┐
│ LLM Agent │
└─────────┬─────────┘
│ Tool call / Diff / Shell command
▼
⚡ [ AETHERIS MICROBRAINS ] ── (<2 ms local CPU pre-flight gate)
│
├── 🛑 Destructive or broken? (Syntax error, leaked API key, rm -rf, .env leak)
│ ↳ Intercepted immediately. Zero wasted tokens. Zero machine damage.
│
├── ❓ Ambiguous / Risky?
│ ↳ Escalates ("ask") to the human or LLM supervisor for confirmation.
│
└── ✅ Verified safe?
↳ Allowed to run.
🚀 What Is It (In Plain English)?
When AI agents work on your code or execute terminal commands, two common problems happen:
- Wasted Time & Money from Broken Actions:
The agent generates code with a syntax typo, leaks a secret token, or runs a destructive shell command (rm -rf,curl | sh). The computer crashes or tests fail, and the agent spends 3–5 expensive, slow LLM turns just reading errors and trying to fix itself. - Cluttered Context Windows:
Sending 30+ different tool definitions in every prompt wastes thousands of tokens per step, runs up your API bill, and confuses the model.
How Microbrains Helps:
- 🛡️ Instant Safety Shield: It checks code diffs using real Python syntax trees and scans shell commands before execution. If a patch has a syntax error or a destructive command, it stops it in 1.3 ms on your CPU.
- ✂️ Smart Tool Trimming: Shrinks huge lists of tools down to the top 4 most relevant tools for the current step, saving up to ~39% in prompt tokens.
- 🔌 Drop-in Ready: Plugs straight into Claude Code and Codex using a single hook command (
python -m aetheris_microbrains.hook). - ⚡ Runs on Any Laptop: Written in pure Python and NumPy with zero GPU or cloud dependencies.
What it is NOT: Microbrains is not an LLM itself, and it doesn't write code from scratch. It is a guardrail and router that makes your existing agents faster, safer, and cheaper to run.
🤝 Compatible Agent Ecosystems
Microbrains works alongside any AI agent or framework:
| Category | Agents & Frameworks | Integration Status | What Microbrains Does |
|---|---|---|---|
Claude Code & PreToolUse Hooks | Claude Code (≥ 2.1.295), Codex | Built-in CLI Hook (python -m aetheris_microbrains.hook) | Pre-flight inspection on every tool call (allow, ask, or deny). Blocks before execution. |
| Autonomous Coding Agents | SWE-agent, OpenHands, Aider, Cursor Agent | Python API / Adapter (mb.decide(...)) | Catches syntax errors, leaked credentials, and dangerous shell commands before tests run. |
| Personal & Desktop OS Assistants | OpenClaw, Hermes Agent, Goose, Computer Use | Python API / Adapter | Guards .env, .ssh/, and .git/hooks/, blocks disk formatting, and pauses unknown actions. |
| Orchestrators & MCP Hosts | LangGraph, CrewAI, AutoGen, MCP Clients | Python API / Adapter (mb.narrow_tool_surface(...)) | Prunes tool schemas per turn to cut token costs without starving agents of tools. |
💡 Key Benefits
1. 💰 Lower API Bills & No Wasted Loops
Catching broken syntax, missing variables, or leaked keys locally in 1.3 ms stops the agent from executing broken code and spending $0.10–$0.50 per retry turn.
2. 🛡️ Protects Your Machine & Secrets
Shields sensitive files (.env, .ssh/, credentials.json), prevents destructive commands (rm -rf, DROP DATABASE), and catches hidden code execution tricks (eval, base64 decode into exec).
3. ⏱️ Blazing Fast (<2 ms Latency)
Runs in pure NumPy on standard CPUs. You won't notice a 1.5 millisecond check when your LLM takes 5 to 20 seconds to reply.
4. 🧭 Reliable Escalations, Honest Statistics & Audit Trail (v0.7.1–v0.7.5)
- Safe Timeout Contracts: When an action needs human review (
ask), an explicit timeout is set (default: 300s). If nobody answers, it fails closed (default_on_timeout: "deny")—silence never grants permission. - Zero-Fabrication Error Bounds & Calibration Provenance:
decide(),calibrate_conformal(), andinfer_conformal()emitupper_error_bound_95: nullandupper_error_bound_rule_of_3: null(statistical_confidence_status: "unknown") unless measured on an explicit labeled evaluation set. Fission-derived models honestly declareconformal_basis: "fission_synthetic_anchors"withconformal_guarantee_valid = Falseuntil calibrated on genuine holdouts;ToolRoutingMoEexplicitly marks synthetic anchors as"synthetic_lexical_probes". - Nuanced Shell & AST Inspection: Differentiates dangerous redirects (
> /etc/passwd,> .env,> ../escaped) which are strictly denied from unprivileged redirects (echo "ok" > out.txt) which escalate for confirmation, while allowing standard descriptor piping (2>&1,> /dev/null). Real optional Tree-sitter grammars are dynamically verified before reporting AST validation. - Shell Wrapper Unwrapping & Secret Env Defense: Unwraps prefix wrappers (
env,sudo,timeout,nohup, inlineVAR=val) so commands likeenv sh -c "rm -rf /"orsudo rm -rf /cannot evade inspection; blocks secret variable dumps (echo $OPENAI_API_KEY,printenv GITHUB_TOKEN), sensitive/proc/*/environreads, and protected-path mutations, escalating bareenv/printenvinspection. - Outbound Secret Egress & Post-Tool Scrubbing (
v0.7.5): Inspects tool arguments across all tools (shell commands,WebFetch, MCP payloads) to block raw credential exfiltration (layer1_secret_egress_veto), and providesmb.scrub_tool_output()/python -m aetheris_microbrains.hook --event post-tool-useto sanitize returned credentials before context persistence. - Decoupled Advisors & Cache-Safe Sessions: Standalone non-authorizing entrypoints
diagnose_patch()(patch diagnostics) andrank_tools()/SessionToolSurface(sticky per-session Top-K narrowing that avoids LLM prompt-cache invalidation across turns), plusevaluate_topk_holdout()for real Top-K recall audits. - Clean Fleet Registry & Dynamic Variance: Fleet lifecycle registry reports
nulland"unobserved"for models without runtime telemetry instead of placeholder defaults. Counterfactual simulations dynamically track empirical variance thresholds. Test probe models are safely isolated in_archive/leaving 41 pure production models. - Atomic Versioned Storage & Live Telemetry:
AnalyticalMicroTransformer.save()commits immutable_versions/{name}/{rev_id}/snapshots via a single atomic.manifest.jsonpointer swap;/dashboardrenders liveMicrobrainTelemetry(with illustrative preview isolated on/demo/dashboard), anddecision_journal.jsonlredacts secrets and surfacesjournal_written/journal_error. - Shadow Error Observability & Isolated Journals:
--shadowmode uses a pure stdlib logger to append structured, redactedevent_type: "hook_error"entries todecision_journal.jsonlupon empty payloads, malformed JSON, non-object payloads, or engine/import failures (supported via--journal-path/AETHERIS_JOURNAL_PATH), so shadow errors are never indistinguishable from unchecked operations. - Clear File Context Checks: Distinguishes full-file verified diffs from single partial hunks (
layer1_hunk_only_checked), so your agent always knows whether it inspected complete file context.
🔒 Cybersecurity & Defense-in-Depth Options
When AI agents browse the web, read external tickets/PRs, or connect to third-party MCP servers, they face indirect prompt injection, poisoned diffs, credential leaks, and rogue tool calls. Microbrains serves as an additional pre-flight filter, output scrubber, session taint tracker, and audit journal (paired with OS/container/network isolation and credential isolation—never as a standalone sandbox):
- Credential & Environment Isolation Boundary (Upstream Requirement):
PreToolUsehooks stop tool-level secret reads (.env,.ssh/,envdumps,/proc/*/environ,$SECRETechoing) and raw secret egress across tool arguments, but they cannot prevent in-band disclosure (e.g., echoing into chat text) if raw credentials are already sitting inside the LLM context window before a prompt injection fires. Always keep raw production credentials out of the agent's process environment and context window (use short-lived scoped tokens, a secret broker/vault, or credential-injecting egress proxies). - Sensitive Asset Protection Across Tools & Shell (Layer 0 & Layer 1): Denies writes/mutations to
.env*,.git/hooks/,.git/config,.ssh/,id_rsa,credentials.json,/proc/*/environ, agent control-plane paths (.claude/,.codex/,.cursor/,.vscode/,CLAUDE.md,AGENTS.md), and cloud/package credential stores (~/.aws/credentials,~/.npmrc,~/.pypirc,~/.docker/config.json). Normalizes paths, blocks null-byte bypasses, and matches glob patterns viafnmatch. - Obfuscated Payload, Outbound Egress & High-Entropy Secret Screening (Layer 1): Inspects applied Python ASTs/diffs (
eval/exec,os.system,subprocess(shell=True),base64-to-exec,getattrobfuscation,__builtins__tampering,secret_leak_pattern_found,ast_secret_exfil_pattern), non-Python diffs (shell scripts, Makefiles, Dockerfiles), and scans command strings and arbitrary nested tool/MCP/web arguments for raw API keys (Stripesk_live_..., Anthropic, OpenAI, GitHub, HuggingFace, Google), database URIs (postgres://,mysql://,mongodb://), JWT tokens, Bearer headers, and PEM private keys (layer1_secret_egress_veto). - Allowlist-First Shell Guard, Newline Injection & Wrapper Unwrapping: Catches newline-separated commands (
echo ok\nrm -rf /), unwraps wrapper commands (xargs,find -exec/-ok,env,sudo,nohup,timeout, inlineVAR=val,LD_PRELOADoverrides) before running checks—blocking destructive shell chains (rm -rf,env sh -c "rm -rf /",curl | sh,dd of=/dev/,DROP DATABASE) and secret env-var exposures (echo $OPENAI_API_KEY,printenv GITHUB_TOKEN), escalating bareenv/printenv/ls env:and unrecognized commands. - MCP Supply-Chain Security & Rug-Pull Defenses (
v0.7.6+):scan_mcp_tools()scans incoming MCP tool definitions for indirect prompt injection, payload poisoning, and tool shadowing against local built-ins.detect_prompt_injection()intercepts Unicode tag smuggling (\U000E0000-\U000E007F), bidirectional text overrides (\u202E), zero-width obfuscation, and spoofed system delimiters (<IMPORTANT>,<system>,[OVERRIDE]).MCPManifestPinnercryptographically hashes MCP schemas with SHA-256 and detects rug-pull mutations on restart.
- Multi-Turn Session Taint Gate (
SessionSecurityState): Tracks taint across multi-step agent conversations. Flags untrusted external inputs (web pages, user inputs) and sensitive file reads. Triggers immediate hard denial (decision: "deny") if the lethal trifecta occurs (untrusted external ingestion + sensitive credential access + egress or mutation tool call). - Post-Tool Output & Prompt Injection Screening (
evaluate_post_tool_use_payload&--event post-tool-use): Redacts raw credentials viamb.scrub_tool_output()and audits returned tool content for injected instructions before context assimilation, providingadditionalContextwarnings to the agent and appending redacted security journal entries. - Strict AST Allowlist (
--strict-ast/PolicyConfig(strict_ast_allowlist=True)): Escalates any Python diff importing modules outsideallowed_ast_importsor invoking dynamic calls. - Uninspected External / MCP Tool Escalation: Tools without inspected
cmd/diffpayloads (and not explicitlyREAD_ONLY) escalate to"ask"instead of auto-approving;PolicyConfig(require_approval_for_external=True)enforces confirmation on all external actions. - Audit & Safe Rollout (
--shadow,--log-decisions,--journal-path): Shadow mode logs what would be blocked tomemory/decision_journal.jsonlwithout disrupting live workflows; hook errors fail closed with exit code2(use"onFailure": "block"in Claude Code ≥2.1.295).
🌐 Beyond AI Agents: Other Use Cases & Readiness
Microbrains' deterministic AST/shell rules, pure-NumPy runtime, and split-conformal abstention engine apply far beyond developer coding agents:
| Domain | Status Today | Primary Benefit | Key Microbrain Engine |
|---|---|---|---|
| 🛡️ CI/CD & DevSecOps | Ready out-of-the-box | Instant PR/diff security, secret detection, and shell sanitization in under 2 ms. | AST Inspector, Allowlist-First Shell Guard, Secret Egress Veto |
| 📱 Edge & Air-Gapped Systems | Ready out-of-the-box | Zero-GPU, zero-network intelligence with pure NumPy, 2-bit weights, and <15 MB RAM. | PackedTernaryLinear, Offline Non-Pickle .npz, Pure NumPy Runtime |
| 🎯 Support & Ticket Triage | Engine ready, needs your data | Conformal routing with mathematically guaranteed accuracy and safe human escalation. | ToolRoutingMoE, Split-Conformal Prediction Sets, Calibration Journal |
| 💳 Fintech & Transaction Gates | Ready with policy rules | Deterministic pre-flight execution gates, anomaly detection, and drift tracking. | Multi-Turn Taint Gate, Conformal Risk Limits, Fail-Closed Decision Engine |
| 🏥 Healthcare & Clinical Data | Ready with local policies | Strict HIPAA/PII leak scrubbing, provenance auditing, and zero external API calls. | Secret & PII Scrubber, Immutable Decision Audit Log, Fully Offline Inference |
| 🌐 Multi-Agent & MCP Firewalls | Ready out-of-the-box (v0.7.6+) | Immune system against indirect prompt injections, rogue MCP tools, and rug-pull schema mutations. | scan_mcp_tools, detect_prompt_injection, MCPManifestPinner |
| 🤖 Robotics & High-Level Autonomy | Middle-layer modules included (v0.7.0+) | Sub-millisecond reflex buffer and barrier safety zones between slow VLAs and motors. | StateCBFSafetyFilter, VLActionGate, SensorimotorLoop |
💡 In Plain English: Where Else Can Microbrains Be Used?
Because Microbrains is 100% offline, executes in under 2 milliseconds on an ordinary CPU, and uses mathematical guarantees (conformal prediction) instead of guesswork, it excels in high-stakes environments where big cloud AI models are too slow, too expensive, or too untrustworthy to run unsupervised:
1. 🛡️ DevSecOps & Automated CI/CD Guardrails
- The Problem: Developers and automated bots commit code constantly. Traditional static analysis tools (like SonarQube) take minutes to scan a repository, while LLM-based code reviewers are expensive, slow, and prone to hallucinations or missing raw credentials.
- How Microbrains Solves It: Microbrains acts as an ultra-fast pre-commit git hook and CI/CD pipeline gate. In < 2 milliseconds, it parses the full Python AST of a pull request, identifies high cyclomatic complexity, catches credential exfiltration patterns (reading a secret and sending it across a network sink), scans shell scripts and Makefiles for destructive commands (
rm -rf,curl | sh), and redacts raw secrets before code ever leaves the developer's laptop.
2. 📱 Edge, Embedded & Air-Gapped / Classified Environments
- The Problem: Submarines, aircraft, remote sensor towers, industrial factories, and classified government networks have no internet connection, strict power budgets, and zero GPU access. Giant cloud LLMs cannot be used at all.
- How Microbrains Solves It: Microbrains runs on pure standard-library Python and NumPy with no external dependencies. Using 2-bit ternary quantization (
PackedTernaryLinear), entire routing and classification models weigh just a few megabytes and run on ultra-low-power edge processors with < 15 MB of RAM. It delivers real-time machine intelligence completely air-gapped from the internet.
3. 🎯 High-Volume Customer Support & Ticket Triage
- The Problem: Companies receive tens of thousands of customer support tickets, bug reports, and IT requests every day. Sending every single ticket to a frontier LLM costs thousands of dollars a month and often routes complex issues to the wrong department.
- How Microbrains Solves It: Using
ToolRoutingMoEwith adaptive conformal prediction, Microbrains categorizes incoming tickets and decides whether to route them automatically or escalate to human specialists. If customer sentiment or ticket complexity falls outside a calibrated confidence threshold (e.g. 95% guaranteed accuracy), Microbrains safely escalates the ticket to a human manager rather than guessing wrong.
4. 💳 Financial Trading, Fraud & Transaction Pre-Flight Gates
- The Problem: Automated trading bots and payment microservices execute thousands of transactions per second. A software bug, rogue API key, or corrupted data feed can trigger catastrophic financial loss before humans can react.
- How Microbrains Solves It: Microbrains serves as a deterministic "circuit breaker" and pre-flight gate. It evaluates transaction parameters, verifies schema integrity, enforces risk-boundary policies, and checks for data drift using rolling statistical telemetry (
upper_error_bound_95,drift_detected) in sub-millisecond execution times without adding latency to trading pipelines.
5. 🏥 Healthcare, Clinical & Biotech Data Pipelines
- The Problem: Handling Electronic Health Records (EHR) and clinical genomic data requires strict compliance (HIPAA, GDPR). Sending patient notes or diagnostic data to third-party cloud AI APIs can result in severe privacy violations and regulatory penalties.
- How Microbrains Solves It: Because Microbrains is entirely self-contained and operates with zero network calls, it can scrub Protected Health Information (PHI) and medical identifiers locally before any downstream processing. Its immutable JSONL decision journals provide cryptographic verification (
input_sha256, audit logging) to satisfy strict regulatory compliance and audit trails.
6. 🌐 MCP & Multi-Agent Network Firewalls
- The Problem: As organizations deploy autonomous agent swarms communicating via the Model Context Protocol (MCP), agents become vulnerable to indirect prompt injection, poisoned third-party MCP servers, and "rug-pull" tool definition changes that trick agents into exfiltrating corporate data.
- How Microbrains Solves It: Microbrains acts as an MCP Application Firewall:
- Scans external MCP tool definitions for prompt injection and tag smuggling before agents connect.
- Cryptographically pins tool schemas with SHA-256 hashes (
MCPManifestPinner) to instantly detect silent rug-pull updates. - Enforces the Session Taint Gate, immediately denying any action if an agent ingests untrusted external data and subsequently tries to access credentials or make outbound network calls.
🤖 Robotics Extension Layer (10–50 Hz VLA / Planner Middleware)
💡 In Plain English: How Does Microbrains Work for Robots?
If you are connecting an AI or Vision-Language-Action (VLA) model to a physical robot (an arm, a mobile base, or a drone), you immediately run into three major safety and speed problems:
- Big AI models are too slow for real-time safety: An LLM or VLA model takes several hundred milliseconds (or seconds) to see an image and plan a movement. If an obstacle suddenly appears, waiting for the AI to "think" means the robot crashes.
- AI models can hallucinate dangerous movements: An AI might command an arm to smash through a table, push into a wall, or accelerate past motor limits.
- Running giant neural networks on small robot computers burns through battery and memory: Edge hardware on robots rarely has multiple massive datacenter GPUs.
How Microbrains Solves This:
Microbrains acts as an onboard "reflex buffer" and instant safety copilot sitting right between the high-level AI planner and the robot motors:
- 🛡️ Instant Invisible Safety Bubble (
StateCBFSafetyFilter): In less than a millisecond, Microbrains computes mathematical "keep-out" safety zones around tables, walls, and humans (using Control Barrier Functions). If the AI planner commands a movement that would collide or exceed speed limits, Microbrains instantly nudges the command to the nearest 100% safe path before sending it to the motors. - ⚡ Fast Local Reflexes Without Wasting Battery (
VLActionGate): Routine actions (like holding steady or repeating a known motion) are handled locally by ultra-lightweight microbrains in <1 ms on an ordinary CPU. The robot only calls the power-hungry, slow VLA model when something genuinely unexpected happens. - 🔋 Ultra-Compact Neural Weights (
PackedTernaryLinear): Runs specialized micro-networks quantized to 2 bits (ternary: -1, 0, +1) directly in CPU memory, requiring zero GPU VRAM and minimal battery power. - 🛑 Fail-Closed Protection: If the safety equations cannot guarantee a collision-free path or if confidence drops, the robot halts or asks for human confirmation rather than guessing.
[ Camera / Sensors ] ───▶ [ High-Level VLA / LLM Planner ] (~5–10 Hz, Slow, High-Level Intent)
│
│ "Move arm to (X, Y, Z)"
▼
┌───────────────────────────┐
│ AETHERIS MICROBRAINS │ (10–50 Hz, <1 ms on Robot CPU)
│ • Control Barrier Check │
│ • Collision Deflection │ ──▶ Blocks crashes & out-of-bounds moves
│ • Sub-ms Local Reflexes │
└───────────────────────────┘
│
│ Verified Safe Trajectory
▼
[ Low-Level Motor Control / ROS 2 ] (~1000 Hz, Real-Time Hardware)
Component Overview
For high-level robot autonomy (between ~1 kHz MCU/RTOS servo loops and tens-of-ms VLA/LLM calls), the SDK includes six pure-NumPy robotics modules:
| Component | What It IS | What It Is NOT |
|---|---|---|
StateCBFSafetyFilter (core/state_cbf_filter.py) | Exact Euclidean projection onto affine CBF halfspaces $\cap$ control box via Dykstra's algorithm, with conformal barrier inflation and verified_safe=False fail-closed on infeasibility. | Not a hard real-time C++/RTOS safety controller or certified hardware E-stop. |
VLActionGate & SkillLibrary (core/vla_gating.py) | Three-tier gate (local_reflex / call_vla / escalate_human) composing CBF feasibility, fail-closed conformal risk (uncalibrated never allows), and VSA skill affordances (with scene_prototype / bind_scene_example). Also wired at POST /microbrain/gate. | Not a learned SayCan feasibility value function unless backed by your scene prototypes/traces. |
SensorimotorLoop & nir_export (core/sensorimotor_loop.py, core/nir_export.py) | Fixed-dt multi-rate tick scheduler with ReservoirReflexLayer (FORCE/RLS online readouts on LiquidStateReservoir) and guarded NIR-dialect graph export. | Not an ISO-certified real-time firmware loop or full Neuromorphic Intermediate Representation compiler. |
EFPAgent & GenerativeModel (core/pymdp_efe.py) | Discrete POMDP generative model (A/B/C/D) computing Expected Free Energy (pragmatic + epistemic mutual-information terms) and exact Bayes belief updates. | Not a continuous-control MPC solver. |
PackedTernaryLinear (core/ternary_edge_runtime.py) | 2-bit packed .npz ternary weights with atomic saves, exact integer parity with BitLinearLayer, latency receipts (bench_receipt), and guarded ONNX export. | Not a custom CUDA/NPU kernel. |
🏗️ 4-Layer Decision Architecture
- Layer 0: Policy, Protected Paths & Session Taint
- Enforces live
available_toolsregistries and blocks null-byte string bypasses. - Protects sensitive local paths (
.env*,.git/hooks/,.git/config,.ssh/,id_rsa,credentials.json,/proc/*/environ), agent control planes (.claude/,.codex/,.cursor/,.vscode/,CLAUDE.md,AGENTS.md), and cloud credentials (~/.aws/credentials,~/.npmrc,~/.pypirc,~/.docker/config.json). - Evaluates multi-turn
SessionSecurityStatetaint: hard denial on lethal trifecta (external ingestion + credential read + mutation/egress). - Supports
require_approval_for_externaland irreversible action guards.
- Enforces live
- Layer 1: Structural AST, Secret & Allowlist-First Shell Gate
- Full-file reconstructed Python AST parsing (
ast.parseapplied over unified diffs), distinguishing harmless static data tables from high cyclomatic complexity changes. - Detects Python AST secret exfiltration (
ast_secret_exfil_pattern: credential read + network egress sink). - Hardcoded API secret detection (Stripe
sk_live_..., JWT, database URIs, Anthropic, OpenAI, GitHub, Google, PEM private keys). - Allowlist-first
shlexshell tokenizer with wrapper unwrapping (xargs,find -exec,env,sudo,timeout,nohup), newline separation handling, and shell script / Makefile scanning (rm -rf,curl | sh,dd of=/dev/deny; unknown commands safely escalate). - Uninspected tools without diffs or commands escalate to
"ask"rather than auto-approving.
- Full-file reconstructed Python AST parsing (
- Layer 2: Tool Narrowing & Conformal Abstention
- Schema-driven hybrid retrieval (
ToolSchemaIndex) combining Okapi BM25 (k1=1.5,b=0.75), character-3-gram cosine similarity, and optional dense embedding vectors via Reciprocal Rank Fusion (k=60). - Prompt-cache-friendly namespace cluster pinning (
SessionToolSurface(cluster_pinning=True)) preserving coherent namespaces (git_*,docker_*) to avoid prompt-prefix cache invalidation. - Online Adaptive Conformal Inference (
ToolRoutingMoE.update_online_crc()) dynamically adjusting per-expert nonconformity quantiles under live feedback with honest provenance. - Calibrated micro-classifiers with empirical conformal prediction sets, exact Clopper-Pearson bounds, and cross-process decision journal drift detection.
- Schema-driven hybrid retrieval (
- Layer 3: Honest Escalation
- Structured fallback returning
escalate(in Claude Code hooks:permissionDecision: "ask") with full context for human or LLM review.
- Structured fallback returning
📦 Installation
git clone https://github.com/drtikov/microbrainsforagents.git
cd microbrainsforagents
pip install -e .
Importing aetheris_microbrains is side-effect clean: it does not mutate sys.path or shadow top-level project modules (core, tools, memory, evolution).
Optional OpenCL acceleration:
pip install -e .[opencl]
⚡ Quickstart
0. Unified 4-Layer Decision Contract
import aetheris_microbrains as mb
verdict = mb.decide({
"tool": "edit_file",
"path": "src/server.py",
"diff": "def f():\n os.system(cmd)\n",
})
print(verdict)
# {'decision': 'deny', 'label': 'dangerous_method:os.system', 'layer': 1, ...}
1. Microbrain Domain Consultation
import aetheris_microbrains as mb
result = mb.microbrain_consult(text="syntax error in AST parser during code edit")
print("Selected Brain:", result["selected_brain"])
print("Confidence:", result["calibrated_confidence"])
print("Cal Samples:", result["n_calibration_samples"], "Valid Guarantee:", result["conformal_guarantee_valid"])
2. Deterministic Top-2 Mixture-of-Experts (MoE) Tool Routing
import aetheris_microbrains as mb
router = mb.get_tool_routing_moe()
decision = router.route("inspect file contents and write safe patch to repository")
print("Primary Tool:", decision.selected_tool) # -> repo_write (deterministic across processes)
print("Top-2 Experts:", decision.top_experts)
print("Conformal Passed:", decision.conformal_passed)
3. Pre-Commit Structural AST & Counterfactual Safety Gate
import aetheris_microbrains as mb
sim = mb.get_counterfactual_pipeline()
outcome = sim.simulate_edit_impact(
file_path="src/server.py",
diff_text="--- a/server.py\n+++ b/server.py\n@@ -10,2 +10,3 @@\n+ eval(untrusted_user_input)\n"
)
if not outcome.allowed:
print("Blocked:", outcome.status, outcome.veto_reason)
4. Holographic Weight-Space VSA Memory
import aetheris_microbrains as mb
vsa = mb.get_weight_space_vsa()
nearest = vsa.find_nearest_domains("tool_routing_v2", top_k=3)
print("Nearest models in parameter space:", nearest)
5. Claude Code & Agent Harness PreToolUse Hook Integration
Microbrains integrates directly into Claude Code, Codex, or any custom agent framework as a pre-tool execution hook.
Add to your ~/.claude/settings.json or project .claude/settings.json hook configuration (note: onFailure: "block" requires Claude Code ≥ 2.1.295):
{
"hooks": {
"PreToolUse": [
{
"matcher": ".*",
"hooks": [
{
"type": "command",
"command": "python -m aetheris_microbrains.hook --strict-ast",
"onFailure": "block"
}
]
}
]
}
}
Verify inside Claude Code that the hook is registered via /hooks (or test that rm -rf / is blocked with exit code 2 and stderr output).
Key Hook Modes & CLI Flags:
- Prefilter Mode (Default): On safe operations, the hook exits
0silently. It does not bypass Claude Code's native user confirmation dialogs—it only intercepts dangerous or broken calls before the prompt is shown. --shadow(orAETHERIS_HOOK_SHADOW=1): Safe pilot/audit mode—logs what Microbrains would deny or escalate tomemory/decision_journal.jsonlwithout blocking live execution. Empty stdin, malformed JSON, non-object payloads, and engine/import errors still return0with emptystdoutand append a redacted stdlib-onlyevent_type: "hook_error"entry to the journal so hook failures are never indistinguishable from unchecked calls.--log-decisions/--journal-path(AETHERIS_LOG_DECISIONS=1,AETHERIS_JOURNAL_PATH): Persist hook telemetry (including shadowhook_errorevents) to a customdecision_journal.jsonlpath across independent hook processes for pilot audits and drift detection.--auto-allow(orAETHERIS_HOOK_AUTO_ALLOW=1): Explicitly outputs{"permissionDecision": "allow"}inhookSpecificOutputfor trusted environments where verified commands should run without user prompting.- Protected Paths Escalation: Reading sensitive files (
.env,.ssh/id_rsa,credentials.json) automatically returnspermissionDecision: "ask", while modifications are strictly denied. - Fail-Closed on Exceptions & Import Errors (Non-Shadow): Unexpected runtime or import errors return exit code
2with redacted details instderr, preventing unsafe actions from running if the hook fails.
Live Claude Code & Codex Acceptance Checklist (before production use):
- Normal call (
ls -la): exits0silently and preserves the host's normal user permission prompt. - Escalation (
Read .envor unknown MCP tool): on Claude Code,askprompt reaches the user; on Codex (--host codex), verify a harmless escalated call under both Codex approval settings (prompt-on vs. auto-approve), because exit0+ emptystdout(defer_to_host_policy) leaves the decision to Codex's configured policy rather than forcing a prompt under auto-approve (enable--codex-escalate-denyif escalations must hard-block). - Denial (
rm -rf /): blocked before execution (exit 2), redacted reason shown viastderr. - Hook failure /
--shadowerror audit (onFailure: "block"on Claude Code ≥2.1.295): non-shadow hook errors fail closed; in--shadowpilots, confirm malformed/engine-error payloads recordevent_type: "hook_error"insidedecision_journal.jsonl.
6. Allowlist-First Shell Gate, File-Context AST & Shadow Mode
import aetheris_microbrains as mb
# Allowlisted read-only shell commands pass; unrecognized commands escalate;
# destructive chains (`rm -f -r ~`, `sh -c 'rm -rf /'`, `ls $(whoami)`) are denied.
print(mb.decide({"tool": "execute_shell", "cmd": "ls -la"})["decision"]) # -> "allow"
print(mb.decide({"tool": "execute_shell", "cmd": "custom_deploy_binary --prod"})["decision"]) # -> "escalate"
# Resolve aliases declared in enclosing `file_content` + log shadow-mode decisions
verdict = mb.decide(
{"tool": "edit_file", "path": "src/runner.py", "diff": "def f(c):\n _o.system(c)\n"},
context={
"file_content": "import os as _o\n",
"shadow_mode": True,
"journal_path": "memory/decision_journal.jsonl",
},
)
print(verdict["decision"], verdict["shadow_decision"]) # -> "escalate" "deny"
7. Dynamic Tool Registry (available_tools) & MCP-Zero Top-K Narrowing
import aetheris_microbrains as mb
router = mb.get_tool_routing_moe()
# Constrain selection strictly to the active agent mode's tool surface (bilingual RU/EN)
res = router.route(
"прочитай файл и напиши патч для репозитория",
available_tools=["edit_file", "memory_recall", "web_fetch"],
)
print("Selected within surface:", res.selected_tool) # -> "edit_file"
# MCP-Zero hierarchical Top-K catalog narrowing (escalates full catalog on OOD)
narrowed = mb.narrow_tool_surface("fix bug and write repository patch", top_k=4)
print(narrowed["mode"], narrowed["candidate_tools"], narrowed["reduction_ratio"])
# Decoupled non-authorizing advisors & cache-safe sticky session narrowing (v0.7.4)
ranked = mb.rank_tools("inspect source file settings.py", available_tools=["repo_read", "edit_file", "run_tests"], top_k=2)
patch_diag = mb.diagnose_patch("src/app.py", "def ok():\n return 1\n")
session = mb.SessionToolSurface(["repo_read", "edit_file", "run_tests", "git_status", "docker_ps"], top_k=3)
turn1 = session.select_for_turn("read config source file")
turn2 = session.select_for_turn("check line 20") # reuses sticky prefix -> cache_prefix_preserved=True
8. Mondrian Conformal Quantiles, Atomic Versioned Checksums & Staged Plasticity
import aetheris_microbrains as mb
# Load weights with automatic SHA-256 integrity verification (`verify_checksum=True`)
brain = mb.AnalyticalMicroTransformer.load("neuro_code_edit_verifier")
inf = brain.infer_conformal(["syntax_tree_valid", "ast_node_function_def"], alpha=0.05, mondrian=True)
print("Origin:", inf["calibration_data_origin"], "Std Err:", inf["coverage_std_error"])
# Staged continual plasticity: writes to `_candidates/`, requires holdout gate, atomic `_rollback/`
pipeline = mb.ContinualLearningPipeline()
staged = pipeline.apply_plasticity_feedback("code_edit_verifier", ["new_ast_pattern"], promote=False)
# prom = pipeline.verify_and_promote_candidate("code_edit_verifier", holdout_data, min_coverage=0.95)
# pipeline.rollback_domain("code_edit_verifier")
9. AST Signature Blast Radius, Sliding-Window Drift & Adaptive Conformal (ACI)
import aetheris_microbrains as mb
# Counterfactual AST interface/signature diffing + CausalWorldModel rollout
sim = mb.get_counterfactual_pipeline()
sig_check = sim.simulate_edit_impact(
"src/math_ops.py",
"--- a/src/math_ops.py\n+++ b/src/math_ops.py\n@@ -1,2 +1,2 @@\n-def compute(a, b, c):\n+def compute(a):\n return a\n",
)
print("Allowed:", sig_check.allowed, sig_check.simulated_failure_modes)
# Sliding-window drift monitoring & Gibbs-Candès Adaptive Conformal Inference (ACI)
tel = mb.get_microbrain_telemetry()
q_next = tel.update_aci_quantile(current_q=0.05, had_error=True, alpha=0.05, gamma=0.02)
report = tel.generate_dashboard(window_size=100)
print("Window coverage:", report.sliding_window_coverage, "Drift:", report.drift_detected)
🎯 Scope, Where It Fits & Alternatives
- Where Microbrains Fits: A single
pip install(numpy-only), zero-GPU pre-flight bundle for custom/local agents or harnesses that want AST diff checks, secret scanning, allowlist-firstshlexshell gating, and Top-K tool narrowing in< 2 mswithout wiring 4 separate external binaries/services. - Established Alternatives by Component:
| Capability | Microbrains Approach | Established Specialized Alternatives |
|---|---|---|
| Python code & diff checks | Full-file ast.parse + sink visitor + opt-in PolicyConfig(strict_ast_allowlist=True) | Bandit, Semgrep, Meta LlamaFirewall CodeShield |
| Secret detection | Diff literal & token-prefix scanner (secret_leak_pattern_found) | gitleaks, trufflehog |
| Shell allow/deny | Allowlist-first shlex parser (unknown -> escalate) | Harness permission rules / PreToolUse hooks (Claude Code, Codex) — or drop in python -m aetheris_microbrains.hook |
| Tool narrowing | < 1 ms bilingual SHA-256 char-trigram MoE + optional embed_fn/tool_descriptions hybrid | Anthropic deferred tool loading, langgraph-bigtool |
- What Microbrains Are NOT For:
- Replacing general LLM reasoning on arbitrary natural language tasks (unknown prompts deterministically abstain and escalate to Layer 3).
- Acting as a standalone OS sandbox: whatever static rules miss gets through unless isolated at the OS/container boundary.
- License: PolyForm Noncommercial 1.0.0 — free for educational, research, and noncommercial use; commercial/work use requires a commercial license.
🧪 Testing & Reproducible Benchmarks (v0.7.5: 255 Passed, 2 Skipped)
Run the full verification suite (zero failures; 2 optional-dependency skips in test_robotics_stack.py when nir or onnx are not installed):
pytest aetheris_microbrains/tests -q
1. External Tool-Drop Rate, Baseline Comparison & Live-LLM A/B (examples/06_real_llm_ab_benchmark.py)
Evaluates narrow_tool_surface(top_k=K) across 40 handcrafted SWE / DevOps-style queries (38 in-domain, 2 OOD; not an official BFCL split) using real serialized 32-tool OpenAI JSON schemas (2,589 tokens/step):
python examples/06_real_llm_ab_benchmark.py
# Optional live-LLM A/B comparison against any OpenAI-compatible / Ollama endpoint:
python examples/06_real_llm_ab_benchmark.py --live --model gpt-4o-mini
| Top-K | Recall@K | Needed-Tool Drop Rate | Escalated to Full | OOD Escalated | Gross Saved | Net Saved (After Retries) | Local p95 |
|---|---|---|---|---|---|---|---|
| 2 | 92.1% | 7.9% (3/38) | 19/38 | 1/2 | 46.7% | 35.1% | 1.864 ms |
| 4 | 97.4% | 2.6% (1/38) | 19/38 | 1/2 | 43.5% | 39.7% | 1.272 ms |
| 6 | 97.4% | 2.6% (1/38) | 19/38 | 1/2 | 40.5% | 36.6% | 1.141 ms |
| 8 | 97.4% | 2.6% (1/38) | 19/38 | 1/2 | 37.5% | 33.6% | 1.246 ms |
Baseline Comparison (Top-4 on 38 In-Domain Handcrafted Queries, with Pre-Frozen Keyword Escalation Rule):
| Architecture | Recall@4 | Escalated | Dropped | Drop Rate | 95% CP Upper Drop | Net Saved (After Retries) | Local p95 |
|---|---|---|---|---|---|---|---|
| Naive Keyword Top-4 | 76.3% | 0/38 | 9/38 | 23.7% | <= 37.7% | 52.1% | 0.195 ms |
| Naive Keyword Top-4 (Frozen Esc.) | 84.2% | 8/38 | 6/38 | 15.8% | <= 28.8% | 45.5% | 5.119 ms |
| Embedding + Ridge Top-4 | 73.7% | 0/38 | 10/38 | 26.3% | <= 40.5% | 49.0% | 0.478 ms |
| Microbrains Top-4 (Hybrid) | 97.4% | 19/38 | 1/38 | 2.6% | <= 11.9% | 39.6% | 8.435 ms |
Honesty note: Using a pre-frozen lexical cutoff (
top_score < 2 or margin < 1) with zero test-set tuning, Keyword reaches 84.2% Recall@4 while Microbrains reaches 97.4% by escalating half the queries to the full catalog (--liveretries rely strictly on runtime invalid/missing tool calls, never oracle ground-truth labels).
2. Local 25-Step Regression & Schema-Token Smoke Test (examples/05_reproducible_25step_benchmark.py)
Deterministic offline trajectory checking local CPU gate latency, AST/shell/secret rules, and OOD escalation (measures tool-schema tokens only, excluding conversation history and LLM prompt caching; see Section 5 for cache-adjusted multi-turn metrics):
python examples/05_reproducible_25step_benchmark.py
| Architecture | 25-Step Schema Tokens | Schema Token Reduction | Dangerous Missed (FN) | Benign Blocked (FP) | Local p95 Latency |
|---|---|---|---|---|---|
| Unfiltered 32-Tool Agent | 64,800 | 0.0% | — (runs unfiltered) | 0 | — (not measured) |
| Naive Keyword Baseline | 64,800 | 0.0% | 8 | 4 | 0.002 ms |
| Aetheris Microbrains v0.7.5 | 12,312 | 81.0% | 0 | 0 | 1.977 ms |
3. External SWE-bench Lite (300 Real GitHub Issues) Zero-LLM Gate Benchmark (examples/07_swebench_lite_gate_benchmark.py)
Evaluates decide() and narrow_tool_surface(top_k=4) against all 300 real issues and gold patches in princeton-nlp/SWE-bench_Lite:
python examples/07_swebench_lite_gate_benchmark.py
Patch Gate (300 Real Gold File Diffs):
| Metric (Denominator: 300 File Diffs / 60 Top-Level Mutated Pairs) | Result |
|---|---|
Gold file diffs allowed (layer1_hunk_only_checked) | 213 / 300 (71.0%) |
Partial hunks escalated without full original_source | 82 / 300 (27.3%) |
Gold file diff false-deny rate (AST syntax FP: 0) | 5 / 300 (1.67%) |
Paired causal mutation flips (verifies expected reason_code and rule-specific label) | 58 / 58 non-deny (39 / 39 strictly allowed originals; 60 / 60 raw) |
Diff gate local latency (p50 / p95) | 1.474 ms / 3.968 ms |
Tool-Surface Narrowing Smoke-Test (300 Issue Prompts — Coarse any(5 SWE core tools) Criterion):
| Metric (Denominator: 300 Issues / 127 Narrowed Prompts) | Result |
|---|---|
| Prompts narrowed to Top-4 vs. full-catalog escalation | 127 / 300 narrowed, 173 / 300 full-catalog |
| Coarse SWE core retention across all 300 prompts vs. Pre-Frozen Keyword smoke | 297 / 300 vs. 286 / 300 (36.7% schema tokens saved, p95 = 14.487 ms) |
Coarse SWE core retention within narrowed-only prompts (mode == "narrowed") | 124 / 127 (edit_file / repo_read: 103 / 127) |
4. Drop-In Claude Code / Codex PreToolUse & PostToolUse Hook CLI & HTTP Endpoints (v0.7.0–v0.7.5)
Use Microbrains directly inside Claude Code, Codex, or custom agent hooks via stdin/stdout JSON. Output adapts per host via --host claude|codex|generic (Claude Code uses hookSpecificOutput allow/ask/deny; --host codex omits unsupported "ask" on escalations, returning host_action: "defer_to_host_policy" with exit 0 and empty stdout so Codex applies its configured approval policy—which does not force a prompt under auto-approve modes unless --codex-escalate-deny is enabled), while fatal denials and non-shadow invalid/non-object payloads write redacted reasons to stderr with exit code 2 (fail-closed):
echo '{"tool_name":"Bash","tool_input":{"command":"ls -la"}}' | python -m aetheris_microbrains.hook --strict-ast
echo '{"tool_name":"Bash","tool_input":{"command":"custom_cmd"}}' | python -m aetheris_microbrains.hook --host codex
- Prefilter-by-default & Strict Passive Shadow (
--journal-path/AETHERIS_JOURNAL_PATH): Safeallowverdicts exit0with emptystdoutso host confirmation prompts still apply (--auto-allowopts out). Under--shadow,evaluate_hook_payload()and CLI stay passive (exit 0, emptystdout,permissionDecision=Noneregardless of--host codexflags), logshadow_reason_codeon valid payloads, and use a stdlib-only journal writer to record redactedevent_type: "hook_error"entries on empty input, malformed JSON, non-object JSON, and engine/import errors (so hook failures are visible alongsideshadow_mode_observationlines indecision_journal.jsonl), warning onstderrif journal persistence fails. - Live
/dashboard, Static/demo/dashboard& Server Extra (pip install aetheris-microbrains[server]): Installs FastAPI, Uvicorn, and Pydantic./dashboardand/metricsrender liveMicrobrainTelemetrydata; static preview cards live on/demo/dashboard./microbrain/prefilterfails closed (status="error",passed=False) andDSHMicrobrainClientpropagates server error statuses while validating Python syntax viaast.parsein its local fallback. - Fail-closed recommendation: Set
"onFailure": "block"in Claude Code hook configs so import/environment errors block safely.
5. Frozen 120-Task Multi-Label Tool Advisor & Session Prompt-Cache Benchmark (examples/08_frozen_advisor_benchmark.py)
Evaluates 120 frozen multi-label coding tasks (6 external repo archetypes × 20 tasks, each permitting multiple valid acceptable_tools) across 3-turn sessions with realistic prompt-prefix caching (0.1x cached token cost when the tool prefix matches the previous turn, 1.0x on invalidation):
python examples/08_frozen_advisor_benchmark.py
| Strategy | Recall@4 | Narrowed Recall | Narrowed | Dropped | 95% CP Upper Drop | Uncached Net Saved | Cache-Adjusted Net Saved | Local p95 |
|---|---|---|---|---|---|---|---|---|
| Full 32-Tool Catalog (Baseline) | 100.0% | 100.0% | 0/120 | 0/120 | <= 2.5% | 0.0% | 0.0% | 0.001 ms |
| Simple Name+Desc Keyword (Frozen Rule) | 94.2% | 92.9% | 98/120 | 7/120 | <= 10.7% | 79.5% | 48.8% | 0.284 ms |
| Microbrains Top-4 (Per-Turn) | 100.0% | 100.0% | 78/120 | 0/120 | <= 2.5% | 52.9% | 4.1% | 7.412 ms |
| Microbrains Top-4 (Session-Sticky) | 100.0% | 100.0% | 78/120 | 0/120 | <= 2.5% | 56.8% | 56.8% | 5.559 ms |
Equal-Escalation-Rate & Risk–Coverage AURC Comparison (42/120 Matched Escalation Budget):
| Selector | Escalated | Narrowed | Dropped | Recall@4 | Narrowed Recall | 95% CP Upper Drop | AURC Drop Risk |
|---|---|---|---|---|---|---|---|
| Simple Name+Desc Keyword | 42/120 (nat 22) | 78/120 | 2/120 | 98.3% | 97.4% | <= 5.1% | 0.0228 |
| Microbrains Top-4 | 42/120 (nat 42) | 78/120 | 0/120 | 100.0% | 100.0% | <= 2.5% | 0.0000 |
- Agreed-Narrowed Error Check: Even among
73queries where both Keyword and Microbrains narrowed,6had drops in one selector (measured explicitly). When Keyword is forced to escalate its weakest42/120queries (matching Microbrains'42/120abstention budget), Keyword still drops2/120(AURC = 0.0228) vs0/120(AURC = 0.0000) for Microbrains. - Prompt-Cache Effect: Switching active tools every turn (
Per-Turn) breaks prefix caching (52.9%raw →4.1%cache-adjusted); pinning tools per session withSessionToolSurfacepreserves56.8%net cache-adjusted savings. Decoupleddiagnose_patch()matched5/5patch diagnostic cases withauthorizes_execution=False.
6. Bilingual SWE 5-Way Ablation & Equal-Escalation Comparison (aetheris_microbrains/tests/test_colony_swe_shadow.py)
Disjoint held-out conformal calibration (in_sample=False), tracking both missed mandatory escalations and benign false escalations / misclassifications:
| Variant | 120 RU/EN Acc (RU) | Missed Esc. (95% CP Upper) | Syn-Bank Held-Out (20) | Zero-Overlap Morph Split (20) | Morph Missed Esc. |
|---|---|---|---|---|---|
1. Pure Rules Baseline | 106/120 = 88.3% (95.0%) | 4/50 (<= 17.38%) | 5/20 (25.0%, 1/6 missed) | 10/20 (50.0%) | 0/6 (<= 39.3%) |
1b. Rules (Matched Synonym + Invariants) | 107/120 = 89.2% (95.0%) | 4/50 (<= 17.38%) | 20/20 (100.0%, 0/6 missed) | 6/20 (30.0%) | 0/6 (<= 39.3%) |
2. Pure Neural (Weights + Threshold) | 103/120 = 85.8% (90.0%) | 1/50 (<= 9.14%) | 14/20 (70.0%, 0/6 missed) | 8/20 (40.0%) | 0/6 (<= 39.3%) |
2b. Pure Neural (Weights Only, No Threshold) | 60/120 = 50.0% (56.7%) | 50/50 (<= 100.0%) | 12/20 (60.0%, 6/6 missed) | 8/20 (40.0%) | 6/6 (<= 100.0%) |
3. Microbrain Hybrid (Weights + Conformal Gate) | 104/120 = 86.7% (91.7%) | 0/50 (<= 5.82%) | 14/20 (70.0%, 0/6 missed) | 8/20 (40.0%) | 0/6 (<= 39.3%) |
Matched Escalation-Budget & Selective AURC (compare_at_equal_escalation_rate()):
colony_120(63/120escalated,57local): Matched Rules (1b, natural50/120) drops from89.2%to100/120 (83.3%)with3/50missed escalations (selective_error_rate_on_local = 0.0702,AURC = 0.0801), vs. Microbrain Hybrid (3) at104/120 (86.7%)with0/50missed escalations (selective_error_rate_on_local = 0.0526,AURC = 0.0959).frozen_morph_20(zero exact-token overlap on routine items): Matched Rules (1b) naturally escalates all20/20(6/20 = 30.0%,AURC = 0.8518), whereas Microbrain Hybrid (3) classifies3locally at17/20escalations (8/20 = 40.0%,0/6missed,AURC = 0.6576).
// faq
What is microbrainsforagents?
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.. It is open-source on GitHub.
Is microbrainsforagents free to use?
microbrainsforagents is open-source under the NOASSERTION license, so it is free to use.
What category does microbrainsforagents belong to?
microbrainsforagents is listed under automation in the Claudeers registry of Claude-compatible tools.
// embed badge
[](https://claudeers.com/microbrainsforagents)
// retro hit counter
[](https://claudeers.com/microbrainsforagents)
// reviews
// guestbook
// related in Automation & Workflows
The API to search, scrape, and interact with the web at scale. 🔥
🌐 Make websites accessible for AI agents. Automate tasks online with ease.
Taste-Skill - gives your AI good taste. stops the AI from generating boring, generic slop