Stroq: Local Security Audit and Guardrails for AI Coding Agents
Overview
Stroq is a local security platform designed to audit and guard AI coding agents, including Claude Code, Cursor, and the Codex CLI. It provides visibility into agent behavior by tracking which commands are executed based on content the agent has read, while simultaneously monitoring for the accidental exfiltration of sensitive credentials. The tool operates entirely locally with no telemetry, requiring only Node.js 22 or newer.
Core Functionality
Stroq functions both as an after-the-fact audit tool and a real-time guardrail system.
Auditing Past Sessions
Users can analyze the last 30 days of agent activity using the stroq replay and stroq sent commands. These tools parse local session transcripts to identify:
- Secret Exposure: It flags if credentials (such as AWS keys or API tokens) were potentially sent to external services or exposed to the AI model. It explicitly displays key names while masking actual values.
- Provenance Tracking: It traces commands back to specific files or text the agent previously read, helping users understand why an agent decided to execute a particular action.
Real-time Guardrails
By running npx @stroq/cli init, users can install hooks that intercept tool calls before they execute. These hooks:
- Deny risky patterns like
curl | sh. - Block outbound network calls that contain known secrets.
- Prompt the user for confirmation when a command repeats text the agent previously read.
Security and Privacy
Stroq emphasizes a privacy-first architecture. It does not send data to external servers, does not require an account, and does not use telemetry. All analysis is performed on the local machine, and the console interface runs on 127.0.0.1. The tool is designed to be a filter for agent actions rather than a full sandbox, and it relies on hooks that vary in capability depending on the specific agent and version being used.
Community Feedback and Future Directions
Discussion surrounding the project has highlighted potential avenues for further development, including:
- eBPF Integration: Some users suggested that moving to an eBPF-based backend could improve security coverage by capturing adversarial scenarios at the kernel level, though this would limit the tool to Linux environments.
- Daemonized Monitoring: Suggestions have been made for a background daemon that provides real-time alerts via a menubar application, allowing for immediate redaction or management of flagged agent actions.
"You could cover a lot more adversarial scenarios with an ebpf backend. It needs linux, but with all the patches going around, you should be doing all your dev in a VM anyway." — @maven29
Getting Started
Stroq is distributed via npm. Key commands include:
npx @stroq/cli: Displays a summary card of recent agent sessions.npx @stroq/cli init: Installs security hooks into your agent configuration.npx @stroq/cli console: Launches a local web interface to manage rules and review session history.npx @stroq/cli attack: Runs a suite of 36 known attack patterns in a sandboxed environment to test current policy effectiveness.