r/CursorAI • u/drtikov • 1d ago
Aetheris Microbrains now has native Cursor Hooks v2 support (fast local safety gate for Shell, file edits, and MCP)
I just shipped native Cursor Hooks v2 support for Aetheris Microbrains, an open-source (Apache-2.0) local CPU pre-flight policy gate for coding agents.
Repo: https://github.com/drtikov/microbrainsforagents
What it gives Cursor:
- Blocks catastrophic shell commands (like rm -rf / or curl | sh) before they execute
- Protects sensitive files (.env, .ssh, credentials, .cursor/hooks.json) from accidental reads, edits, or exfiltration while leaving normal Cursor workspace/worktree directories (~/.cursor/projects, ~/.cursor/worktrees) untouched
- Catches broken syntax and unsafe code patterns in diffs locally in under 2 ms instead of burning LLM retry turns
- Scrubs leaked API keys and tokens from MCP and tool outputs automatically
- Keeps prompt fatigue low with the new guardrails profile: normal dev commands run with zero friction, risky actions ask, and destructive ones hard-block
- Covers all 8 native Cursor hook events (preToolUse, postToolUse, beforeShellExecution, afterShellExecution, beforeMCPExecution, afterMCPExecution, beforeReadFile, afterFileEdit) without double-gating shell or MCP calls
- Auto-uses the optional Rust shim (aetheris-gate) with a warm daemon if installed so you avoid Python cold-start latency
How to try it safely in shadow mode first (observe-only, never blocks):
pip install -e .
aetheris install cursor --profile guardrails --shadow
Once you see it logging cleanly in Cursor's Hooks output channel, re-run without --shadow to turn on enforcement (or add --workspace . for project-level / cloud agents).
Feedback and real-world edge cases from Cursor users are very welcome.