# Stroq audits what your AI coding agent did and blocks it from leaking secrets, all locally. What it does

> Stroq is an Apache-2.0 tool that reads your past Claude Code, Codex and Cursor sessions to show which commands came from text the agent read, then adds hooks that deny secret egress and 'curl | sh' before they run. It's young and rules-based, but it targets a risk this year has made very real.

Published Nov 8, 2026 by TechMeasured Staff · Repos · Canonical: https://techmeasured.com/repos/stroq-local-firewall-audit-ai-coding-agents-claude-code-codex-cursor-secrets

**Stroq** is a new open-source tool that answers an uncomfortable question for anyone running AI coding agents: which of the commands my agent ran were actually dictated by something it read? It scans your recent **Claude Code**, **Codex** and **Cursor** sessions, reports which keys left the machine (by name, never value), and then installs hooks that judge each tool call before it runs. Its author posted it to Hacker News as a Show HN on **November 5**, where it drew about 90 points and 34 comments, and the GitHub repository had **208 stars** under an **Apache-2.0** licence when we checked via GitHub's API.

Why it matters: prompt injection has stopped being theoretical for coding agents. Stroq's own documentation cites research claiming fake Sentry errors served over MCP got agents to run an attacker's `npx` package 85% of the time, and an Anthropic engineering post saying users approve about 97% of permission prompts. Earlier today we reported that Claude Code's "don't ask again" setting had written secrets into over a thousand public GitHub files. A local layer that stops credentials leaving the machine, regardless of what the model decides, addresses exactly that gap.

## What it does

According to the project's listing on EveryDev.ai and its Show HN post, Stroq works in two modes.

**Looking back.** It reads up to 30 days of your existing agent sessions and produces a "session card": how many commands came from text the agent read (a README, web page, MCP result or command output) and which known secrets appeared in outbound calls. The Show HN page says old sessions can be replayed without installing anything, via `npx @stroq/cli`.

**Guarding the next session.** It installs two hooks:

- **After each tool call**, it scans what the agent just read. Content is first normalised: zero-width and tag characters are stripped, look-alike characters folded, and base64, hex and URL encodings decoded up to two levels deep. A match against roughly 600 rules, most vendored from the MIT-licensed Agent Threat Rules project, marks the session as suspect and warns the agent inline.
- **Before each tool call**, it sorts the action into one of 14 classes, such as `shell.network`, `fs.secrets`, `git.push_external` or `shell.exec_encoded`, and checks it against an ordered YAML policy where the first match wins: allow, ask or deny.

The defaults, per EveryDev's summary of the project: always deny sending secrets out, encoded execution, tampering with Stroq's own config, and actions dictated by flagged content. In a tainted session it also denies network fetches, secret access and pushes to external remotes. Destructive commands, and commands copied from tool output, always prompt.

## The details that stand out

- **Secrets are hashed, not stored.** Values from `.env*` files, `~/.aws/credentials`, `~/.npmrc`, `~/.netrc`, `~/.docker/config.json` and credential-like environment variables are indexed as salted hashes. A blocked call names the variable and file, not the value.
- **Fail-closed.** If the engine errors on a high-impact action, the action is denied. Arguments too large to scan (over 2 MiB) are denied rather than passed through.
- **Provenance.** It keeps a redacted trace of actionable items seen in tool output (package names, `curl | sh` lines, URLs) and cites the source when a later command matches one.
- **Tamper-evident log.** The audit log is hash-chained JSONL; `stroq verify` checks it.
- **Self-test.** `stroq attack` replays 13 recorded incidents against your policy and exits non-zero if any get through, so it can run in CI. `stroq canary` plants a decoy secret.

## Where it plugs in

| Agent | Integration |
|---|---|
| Claude Code | Native hooks (`.claude/settings.json`) or plugin |
| Cursor | Native hooks (no blocking edit hook yet) |
| Codex | Native hooks ("ask" becomes "deny", since Codex can't prompt) |
| Copilot CLI, Windsurf | Native hooks |
| Any MCP client, incl. Claude Desktop | `stroq mcp` stdio proxy |

Install is `npx @stroq/cli init`, which needs **Node 22 or newer**. The project says everything runs locally with no account and no telemetry; that's the author's claim, and the code is there to check.

## Caveats

This is a young project from a one-person developer (EveryDev lists AGGIB in Astana, Kazakhstan); the repository was created in September. Detection is rule- and pattern-based, which several Hacker News commenters questioned: one argued for full gVisor isolation with a default-deny egress proxy instead of trusting the agent harness's tool boundary, and another suggested an eBPF backend to catch more adversarial cases. Hooks only see what the agent reports as tool calls; a sandbox or VM remains the stronger boundary. A planned local daemon with an ONNX classifier would replace today's start-Node-per-call design.

**Who should try it:** developers running Claude Code, Codex or Cursor with real credentials on their machine. The read-only session audit is a low-risk first step: run it on last month's sessions and see how many commands your agent copied from something it read.


## Sources

1. [GitHub — AGGIB/Stroq](https://github.com/AGGIB/Stroq)
2. [EveryDev.ai — Stroq](https://www.everydev.ai/tools/stroq)
3. [Zeli (Hacker News mirror) — Show HN: Stroq – a local audit of what your coding agent did and why](https://zeli.app/story/50380704)
