r/PiCodingAgent • • 9h ago

News Added native Oh My Pi (OMP) support to Aetheris Microbrains: local pre-flight safety gate, DLP scrubbing, and auto-starting daemon

I just added first-class Oh My Pi (OMP) integration to Aetheris Microbrains, a local CPU-only pre-flight safety gate and tool-surface router for coding agents.

How it works with OMP: The extension (omp-aetheris-microbrains/index.js) has zero npm dependencies and no build step on the OMP side. It hooks into OMP's native tool_call, tool_result, session_start, and session_shutdown events and talks to a pure-stdlib Python daemon over localhost. You do not have to babysit a separate terminal either — if nothing is listening on 127.0.0.1:8765, the extension auto-starts the local daemon on first check with an ephemeral token passed via env and shuts it down cleanly on session_shutdown.

Quick setup:

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

aetheris install omp --self-test aetheris install omp --workspace . omp

(Omit --workspace to install globally under ~/.omp/agent/extensions/aetheris-microbrains/index.js.)

Inside OMP you get:

  • Native ctx.ui.confirm() escalation in TUI and RPC modes when a command is uncertain (instead of blindly hard-blocking)
  • Synchronous tool_result DLP secret scrubbing before the LLM sees output
  • Layer 0 protection for .omp/, .omp/extensions/, .omp/settings.json, and omp.json(c) so a prompt-injected session cannot disable its own guardrails
  • Config via env vars or .omp/settings.json ("aetheris"), plus branch-aware stats persistence across /reload (stats only — tokens are never written to disk)
  • Two slash commands: /aetheris (daemon health + counters) and /aetheris-config (effective config with masked token + session stats)

Local OMP benchmark results (explicitly separating HTTP daemon vs in-process):

Latency:

  • Warmed HTTP daemon (--host omp): 1.41-4.25ms p50 / 3.16-6.93ms p95 across tool types (bash-safe: 2.15ms p50 / 3.16ms p95, write-file: 2.24ms p50 / 4.45ms p95, read-file: 1.85ms p50 / 4.16ms p95, bash-escalate: 4.25ms p50 / 6.93ms p95)
  • In-process Python API (all types): 0.2-0.4ms p50 / 0.5-0.8ms p95

Security (22 attack vectors):

  • 100% total interception (22/22): 16/22 (72.7%) hard-blocked, 6/22 (27.3%) escalated to user confirmation, 0% missed
  • Catches rm -rf, dd, curl | sh, hardcoded keys, base64 obfuscation, /proc/environ leaks, .omp/ and git-hook tampering, SSH key exfil, and Unicode prompt tricks

Benign operations (12 cases):

  • 0% false denies (0/12): 10/12 (83.3%) auto-allowed, 2/12 (16.7%) escalated for confirmation (npm test and git add .)

Post-tool DLP and injection checks:

  • Redacts Stripe keys, AWS keys, GitHub PATs, PEM private keys, Base64-wrapped Stripe keys, and real DB URIs
  • Intentionally ignores placeholder DB passwords (like pass, changeme, example) to avoid noisy false positives
  • Flags spoofed instruction delimiters and prompt-injection payloads ()

Modeled 20-step OMP session economics (local simulation, not live API invoices):

  • Hazards executed: 0/8 (vs 8/8 without gate)
  • Wasted recovery turns: 0 (vs 24-40)
  • Tool schema tokens (25 tools): 60,000 down to 9,600 with Top-4 session-sticky narrowing (56-81% cache-adjusted net savings)
  • Total gate overhead: ~60ms across the 20-step session

Fail-closed is on by default if the daemon is unreachable; set AETHERIS_HOOK_SHADOW=1 for observe-only mode or AETHERIS_FAIL_CLOSED=0 to allow on error.

Repo: https://github.com/drtikov/microbrainsforagents OMP extension bundle: https://github.com/drtikov/microbrainsforagents/tree/main/omp-aetheris-microbrains

Disclaimer: I am the author of Aetheris Microbrains. Built it for my own coding agent workflows and adapted it for Pi and Oh My Pi. Happy to hear what breaks or what OMP-specific tools (like the Python kernel or LSP hooks) you would want guarded next.

0 Upvotes

0 comments sorted by