Native macOS resilience-testing tool: inject controlled failures (network, CPU/memory, disk, filesystem, process, dependency) and verify how apps respond — with honest REAL/SIMULATED fault labels, verified restoration, replay, recipes, and a CLI.
Swift
0
7 commits
updated Sep 27, 2026
Break your app before your users do.
Chaos is a native macOS resilience-testing tool for deliberately introducing controlled failures into development environments and verifying how applications respond: network degradation, CPU and memory pressure, disk-near-full simulation, filesystem and permission failures, process kills, dependency outages, and seeded random chaos — all bounded, logged, reversible, and observable.
Your app works perfectly. That's the problem.
Status: developer preview. The engine, safety model, and core workflows are real and tested; the UI has not been broadly validated across machines. Expect rough edges. Report anything you hit — see Contributing and Security.
Applications are normally tested under ideal conditions. Real systems get: network failures, latency and packet loss, DNS outages, CPU and memory pressure, process termination, dependency downtime, near-full disks, denied file access, and more. Chaos lets you deliberately reproduce those conditions on demand, observe what your app actually does, and verify that restoration returns the machine to a verified-clean state — with evidence, not assumptions.
SWIFT_VERSION = 6.0, MACOSX_DEPLOYMENT_TARGET = 14.0)Grab Chaos-v<version>.pkg from GitHub Releases and run it.
What it does:
/Applications (standard Installer prompt;
upgrading over an existing install replaces the app and leaves your data in
~/Library/Application Support/Chaos untouched)/usr/local/bin/chaos → the CLI inside the app bundle, so
chaos works from Terminal without the app running. The installer never
overwrites an existing file there that isn't a Chaos symlink.Signing status, honestly: preview packages and zips are ad-hoc signed and not
notarized, so Gatekeeper will warn on first launch of a downloaded copy
(right-click → Open, or remove the quarantine attribute). Building from source
has no such prompt. Developer ID signing + notarization is wired in the release
pipeline and activates automatically once signing credentials are configured
(see RELEASING.md).
To uninstall: drag /Applications/Chaos.app to the Trash and
rm /usr/local/bin/chaos (only if it's the Chaos symlink). User data in
~/Library/Application Support/Chaos is never removed by the installer.
open Chaos.xcodeproj
Targets:
| Target | Product | What it is |
|---|---|---|
Chaos | Chaos.app | The native SwiftUI app |
chaos | chaos CLI | Same engine, headless — for scripts, CI, Makefiles |
chaos-stress | worker binary | Purpose-built CPU/memory load generator |
ChaosKitTests | test bundle | Engine, model, safety, and persistence tests |
Press ⌘R to run the app. Select the Chaos scheme and run tests with ⌘U.
# 1. Build the engine, CLI, and stress worker (Swift Package Manager)
cd ChaosKit && swift build && cd ..
# 2. Build the app — a build phase embeds the CLI and stress worker
xcodebuild -project Chaos.xcodeproj -target Chaos -configuration Debug build
# Product: build/Debug/Chaos.app with
# Contents/MacOS/Chaos the app
# Contents/MacOS/chaos-stress CPU/memory load worker
# Contents/Helpers/chaos the CLI
# 3. Ad-hoc sign (no Apple Developer account needed)
codesign --force --sign - build/Debug/Chaos.app
# 4. Run the test suite
cd ChaosKit && swift test
All steps verified on a clean checkout.
Development vs release CLI installs, clearly separated:
Tools/install-cli.sh builds the CLI in release mode and
installs it into your locally built app bundle — no sudo, no system changes..pkg postinstall adds /usr/local/bin/chaos (see above).Maintainer release tooling (.pkg + .zip + checksums + manifest, optional
Developer ID signing/notarization) lives in Tools/Release/ — see
RELEASING.md.
The product loop: choose an app → define failure conditions → run experiment → observe behavior → evaluate assertions → diagnose failure → restore system → replay → verify fix.
Key concepts:
chaos replay <id> or the Replay button re-runs it exactly. Replay uses the same experiment plan and seed; system scheduling may introduce timing differences..build/out/Products/Debug/chaos list faults|scenarios|suites|recipes|targets
.build/out/Products/Debug/chaos run terrible-wifi --duration 120 --yes --seed 842913 --json
.build/out/Products/Debug/chaos replay <record-id> --json
.build/out/Products/Debug/chaos suite <suite-id> --json
.build/out/Products/Debug/chaos status --json
.build/out/Products/Debug/chaos stop
.build/out/Products/Debug/chaos restore
.build/out/Products/Debug/chaos records
.build/out/Products/Debug/chaos report <id> --format md|json|csv [--out PATH]
--yes skips the interactive safety confirmation (for CI). --json emits
machine-readable output; run exits 0 on pass, 1 on failure, 3 on
warning/inconclusive, 4 on stop — usable directly in CI gates.
The CLI runs headless: privileged fault activation fails fast with an honest message instead of opening a GUI authorization dialog mid-script. Run once inside the app to authorize pf, or run the CLI as root in CI containers.
ChaosKit/ # The engine — no UI, shared by app + CLI
Models/ # Fault catalog, experiment/scenario/record models
Engine/ # ExperimentEngine, restoration ledger, checkpoints,
# random-chaos planner, monitoring, persistence, reports
Faults/ # Network (pf/dummynet), resources (stress workers),
# storage/filesystem, process/dependency, environment
Chaos/ # SwiftUI app: dashboard, live view, builder, monitors
Tools/ # Icon generator, install scripts
Every fault is a FaultRunner registered by FaultID; scenarios compose
bindings; experiments compose both. Adding a fault = one descriptor + one runner.
macOS does not permit apps to unplug hardware, revoke TCC privacy grants, or change the system clock — so Chaos never pretends it can. The fault library (49 faults) is explicitly classified, and the UI, safety review, reports, and CLI all preserve the distinction:
| Class | Meaning | Examples |
|---|---|---|
| REAL | Genuinely executed against the OS | pf/dummynet network faults, CPU & memory pressure via a purpose-built worker, real sparse-volume disk fill, real file/permission manipulation, process kill/pause, dependency port blocking, real unmountable scratch volumes |
| PRIVILEGED | Real but needs one-time OS authorization | Offline mode, latency, packet loss, bandwidth cap, DNS failure (pf + dummynet). The app prompts once; the CLI fails fast with an honest message instead of opening a GUI dialog |
| SIMULATED | Faithful stand-in where macOS forbids the real thing | Clock skew/DST/rollover (no documented API to change the system clock), privacy-grant prompts (TCC cannot be scripted), low battery, device unplug |
| GUIDED | A checklist drill plus any real pieces that are possible | Device disconnect walkthrough, manual custom conditions |
Run chaos list faults to see the class of every fault (runnable/guided,
[SIMULATED] marks). The full catalog with per-fault capability notes lives in
ChaosKit/Sources/ChaosKit/Models/Fault.swift
— each descriptor documents why privilege is needed, what it affects, and how
restoration is verified.
Your failure tests stay on your Mac. Nothing is uploaded.
cd ChaosKit && swift test
75 XCTest cases (+ a swift-testing suite) cover the engine, models, safety
counters, persistence round-trips, replay identity, recipes, scorecard
aggregation, and the privilege model. See CONTRIBUTING.md before adding tests
that touch real system state.
Chaos deliberately manipulates system conditions, so its security surface is unusual. Please read SECURITY.md before reporting.
See CONTRIBUTING.md. Safety-relevant changes get extra scrutiny — please read the safety expectations there first.
Chaos is released under the MIT License.
7 commits
Swift
96.8%
Shell
3.2%
Native macOS resilience-testing tool: inject controlled failures (network, CPU/memory, disk, filesystem, process, dependency) and verify how apps respond — with honest REAL/SIMULATED fault labels, verified restoration, replay, recipes, and a CLI.
Swift
0
7 commits
updated Sep 27, 2026
Break your app before your users do.
Chaos is a native macOS resilience-testing tool for deliberately introducing controlled failures into development environments and verifying how applications respond: network degradation, CPU and memory pressure, disk-near-full simulation, filesystem and permission failures, process kills, dependency outages, and seeded random chaos — all bounded, logged, reversible, and observable.
Your app works perfectly. That's the problem.
Status: developer preview. The engine, safety model, and core workflows are real and tested; the UI has not been broadly validated across machines. Expect rough edges. Report anything you hit — see Contributing and Security.
Applications are normally tested under ideal conditions. Real systems get: network failures, latency and packet loss, DNS outages, CPU and memory pressure, process termination, dependency downtime, near-full disks, denied file access, and more. Chaos lets you deliberately reproduce those conditions on demand, observe what your app actually does, and verify that restoration returns the machine to a verified-clean state — with evidence, not assumptions.
SWIFT_VERSION = 6.0, MACOSX_DEPLOYMENT_TARGET = 14.0)Grab Chaos-v<version>.pkg from GitHub Releases and run it.
What it does:
/Applications (standard Installer prompt;
upgrading over an existing install replaces the app and leaves your data in
~/Library/Application Support/Chaos untouched)/usr/local/bin/chaos → the CLI inside the app bundle, so
chaos works from Terminal without the app running. The installer never
overwrites an existing file there that isn't a Chaos symlink.Signing status, honestly: preview packages and zips are ad-hoc signed and not
notarized, so Gatekeeper will warn on first launch of a downloaded copy
(right-click → Open, or remove the quarantine attribute). Building from source
has no such prompt. Developer ID signing + notarization is wired in the release
pipeline and activates automatically once signing credentials are configured
(see RELEASING.md).
To uninstall: drag /Applications/Chaos.app to the Trash and
rm /usr/local/bin/chaos (only if it's the Chaos symlink). User data in
~/Library/Application Support/Chaos is never removed by the installer.
open Chaos.xcodeproj
Targets:
| Target | Product | What it is |
|---|---|---|
Chaos | Chaos.app | The native SwiftUI app |
chaos | chaos CLI | Same engine, headless — for scripts, CI, Makefiles |
chaos-stress | worker binary | Purpose-built CPU/memory load generator |
ChaosKitTests | test bundle | Engine, model, safety, and persistence tests |
Press ⌘R to run the app. Select the Chaos scheme and run tests with ⌘U.
# 1. Build the engine, CLI, and stress worker (Swift Package Manager)
cd ChaosKit && swift build && cd ..
# 2. Build the app — a build phase embeds the CLI and stress worker
xcodebuild -project Chaos.xcodeproj -target Chaos -configuration Debug build
# Product: build/Debug/Chaos.app with
# Contents/MacOS/Chaos the app
# Contents/MacOS/chaos-stress CPU/memory load worker
# Contents/Helpers/chaos the CLI
# 3. Ad-hoc sign (no Apple Developer account needed)
codesign --force --sign - build/Debug/Chaos.app
# 4. Run the test suite
cd ChaosKit && swift test
All steps verified on a clean checkout.
Development vs release CLI installs, clearly separated:
Tools/install-cli.sh builds the CLI in release mode and
installs it into your locally built app bundle — no sudo, no system changes..pkg postinstall adds /usr/local/bin/chaos (see above).Maintainer release tooling (.pkg + .zip + checksums + manifest, optional
Developer ID signing/notarization) lives in Tools/Release/ — see
RELEASING.md.
The product loop: choose an app → define failure conditions → run experiment → observe behavior → evaluate assertions → diagnose failure → restore system → replay → verify fix.
Key concepts:
chaos replay <id> or the Replay button re-runs it exactly. Replay uses the same experiment plan and seed; system scheduling may introduce timing differences..build/out/Products/Debug/chaos list faults|scenarios|suites|recipes|targets
.build/out/Products/Debug/chaos run terrible-wifi --duration 120 --yes --seed 842913 --json
.build/out/Products/Debug/chaos replay <record-id> --json
.build/out/Products/Debug/chaos suite <suite-id> --json
.build/out/Products/Debug/chaos status --json
.build/out/Products/Debug/chaos stop
.build/out/Products/Debug/chaos restore
.build/out/Products/Debug/chaos records
.build/out/Products/Debug/chaos report <id> --format md|json|csv [--out PATH]
--yes skips the interactive safety confirmation (for CI). --json emits
machine-readable output; run exits 0 on pass, 1 on failure, 3 on
warning/inconclusive, 4 on stop — usable directly in CI gates.
The CLI runs headless: privileged fault activation fails fast with an honest message instead of opening a GUI authorization dialog mid-script. Run once inside the app to authorize pf, or run the CLI as root in CI containers.
ChaosKit/ # The engine — no UI, shared by app + CLI
Models/ # Fault catalog, experiment/scenario/record models
Engine/ # ExperimentEngine, restoration ledger, checkpoints,
# random-chaos planner, monitoring, persistence, reports
Faults/ # Network (pf/dummynet), resources (stress workers),
# storage/filesystem, process/dependency, environment
Chaos/ # SwiftUI app: dashboard, live view, builder, monitors
Tools/ # Icon generator, install scripts
Every fault is a FaultRunner registered by FaultID; scenarios compose
bindings; experiments compose both. Adding a fault = one descriptor + one runner.
macOS does not permit apps to unplug hardware, revoke TCC privacy grants, or change the system clock — so Chaos never pretends it can. The fault library (49 faults) is explicitly classified, and the UI, safety review, reports, and CLI all preserve the distinction:
| Class | Meaning | Examples |
|---|---|---|
| REAL | Genuinely executed against the OS | pf/dummynet network faults, CPU & memory pressure via a purpose-built worker, real sparse-volume disk fill, real file/permission manipulation, process kill/pause, dependency port blocking, real unmountable scratch volumes |
| PRIVILEGED | Real but needs one-time OS authorization | Offline mode, latency, packet loss, bandwidth cap, DNS failure (pf + dummynet). The app prompts once; the CLI fails fast with an honest message instead of opening a GUI dialog |
| SIMULATED | Faithful stand-in where macOS forbids the real thing | Clock skew/DST/rollover (no documented API to change the system clock), privacy-grant prompts (TCC cannot be scripted), low battery, device unplug |
| GUIDED | A checklist drill plus any real pieces that are possible | Device disconnect walkthrough, manual custom conditions |
Run chaos list faults to see the class of every fault (runnable/guided,
[SIMULATED] marks). The full catalog with per-fault capability notes lives in
ChaosKit/Sources/ChaosKit/Models/Fault.swift
— each descriptor documents why privilege is needed, what it affects, and how
restoration is verified.
Your failure tests stay on your Mac. Nothing is uploaded.
cd ChaosKit && swift test
75 XCTest cases (+ a swift-testing suite) cover the engine, models, safety
counters, persistence round-trips, replay identity, recipes, scorecard
aggregation, and the privilege model. See CONTRIBUTING.md before adding tests
that touch real system state.
Chaos deliberately manipulates system conditions, so its security surface is unusual. Please read SECURITY.md before reporting.
See CONTRIBUTING.md. Safety-relevant changes get extra scrutiny — please read the safety expectations there first.
Chaos is released under the MIT License.
7 commits
Swift
96.8%
Shell
3.2%