Software-first autonomous glitching framework for closed-loop fault-injection campaigns. AUTOGLITCH combines experiment orchestration, Bayesian/RL optimization, hardware execution, observation/classification, primitive mapping, and reproducibility reporting in one workflow.
Quick links: Highlights · Quickstart · Hardware onboarding · Quality gates · Documentation
Important
As of March 9, 2026, the software quality gates are green:
python -m compileall src tests, ruff check src tests, mypy src, pytest -q.
The real-hardware RC workflow exists, but lab evidence is still pending.
Latest local validation snapshot:
ruff check src tests✅mypy src✅pytest -q✅127 passed
Note
AUTOGLITCH is a research-grade alpha. It is already strong as a software framework and mock/HIL-prep environment, but this repository does not yet claim field-proven HIL results.
- Closed-loop campaign execution: optimizer → hardware → observer → classifier → mapper → feedback.
- Multiple search strategies: Bayesian optimization, RL path, benchmark comparison, queue/soak flows.
- Hardware-aware runtime: transport-agnostic registry, official profiles, local binding store, onboarding commands, health diagnostics, binding-level locks.
- Typed serial first: preferred
autoglitch.v1JSONL protocol viaserial-json-hardware, with legacy text bridge fallback viaserial-command-hardware. - External backend baseline:
chipwhisperer-hardwareis now supported as the first USB backend. - Agentic control path: planner/policy loop, eval-suite, local knowledge ingest/query utilities.
- Runtime-selectable components: observer / classifier / mapper can now be selected by plugin manifest name.
- Reproducibility artifacts: campaign summary, run manifest, artifact bundle, RL reports, eval-suite reports, JSONL trial logs, decision traces.
- Backend benchmark path: benchmark runs can now compare backend × algorithm cells and emit benchmark/comparison reports.
- Software quality gates aligned with CI: local commands and GitHub Actions enforce the same repo-wide Ruff, mypy, and pytest checks.
| Area | Status | Notes |
|---|---|---|
| Core campaign loop | ✅ | run, report, replay, queue, soak, benchmark |
| Config validation | ✅ | strict mode requires config_version: 3; legacy mode still supported |
| Hardware onboarding | ✅ | detect-hardware, setup-hardware, doctor-hardware |
| Serial transport | ✅ | typed autoglitch.v1 preferred, legacy text fallback maintained |
| ChipWhisperer backend | ✅ | first external USB backend integrated as chipwhisperer-hardware |
| RL workflow | ✅ | train-rl, eval-rl, SB3 facade + lite fallback |
| Agentic workflow | ✅ | run-agentic, planner-step, eval-suite, kb-ingest, kb-query |
| HIL preflight / RC workflow | ✅ | hil-preflight, validate-hil-rc software path is implemented |
| Artifact bundle | ✅ | every run can emit a reproducibility bundle under experiments/results/bundles/ |
| Backend benchmark compare | ✅ | benchmark output now supports backend × algorithm comparison |
| Full software quality gate | ✅ | compileall + Ruff + mypy + pytest all green |
| Real-hardware RC evidence | ⏳ | workflow exists, measurement artifacts still need to be attached |
python -m venv .venv
source .venv/bin/activate
python -m pip install -e ".[dev]"Installed console scripts:
autoglitchautoglitch-mock-bridgeautoglitch-rpi-bridge
python -m src.cli validate-config --target stm32f3
python -m src.cli run --target stm32f3 --trials 50
python -m src.cli reportThis gives you:
- strict config validation,
- a mock-hardware campaign run,
- a saved campaign report under
experiments/results/.
python -m src.cli train-rl --target stm32f3 --rl-backend sb3 --steps 2000
python -m src.cli eval-rl --target stm32f3 --rl-backend sb3python -m src.cli detect-hardware --target stm32f3 --serial-port /dev/ttyUSB0
python -m src.cli setup-hardware --target stm32f3 --serial-port /dev/ttyUSB0 --force
python -m src.cli doctor-hardware --target stm32f3
python -m src.cli hil-preflight --target stm32f3
python -m src.cli run --target stm32f3 --require-preflight --trials 100python -m src.cli detect-hardware --hardware chipwhisperer-hardware --target stm32f3
python -m src.cli setup-hardware --hardware chipwhisperer-hardware --target stm32f3 --force
python -m src.cli doctor-hardware --hardware chipwhisperer-hardware --target stm32f3
python -m src.cli run \
--hardware chipwhisperer-hardware \
--target stm32f3 \
--serial-port /dev/ttyUSB0 \
--trials 100--serial-port in this mode is used as the target UART for the ChipWhisperer-backed run.
After setup-hardware, AUTOGLITCH stores the selected binding in:
configs/local/hardware.yaml
The runtime then resolves hardware in this order:
- explicit CLI override,
- saved local binding,
- auto-detect,
- legacy/mock fallback.
Terminal A:
python -m src.tools.mock_glitch_bridge --port-file /tmp/autoglitch_mock_bridge.portTerminal B:
python -m src.cli detect-hardware --serial-port "$(cat /tmp/autoglitch_mock_bridge.port)"
python -m src.cli setup-hardware --serial-port "$(cat /tmp/autoglitch_mock_bridge.port)" --force
python -m src.cli run --target stm32f3 --trials 20python -m src.cli validate-hil-rc \
--target stm32f3 \
--serial-port /dev/ttyUSB0 \
--manual-bridge-restart-ok \
--manual-link-drop-okvalidate-hil-rc bundles:
- typed onboarding,
- preflight,
- warmup/stability/repro runs,
- soak/resume and queue/binding-guard drills,
- legacy smoke,
- manual recovery confirmations.
For first lab use, read docs/REAL_HARDWARE_CHECKLIST.md first.
| Command group | Commands |
|---|---|
| Core execution | run, report, replay, benchmark |
| Batch operation | queue-run, soak |
| Validation / safety | validate-config, hil-preflight, validate-hil-rc |
| Hardware | detect-hardware, setup-hardware, doctor-hardware |
| RL | train-rl, eval-rl |
| Agentic | run-agentic, planner-step, eval-suite, kb-ingest, kb-query |
| Extensibility | list-plugins |
Full CLI help:
python -m src.cli --helpconfig/template
↓
optimizer (bayesian / rl)
↓ suggest()
hardware runtime (mock / typed serial / legacy serial)
↓ execute()
observer → classifier → mapper
↓
reward + primitive signal + runtime metadata
↓
logger / manifest / summary / replayable JSONL
↓
next suggestion or campaign termination
Key runtime layers:
src/cli.py: compatibility facade + dispatchersrc/cli_commands*.py: focused command handlers (general / RL / agentic)src/hardware/framework.py: public facade for the refactored hardware frameworksrc/hardware/_framework_*.py: internal models, adapters, resolution, capability checks, doctor, lockssrc/orchestrator/,src/optimizer/,src/runtime/,src/safety/: core execution pipelinesrc/logging_viz/: trial log, campaign summary, run manifest, artifact bundle, tracking helpers
- strict mode requires
config_version: 3 - legacy mode still reads
config_version: 1/2/3and returns friendly error lists - official hardware profiles live in
configs/hardware_profiles/*.yaml - default local binding path is
configs/local/hardware.yaml
components:
observer: basic-observer
classifier: rule-classifier
mapper: primitive-mapperThe runtime now instantiates these components from the plugin registry instead of hardcoded classes. Component manifests are target-validated before execution.
config_version: 3
hardware:
mode: mock # mock | serial | auto
adapter: auto # auto | mock-hardware | serial-json-hardware | serial-command-hardware | chipwhisperer-hardware
transport: auto
profile: auto
auto_detect: true
binding_file: configs/local/hardware.yaml
profile_dirs: []
required_capabilities:
- glitch.execute
discovery:
enabled: true
candidate_ports: []
port_globs:
- /dev/ttyUSB*
- /dev/ttyACM*
probe_timeout_s: 0.25
serial:
io_mode: async
keep_open: true
reconnect_attempts: 2
reconnect_backoff_s: 0.05Preferred protocol: autoglitch.v1
Minimum command set:
hellocapabilitieshealthexecuteresettrigger
Legacy text bridge is still supported for compatibility.
AUTOGLITCH generates structured artifacts for replay and auditability:
- trial log:
experiments/logs/<run_id>.jsonl - campaign summary:
experiments/results/campaign_*_<run_id>.json - run manifest:
experiments/results/manifest_<run_id>.json - artifact bundle:
experiments/results/bundles/<benchmark_id>/<target>/<backend>/<run_id>/ - RL train report:
experiments/results/rl_train_*.json - RL eval report:
experiments/results/rl_eval_*.json - eval-suite report:
experiments/results/eval_suite_*.json - benchmark report:
experiments/results/benchmark_*.json - comparison report:
experiments/results/comparison_*.json - preflight summary:
experiments/results/hil_preflight_*.json - RC validation report:
experiments/results/hil_rc_validation_*.json - agentic trace:
experiments/results/agentic_trace_*.jsonl - knowledge store(default):
data/knowledge/kb.jsonl
These outputs are backed by typed payload contracts in src/types.py.
Campaign summaries now also separate execution health from experiment outcomes:
execution_status_breakdowninfra_failure_countblocked_counttime_to_first_valid_faultagentic.planner_backendagentic.advisor_backendartifact_bundlebundle_manifest
Local development and CI use the same checks:
python -m compileall src tests
ruff check src tests
mypy src
pytest -q
python -m src.cli validate-config --target stm32f3Serial safety defaults:
- parallel serial execution is blocked unless explicitly enabled,
- binding-level locks fail closed,
hil-preflight+--require-preflightis the recommended HIL run path.
src/
├── cli.py
├── cli_commands.py
├── cli_commands_rl.py
├── cli_commands_agentic.py
├── orchestrator/
├── optimizer/
├── hardware/
├── observer/
├── classifier/
├── mapper/
├── llm_advisor/
├── logging_viz/
├── runtime/
└── safety/
Additional project directories:
configs/— target, hardware profile, and policy configurationtests/— unit and integration testsdocs/— architecture, runbook, safety, roadmap, validation notesexperiments/— generated reports, logs, queue/soak artifacts
| Document | Purpose |
|---|---|
docs/RUNBOOK.md |
operational command flow and artifact map |
docs/ARCHITECTURE.md |
module boundaries and runtime design |
docs/BENCHMARK_SCHEMA.md |
benchmark task/metric schema |
docs/ARTIFACT_BUNDLE_SCHEMA.md |
reproducibility bundle schema |
docs/CHIPWHISPERER_ADAPTER_PLAN.md |
ChipWhisperer backend scope/status |
docs/RESEARCH_POSITIONING.md |
research positioning and differentiation |
docs/SAFETY.md |
safety policy and fail-closed behavior |
docs/PLUGIN_SDK.md |
plugin manifest and extension model |
docs/PLAN_IMPLEMENTATION_STATUS.md |
what has already been implemented |
docs/ROADMAP.md |
next milestones and remaining research work |
docs/SOFTWARE_EVOLUTION_2026.md |
software-upgrade rationale and next ROI items |
docs/HIL_VALIDATION_REPORT_2026Q1.md |
HIL RC workflow status and evidence tracker |
docs/REAL_HARDWARE_CHECKLIST.md |
first-lab-use checklist |
docs/HARDWARE_BOM.md |
hardware bill of materials |
docs/hardware_setup_diagram.svg |
voltage glitching hardware setup diagram |
Useful local commands:
pytest tests/unit -q
ruff format src tests
python -m src.cli list-plugins
python -m src.cli benchmark --helpIf you change runtime behavior, add or update:
- a regression test,
- the relevant docs under
docs/, - schema/report compatibility if artifact shape changes.
Contributions are welcome, but please keep changes aligned with the current repo standards:
- Python 3.10+
- explicit type hints on public interfaces
- repo-wide Ruff + mypy + pytest green before review
- mock hardware in unit tests; reserve device workflows for integration/manual validation
MIT