feat: Add live tracing mode for complete audit trail#300
Open
gizmo-dev wants to merge 3 commits intousestrix:mainfrom
Open
feat: Add live tracing mode for complete audit trail#300gizmo-dev wants to merge 3 commits intousestrix:mainfrom
gizmo-dev wants to merge 3 commits intousestrix:mainfrom
Conversation
Closes usestrix#285 This adds a comprehensive live tracing system that records a complete audit trail of a run in real-time, streaming to disk as events happen. This is essential for professional pentesting where evidence of actions taken is required, and makes debugging agent behavior much easier. ## Features - **JSONL trace format**: Clean, structured trace output with timestamps and IDs - **CLI integration**: Enable via `--trace` flag or `STRIX_TRACE=1` env var - **Secret redaction**: Optional redaction via `--redact-secrets` flag - **Custom output path**: `--trace-output` to specify trace file location ## Events Captured - `trace_start` / `trace_end`: Run lifecycle - `llm_request` / `llm_response` / `llm_error`: All LLM interactions - `tool_call` / `tool_result`: Every tool invocation with args and results - `agent_created` / `agent_status_update`: Agent lifecycle events - `message`: All agent/sub-agent messages - `state_change`: Key state transitions - `vulnerability_found`: Discovered vulnerabilities ## Usage ```bash # Basic tracing strix --target https://example.com --trace # With secret redaction strix --target https://example.com --trace --redact-secrets # Custom output path strix --target https://example.com --trace --trace-output ./audit.jsonl # Via environment variables STRIX_TRACE=1 STRIX_REDACT_SECRETS=1 strix --target https://example.com ``` ## Files Added/Modified - `strix/telemetry/live_tracer.py`: Core LiveTracer class - `strix/telemetry/redactor.py`: SecretRedactor for sensitive data - `strix/config/config.py`: Trace configuration options - `strix/interface/main.py`: CLI argument handling - `strix/llm/llm.py`: LLM request/response hooks - `strix/tools/executor.py`: Tool call/result hooks - `strix/agents/base_agent.py`: Agent lifecycle hooks - Tests with 39 new test cases (all passing)
Contributor
Greptile OverviewGreptile SummaryAdded a comprehensive live tracing system that streams structured JSONL audit logs to disk in real-time, capturing complete execution traces of penetration testing runs. Key Changes:
Implementation Quality:
Confidence Score: 5/5
Important Files Changed
|
|
FINALLY! @gizmo-dev |
The sandbox image's entrypoint no longer starts the tool server automatically. This fixes the 'Tool server failed to start' error by: 1. Adding CAIDO_PORT env var required by the entrypoint 2. Starting the tool server via exec_run after container initialization
Adds a new --trace-verbose flag for non-interactive mode that outputs human-readable trace events to the console in real-time, similar to TUI output but in plain text format. Features: - New ConsoleTracer class for formatting trace events with Rich - Shows LLM requests/responses, tool calls, agent events in real-time - Uses emoji icons and color coding for different event types - Truncates long output for readability - Only works with --non-interactive mode Usage: strix --target https://example.com --trace-verbose --non-interactive Files changed: - strix/telemetry/console_tracer.py - New console formatter - strix/telemetry/live_tracer.py - Added verbose parameter - strix/interface/main.py - Added --trace-verbose CLI flag - strix/telemetry/__init__.py - Export ConsoleTracer
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a live tracing mode that records a complete audit trail of runs in real-time, streaming structured events to disk as JSONL.
Closes #285
Features
--trace/STRIX_TRACE=true- Enable tracing--trace-output <path>- Custom output path--redact-secrets/STRIX_REDACT_SECRETS=true- Enable secret redactionUsage
Files Changed
strix/telemetry/live_tracer.py- Core LiveTracer classstrix/telemetry/redactor.py- SecretRedactor for sensitive data maskingstrix/llm/llm.py- LLM request/response tracing hooksstrix/tools/executor.py- Tool call/result tracing hooksstrix/agents/base_agent.py- Agent lifecycle tracing hooksstrix/config/config.py- New config optionsstrix/interface/main.py,cli.py,tui.py- CLI integrationtests/telemetry/test_live_tracer.py- LiveTracer teststests/telemetry/test_redactor.py- SecretRedactor testsTesting
All tests pass:
Example Trace Output
{"event_type":"trace_start","timestamp":"2026-02-03T...","run_id":"portal-gizmolab-io_0385","seq":0} {"event_type":"agent_created","timestamp":"...","agent_id":"root","agent_name":"StrixAgent","seq":1} {"event_type":"llm_request","timestamp":"...","model":"anthropic/claude-sonnet-4-5-20250514","seq":2} {"event_type":"llm_response","timestamp":"...","model":"anthropic/claude-sonnet-4-5-20250514","tokens":{...},"seq":3} {"event_type":"tool_call","timestamp":"...","tool_name":"thinking","seq":4} ...