r/PiCodingAgent • • 9h ago

Question is there any way other than trust to determine that certain less established api providers are not spying on you?

3 Upvotes

holy shit it really is impossible to get an attempt at an answer to a question on reddit that isn't the equivalent of whipping your dick out and jumping up and down spinning it in circles


r/PiCodingAgent • • 8h ago

Question What are you using for linting and code formatting in Pi?

7 Upvotes

Hey everyone!

I'm need small help, what you guys are actually using for linting and syntax formatting in Pi.

Are you using any specific tools, extensions, or configurations to keep your code clean, consistent, and properly formatted?

Would love to hear some recommendations


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

0 Upvotes

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.


r/PiCodingAgent • • 12h ago

Question OpenCode flags for openAI usage limits but I got plenty left for the week & Codex works fine

Thumbnail reddit.com
0 Upvotes

Hi, I have tested this on Pi and I get the exact same issue. Trying to reach more people.


r/PiCodingAgent • • 54m ago

Discussion How to have Pi agent run while laptop is asleep

2 Upvotes

Sorry, I feel like I'm missing something obvious but can't for the life of me figure this out.

My setup is i have a laptop and a remote AI workstation. Pi agent on the laptop then runs the LLMs served through that workstation running from lemonade AI server.

I know there are multiple ways to do this with tmux or even using ( & with nohup) I'm just like there has to be a way to do this natively right?

I just need to get it to keep working even when the laptop is asleep or closed


r/PiCodingAgent • • 10h ago

News Built a local, zero-dep Pi extension for pre-flight safety & tool-surface narrowing (Aetheris Microbrains, <2ms p95 on CPU)

0 Upvotes

I have been working on Aetheris Microbrains and just added native Pi Coding Agent support as a zero-dependency Level 3 extension.

It is a deterministic, CPU-only pre-flight gate (sub-2ms p95 locally) that hooks directly into Pi's tool_call and tool_result lifecycle events. It catches dangerous shell commands, AST/code hazards, protected-path edits, and secret leaks before they execute or hit the LLM.

Why I built it for Pi specifically:

Pi's extension API is a great fit because tool_call gives us native ctx.ui.confirm() escalation in TUI and RPC modes (instead of blindly hard-blocking ambiguous commands), and tool_result lets us scrub secrets synchronously before the model sees tool output.

30-second setup:

git clone https://github.com/drtikov/microbrainsforagents

cd microbrainsforagents

pip install -e .

aetheris install pi --workspace .

aetheris-daemon --http --host pi --port 8765

Then launch pi (or run /reload). Inside Pi you get two commands:

- /aetheris (quick daemon health check + session counters)

- /aetheris-config (effective config with masked token + session stats)

Zero Node dependencies and zero build step — it is a single ESM file loaded directly by Pi, configurable via env vars or .pi/settings.json ("aetheris").

What the 4-layer gate does:

- Layer 0: Protects sensitive & control-plane paths (.pi/, .git/, .ssh/, .env*)

- Layer 1: Polyglot AST + shell inspection (catches eval/exec, obfuscated base64 execution, secret leaks, rm -rf, curl | sh, breaking changes)

- Layer 2: Deterministic Top-4 MoE tool routing + conformal abstention (narrows 32 tools down to 4 with session-sticky caching)

- Layer 3: Escalates uncertain actions to you via ctx.ui.confirm() in TUI/RPC (fail-closed in non-interactive runs)

Local CPU benchmarks (reproducible scripts in examples/, no live API calls):

- 25-step agent loop: 64,800 down to 12,312 schema tokens (81% reduction, ~52k tokens saved/loop), 0 missed hazards, 0 false positives, 0.95ms p95

- Agent security & anti-evasion suite: 22/22 attacks caught (100% TPR), 0/12 benign false positives (0% FPR), 0.38ms p50 / 2.1ms p95

- SWE-bench Lite (300 real gold diffs): 297/300 allowed/escalated (3/300 denied on eval/exec patterns, 0 AST syntax false positives), 36.7% schema saved, 1.76ms p50 / 4.5ms p95

- Frozen 120-task prompt-cache advisor: 100% Recall@4, 0 dropped tools, 56.7% cache-adjusted net token savings (session-sticky)

- Counterfactual safety gate: blocks obfuscated base64 + exec payloads and breaking signature regressions

Modeled token economics (local estimate, not live invoices): ~52k prefill tokens saved per 25-step loop (~ \$0.079/loop at \$1.50/M input, or ~ \$118/month at 50 loops/day), plus ~2.1 Wh avoided per loop, all running locally on CPU so your code never leaves your machine for the gate.

Quick FAQ:

- Does it replace my LLM? No, it is a pre-filter. Your LLM still does all reasoning; Microbrains narrows the tool surface, scrubs secrets, and blocks dangerous actions locally.

- What if the daemon is down? Fail-closed by default. Set AETHERIS_FAIL_CLOSED=0 to allow, or AETHERIS_HOOK_SHADOW=1 for observe-only shadow mode.

- Does it work with any provider/model? Yes, it is model-agnostic (Anthropic, OpenAI, Google, local models via Pi).

Repo: https://github.com/drtikov/microbrainsforagents

Pi extension folder: pi-aetheris-microbrains/

Reproducible benchmarks: examples/05_reproducible_25step_benchmark.py, examples/07_swebench_lite_gate_benchmark.py, examples/08_frozen_advisor_benchmark.py, examples/10_agent_security_benchmark.py

Disclaimer: I am the author of Microbrains. Built it because I wanted fast, deterministic local guardrails for my own coding agent workflows and figured other Pi users might find it useful. Try it out and let me know what breaks — happy to help debug any edge cases.


r/PiCodingAgent • • 12h ago

Discussion Some painful issues with extensions on android

Thumbnail
github.com
0 Upvotes

I have built this agent called SATURN for android that can do pretty much anything but i am having problem with the extension supports most of these works but some just dont

Is there anything something like translation layer i can use ?

I am not complaining i just need your thoughts on this so android cam have the best local agent.


r/PiCodingAgent • • 7h ago

Plugin 4-tool Rust web extension for Pi: search, fetch, crawl, and screenshots (no API keys, no headless browser for reading, 0$, Stealthy)

34 Upvotes
pi install npm:donsetch

So, Been a while since i have posted here about donsetch, it has gone through a lot of massive updates, so i thought i would post again.

It works natively on pi (Win, linux, mac support), You dont need any keys, just tun the command above and its done, its simple as shit, as you can see in my demo video,

Just uninstall it If you dont like it.

IT IS COMPLETELY FREE, you dont have to pay a dime for it, even the local search is free, fast and actually good , however grab a free api key from a search provider like exa or tinyfish if your workload is heavy.

Now if you want to, Read the technical slop my agent wrote for this post below this:

Repo (AGPL-3.0) + 54-second demo

Built to sit cleanly inside Pi

  • ~2,000 tokens total across all 4 tool definitions. No giant prompt file eating your context window.
  • Compact TUI cards: Pi shows a short status line and one-line preview instead of dumping raw markdown into your terminal, while the model still gets the real content.
  • Real Esc cancellation: aborting a call in Pi stops the in-flight fetch or crawl server-side cleanly.
  • Crash-safe worker: runs under a local supervisor so if anything kills the worker process, it restarts on its own.

No browser in the reading path

Instead of spawning Playwright for every link (or getting 403'd with plain curl), page reads run in one local Rust process:

  • 8 measured client profiles with matching TLS, HTTP/2, header order, and isolated per-site cookies.
  • Embedded V8 when JS is actually needed for WAF challenges or client-rendered SPAs, with zero CSS layout or painting. In a cold 17-site SPA check (Linear, Hugging Face, npm, Ashby, Angular docs, Bluesky, Mastodon, etc.), all 17 returned content without touching a browser.
  • Learns and replays plain HTTP: when a SPA pulls its data from an API endpoint during a JS run, DonSeTch stores that request template and replays it over plain HTTP on repeat or sibling pages without booting V8 again. Learned routes survive restarts.
  • Defended-site numbers (28 targets, home IP): cold runs got content on 23/28 targets (46/56 rounds, 1.16s median vs curl's 20/56). With learned state and no page cache, 24/28 targets at 0.76s median.

web_screenshot is the only tool that launches a browser, using your installed Chromium/Chrome/Edge in a throwaway profile (or a remote CDP endpoint if you run in Docker or on a NAS).

Stops blowing up your context window

  • web_fetch views: Pi can ask for focus (relevant passages only), toc then section (grab the outline, read one part), must_contain (phrase, regex, or amount checks like $1.5bn matching US$1,500 million), or since_last (diffs only). Batches up to 12 URLs in one call.
  • PDFs and images: PDFs get the same reading controls, combining PDFium text and page pixels for tables, reading order, and forms (plus optional local OCR on scans). Direct image URLs come back as native image blocks.
  • web_crawl plans before fetching: maps the site first (llms.txt, sitemaps, feeds, hub links), picks pages around your topic, and returns a compact digest with pN handles so Pi only opens full pages offline when it needs the detail. Jobs resume and repeat crawls skip unchanged pages.

Keyless search that holds its own

Search works right after install with zero keys and zero model downloads. For a completely local, zero-key setup, it holds up well for everyday coding and research: it fuses keyless web engines (Google CSE, Exa MCP, Parallel MCP, Keenable, Bing, DDG, Brave, Yandex) with direct first-party sources (GitHub, crates.io, npm, PyPI, Stack Exchange, Wikipedia, arXiv, OpenAlex) and ranks results locally.

It also includes keyless image search with optional 3x3 rank-badged contact sheets if you want Pi to look over reference images.

One heads-up: if you spam queries hard from one IP, engines will temporarily rate-limit you (it backs off cleanly and rotates lanes, so normal agent use is fine). If you do heavy search volume, you can always grab a free API key from Exa, Tavily, TinyFish, Brave, or Serper and plug it in for search while keeping the local fetch and crawl engine.

Honest benchmarks and limits

I had an agent test DonSeTch against paid Firecrawl Cloud (Not the free oss version since that wouldnt be competitive with donsetch )on real tasks:

  • Fetch: faster on 9/10 shared targets (0.83s vs 2.00s median), with cleaner code blocks and structured PDF tables.
  • Focused crawl: 27% fewer page fetches (19 vs 26) and 6-22x smaller output. On HTTPX docs it grabbed the 2 pages asked for, while Firecrawl read 6 and missed /async/.
  • Search: Firecrawl Cloud beat DonSeTch on search relevance in that Nov 16 session (6-1 with 2 ties). I have since added keyless Exa MCP, Parallel MCP, and Keenable to the default pool, though I have not run a fresh head-to-head yet.

Hard limits upfront: it will not log into accounts and will not solve human CAPTCHAs (Turnstile, DataDome, etc.). When it hits a login wall or human check, it tells Pi plainly instead of returning a "please enable JavaScript" page as fake content.

Full Firecrawl Cloud comparison

Try pi install npm:donsetch and let me know what sites trip it up or break on your machine.


r/PiCodingAgent • • 2h ago

Plugin My coding agents run on my home server, so I built a btop-style monitor that groups processes by the app that started them

3 Upvotes

I do all my agent work on a home server. When you run multiple agents, top shows me a pile of `rustc`, `cc` and `bash` processes, and I can't tell which agent or app they belong to. I also want to know how close I am to my plan limit before I start another long run.

So I built sysra, a terminal system monitor in Rust for Linux and macOS.

It follows each process's parent chain back to the app that launched it, so the shell and compiler that Claude Code started show up under Claude Code. Brave gets one row instead of a dozen renderer processes. Press `/` to filter by app, process name or port, and Enter to look inside a row.

The agents panel shows tokens today and over the last 7 days for Claude Code, Codex, Pi, OpenCode and Hermes. For Claude Code and Codex it also shows the 5-hour and weekly limits with the time until reset. It only reads their local session files, and the live Claude limit request can be turned off.

There are eight built-in themes, press `t` to cycle them.

Install it with:

curl -fsSL https://raw.githubusercontent.com/utpalsinghdev/sysra/main/install.sh | sh

If it deserves a star, here the repo:

GitHub: https://github.com/utpalsinghdev/sysra

It's MIT and built around what I run on my own server, so it will group some apps wrong on yours. If it does, open an issue with the app name and how you launch it. Fork it, break it, send a PR.