Repository navigation
Stroq 0.1.0
Initial public release.
Added
- Claude Code hook adapter (
stroq hook claude-code): handlesPostToolUseandPreToolUseevents forBash,Read,Write/Edit,WebFetch,WebSearch,Grep, and everymcp__*tool. - Normalizer: strips zero-width characters and tag/variation-selector code points, folds homoglyphs, and recursively decodes base64/hex/URL-encoded content up to two levels before scanning.
- ATR-compatible rule engine: loads and compiles Agent Threat Rules-format YAML rules, including PCRE-to-
RegExptranslation, and matches them against normalized content. - Rules bundle: 12 Stroq-authored rules (
rules/stroq/, Apache-2.0) covering instruction override, hidden directives, secret exfiltration, encoded execution, and related prompt-injection patterns, plus vendored ATR categories (rules/atr/, MIT). Built with a benign-corpus false-positive gate and a regex performance gate (pnpm build:rules). - Action classifier: classifies
Bashcommands and tool calls into action classes (shell.network,shell.destructive,shell.exec_encoded,fs.secrets,git.push_external,config.self,config.self_touch,mcp.side_effect, and more), including wrapper commands, encoded/eval'd execution, and self-tampering detection. - Taint-aware policy engine: evaluates classified actions against an ordered, first-match policy (
policies/default.yaml); tainted sessions getdenyon network/secret/push actions, destructive commands alwaysask, encoded execution and proven self-tampering are always denied. - Session taint store: file-locked, per-session taint state keyed by session id.
- Hash-chained audit log (
~/.stroq/audit.jsonl): every decision is appended and chainable;stroq verifychecks the chain for tampering; sensitive values are redacted before being written. - CLI commands:
init(installs hooks into.claude/settings.json, project or--user),doctor(checks Node version, rules, hooks, self-test),log(recent audit entries),verify(audit chain check),untaint(clears a false-positive session's taint). - Fail-closed behavior: if Stroq crashes while handling a high-impact tool call, the action is denied rather than silently allowed.
- Working end-to-end demo (
examples/demo/): a poisonedREADME.mdtaints the session, and the follow-upcurl | shcommand is denied.
Install: npx @stroq/cli init · npm: https://www.npmjs.com/package/@stroq/cli