CLI reference
thaghr run
Run a fault-injection campaign against one agent.
thaghr run <example> [options]
| Flag | Default | Description |
|---|---|---|
example (positional) | — | Path to a directory containing agent.py |
--trials | 10 | Number of trials to run |
--max-cost | 1.0 | Hard cost cap in USD, the campaign stops and exits non-zero if exceeded |
--fault-rate | 0.0 | Probability an HTTP 429 fires per call, 0 disables fault injection |
--seed | 0 | RNG seed, for a reproducible fault sequence |
--output | thaghr-results.csv | Where to write per-trial results |
--k | 1 | k for the pass^k headline metric |
--fail-under | — | Exit non-zero if the primary metric (pass^k, or GDS fallback) is below this threshold. Omit to run informationally without gating. |
--pretty | off | Colorized report card via rich (pip install thaghr[pretty]) |
thaghr compare
Run a baseline (fault-free) and a faulted campaign back to back,
report robustness and fault_tolerance.
thaghr compare <example> [options]
| Flag | Default | Description |
|---|---|---|
example (positional) | — | Path to a directory containing agent.py |
--baseline-trials | 10 | Trials for the fault-free run |
--fault-trials | 10 | Trials for the faulted run |
--max-cost | 1.0 | Cap applied to each campaign separately, not combined |
--fault-rate | 0.2 | Probability an HTTP 429 fires per call in the faulted campaign |
--seed | 0 | RNG seed |
--output-dir | . | Where to write baseline.csv and faulted.csv |
--k | 1 | k for the pass^k headline metric |
--pretty | off | Colorized report card via rich |
thaghr proxy
Run thaghr as an HTTP proxy in front of an OpenAI-compatible endpoint.
Point any OpenAI-compatible SDK's base_url at the proxy to get fault
injection without changing your agent's code at all.
thaghr proxy --upstream https://api.openai.com [options]
| Flag | Default | Description |
|---|---|---|
--upstream | — | Required. Upstream OpenAI-compatible base URL |
--fault-rate | 0.2 | Probability an HTTP 429 fires per call |
--seed | 0 | RNG seed |
--host | 127.0.0.1 | Host to bind |
--port | 8135 | Port to bind |
Point your SDK at it:
import openai
client = openai.OpenAI(base_url="http://127.0.0.1:8135/v1")
Next: GitHub Action to run any of this in CI.