$ show usestrix/strix
Strix is an open-source, AI-powered penetration testing tool that orchestrates multiple LLM-driven agents to autonomously discover and validate security vulnerabilities in web applications, APIs, source code, and infrastructure. The system operates as a CLI application with three interface surfaces: a headless/non-interactive mode for CI/CD pipelines, a feature-rich Go Bubble Tea TUI for interactive scanning, and a local React web viewer for reviewing results. Scans run inside Docker sandboxes with a Caido interception proxy sidecar, allowing agents to execute shell commands, browse applications, modify requests, and apply patches. The architecture follows a multi-agent coordination pattern where a root agent delegates tasks to child agents, tracks coverage, manages budgets, and produces comprehensive reports including CVSS-scored vulnerabilities, proof-of-concept exploits, and fix recommendations. The codebase demonstrates strong engineering practices with extensive test coverage, atomic file operations, output bounding, MCP tool integration, and a sophisticated IPC protocol between the Python backend and Go TUI. Key features include: multi-agent orchestration with parent/child messaging and budget enforcement; Docker sandboxed execution with Caido proxy integration; support for multiple LLM providers (OpenAI, Anthropic, LiteLLM, Bedrock, etc.); MCP (Model Context Protocol) tool integration; SARIF and PDF report generation; cloud platform integration for managed scans; and a local web viewer with live transcript and vulnerability triage. The repository is primarily an application but includes data-oriented components like LLM cost tracking, coverage ledgers, and vulnerability deduplication using LLM-based comparison.
The LLM identified 5 files worth highlighting for reuse:
Provides atomic, permission-restricted file writing for secrets (e.g., API tokens, auth cookies). Uses tempfile + os.replace to ensure writes are never partial, sets 0o600 permissions, and cleans up temp files on failure. Self-contained with only standard library dependencies, making it directly reusable in any Python project that needs to safely persist sensitive strings to disk.
Strictly validates external HTTPS URLs for use in agent tools (web search, browser, etc.). Rejects localhost, private IP ranges, and ambiguous hostnames using ipaddress and urllib.parse. Ensures only safe, public HTTPS URLs are passed to external services. Self-contained and easily extractable for any application that needs to sanitize user-supplied URLs.
Implements byte-aware head/tail truncation for large tool outputs, reserving space for a truncation notice and optionally spilling oversized content to a workspace file via an injectable writer. Prevents LLM context from being flooded while preserving the most relevant beginning and end of output. The pattern is generic and can be reused in any system that needs to bound the size of LLM tool results.
Provides a structured, sink-based logging system for LLM provider calls. Each request is captured as an LlmRequestEvent dataclass with tokens, cost, timing, provider request IDs, and error details. Uses context variables to bind events to agents and supports multiple sinks (console, file, PostHog). The provider-agnostic request ID extraction from headers/error bodies is a non-trivial pattern that can be adapted to any LLM observability pipeline.
Handles safe file output for penetration test reports: atomic writes via tempfile+rename, CSV injection mitigation by prefixing formula-triggering characters with apostrophe, and safe markdown fence computation to prevent breakout from attacker-influenced content. The CSV injection protection and atomic write patterns are directly reusable in any application that generates user-facing data exports.