loki run
Launch an autonomous chaos session against a target URL.
Usage
bash
loki run <URL> [flags]
Flags
| Flag | Type | Default | Description |
|---|---|---|---|
| --duration, -d | int | 10 | Execution duration in seconds (falls back to target.timeout_seconds in .loki/config.yaml). |
| --headed | bool | false | Run browser in visible mode (default is headless). |
| --persona, -p | rage-clicker | novice-chaotic | network-tormentor | adversary | swarm | all | none | — | Synthetic chaos persona to simulate (falls back to chaos.default_persona in .loki/config.yaml or rage-clicker when omitted). |
| --swarm, -s | bool | false | Run Swarm Mode (orchestrates all 4 chaos personas in coordinated assault waves). |
| --journey, -j | string | — | Recorded journey blueprint name (from .loki/journeys/) to guide the chaos mutation attack. |
| --browser, -b | chromium | firefox | webkit | chromium | Browser engine to run the chaos attack in. |
| --device, -m | string | — | Mobile device alias from devices.py, e.g. iphone-15, pixel-7, ipad-pro, galaxy-s24. |
| --orientation | portrait | landscape | portrait | Screen orientation for mobile device emulation. |
| --concurrency, -c | int | 1 | Open N independent browser lanes and fire the same action simultaneously to probe for race conditions. |
| --target-selector | string | — | CSS selector for the --concurrency probe's synchronized click. |
| --api-chaos / --no-api-chaos | bool | true | Enable or disable API semantic fault injection (500s, corrupt JSON, delays, schema stripping). |
| --fault-rate | float | 0.3 | Probability (0.0 to 1.0) of injecting faults into eligible API requests. |
| --auth-chaos / --no-auth-chaos | bool | true | Enable or disable mid-flight auth token invalidation and cookie eviction. |
| --rules / --no-rules, -r / -nr | bool | true | Evaluate business assertions in .loki/rules.md using AI reasoning. |
| --report / --no-report | bool | true | Generate standalone visual HTML report with video and AI scorecard. |
| --open, -o | bool | false | Automatically open the generated HTML report in the default browser. |
| --auto-heal, -H | bool | false | Autonomously synthesize, apply, and verify a code patch if crashes are detected. |
| --ci | bool | false | Strict CI/CD gate (exits with code 1 on crashes or rule violations and writes GITHUB_STEP_SUMMARY). |
| --strict | bool | false | Fail with exit code 1 if any crash or business rule violation is detected. |
| --authorized | bool | false | Confirm ownership/permission for non-localhost URLs without an interactive prompt. |
| --seed | int | random | Seed for pseudo-random number generators to achieve deterministic chaos behavior. |
Examples
bash
# Standard unguided assault (reads target.default_url from .loki/config.yaml if omitted)loki run http://localhost:8000 --duration 10 --headed# Swarm mode across all 4 personas + auto-open HTML reportloki run http://localhost:8000 --swarm --open# Mobile emulation in landscape + skip AI business rules evaluationloki run http://localhost:8000 --device iphone-15 --orientation landscape --no-rules# Guided mutation assault using a recorded journey blueprintloki run http://localhost:8000 --journey checkout_flow --persona adversary --seed 42# Concurrency race probe: 5 synchronized browser lanes clicking #pay-button simultaneouslyloki run http://localhost:8000 --concurrency 5 --target-selector "#pay-button"# Custom API & Auth Chaos tuningloki run http://localhost:8000 -p network-tormentor --api-chaos --fault-rate 0.5 --auth-chaos# Closed-loop auto-healing on crashloki run http://localhost:8000 --auto-heal# Non-interactive CI/CD quality gate against an authorized staging hostloki run https://staging.example.com --authorized --ci --strict --no-report
Command builder
generated command
loki run http://localhost:8000 --swarm
