Skip to content

CLI Reference

Workspace

crucible init                              # create runtime directories
crucible doctor                            # validate environment (Python, Foundry, config, RPC, dirs, Streamlit, Docker)
crucible doctor --ports                    # validate environment + check port availability
crucible doctor --foundry --python         # targeted checks only
crucible doctor --fix                      # auto-fix common environment issues (broken symlinks, missing dirs)
crucible status                            # show running chains, determinism flags, block numbers
crucible status --disk                     # show disk usage breakdown per directory
crucible summary                           # one-shot workspace overview (chains, runs, disk usage)
crucible clean                             # stop chains only
crucible clean --cache                     # remove fork cache only
crucible clean --checkpoints               # remove experiment checkpoints only
crucible clean --states                    # remove non-baseline snapshots only
crucible clean --logs                      # remove all log run directories (scratch tier only; saved/published preserved)
crucible clean --logs-older-than 30        # remove logs older than N days (tier-protected)
crucible clean --datasets --confirm        # remove exported dataset bundles (.protected preserved)
crucible clean --all                       # runtime artifacts only: cache + checkpoints + snapshots.
                                           # Does NOT touch logs/ or datasets/ — those are
                                           # research artifacts with separate protection.
                                           # Use --logs or --datasets explicitly to clean them.
crucible instrument                        # standalone RPC proxy for ad-hoc tx instrumentation (also supports --upstream, --chain, --output-dir, --port, --timeout)
crucible notebook                          # launch Jupyter for experiment analysis (also supports --port, --notebooks-dir, --no-browser)
crucible dashboard                         # launch Streamlit dashboard
crucible --version                         # show version
crucible --dry-run <command>               # preview without executing

Chains

crucible fork --topology single            # start Anvil for single chain
crucible fork --topology bridge            # start Anvil for dual chain + bridge
crucible fork --topology bridge --fork-timeout 600  # wait up to 600s for chains to become ready
crucible setup --topology bridge           # fork + run bootstrap.py + guidance to capture baseline
crucible setup --skip-bootstrap            # fork only, skip state preparation

Snapshots And Baselines

Baseline: A fingerprint of the chain state at a specific fork block. It detects environment drift — if the RPC provider changed, the topology was tweaked, or the fork block shifted between runs, the baseline hash won't match and the experiment fails early, before wasting time on false results.

When to use --no-baseline: Skip baseline verification on first runs (no baseline exists yet) or during attack development. The baseline is captured after the first successful run.

crucible snapshot create <name>            # named snapshot of running chains
crucible snapshot create <name> --chain ethereum  # snapshot specific chain
crucible snapshot restore <name> --chain ethereum # restore specific chain

crucible baseline capture <scenario> --topology bridge  # capture golden baseline
crucible baseline verify <scenario>       # verify baseline fingerprint

crucible reset --scenario <scenario>                  # soft reset (anvil_loadState, <5s)
crucible reset --scenario <scenario> --mode medium    # kill + relaunch + restore (<30s)
crucible reset --scenario <scenario> --mode hard      # re-fork + re-bootstrap + restore (<5min)
crucible hard-reset --scenario <scenario>             # alias for --mode hard

Plugins

crucible plugin list                       # all discovered plugins
crucible plugin list --type attack         # filter by type
crucible plugin list --type bridge         # filter by type (bridge)
crucible plugin validate attacks/demo_attack  # validate plugin manifest + interface
crucible plugin validate bridges/nomad_bridge  # validate bridge plugin + evidence.yaml
crucible plugin validate bridges/poly_network_bridge
crucible plugin validate bridges/wormhole_bridge

Bridge plugins deploy real Solidity contracts to forked chains and support the full lifecycle: deploy -> configure -> connect -> send_message -> reset -> destroy. Each requires plugin.yaml and evidence.yaml describing the protocol version, supported chains, modeled features, and known limitations.

Available bridge plugins: - nomad_bridge — Nomad Replica with committedRoot == 0x00 vulnerability (ethereum + polygon) - poly_network_bridge — EthCrossChainManager + EthCrossChainData hash collision (ethereum + polygon + bsc) - wormhole_bridge — WormholeCore + TokenBridge guardian bypass (ethereum + polygon)

Experiments

crucible experiment run experiments/demo_experiment.yaml           # formal run with baseline verification
crucible experiment run experiments/demo_experiment.yaml --no-baseline  # skip baseline check
crucible experiment run experiments/demo_experiment.yaml --publication-mode  # enforce publication gates
crucible experiment run experiments/demo_experiment.yaml --name "my-label"  # add human-readable alias
crucible experiment run experiments/demo_experiment.yaml --tier saved  # preserve: scratch|saved|published
crucible experiment run experiments/demo_experiment.yaml --no-auto-merge     # skip auto-merge of fork_block from evidence.yaml (keep current fork block)
crucible experiment run experiments/demo_experiment.yaml --no-fidelity       # skip fidelity enforcement (fidelity is enabled by default)
crucible experiment run experiments/demo_experiment.yaml --record path/to/fixture.jsonl  # record RPC calls to fixture
crucible experiment run experiments/nomad_replay.yaml --no-fidelity          # demo/simulation experiments
crucible experiment matrix experiments/benchmark_matrix.yaml       # run matrix of experiments
crucible experiment matrix ... --continue-on-error                 # keep running after failures
crucible experiment resume <run_id>                                # resume interrupted experiment
crucible experiment checkpoints                                    # list checkpoint manifests

Run Tiers

Each run is assigned a retention tier: - scratch (default) — auto-cleaned after 7 days - saved — preserved indefinitely - published — preserved indefinitely, never auto-cleaned

crucible experiment run experiments/nomad_replay.yaml --tier saved
crucible publish <run_id>                     # mark an existing run as published

Fidelity Enforcement

Fidelity enforcement runs automatically at the end of every experiment. Crucible reads the expected fidelity_level (L0-L4) declared in the attack plugin's evidence.yaml and enforces the strict requirements for that specific level.

If the runtime artifacts do not meet the expected fidelity level (e.g., an L3 claim is made but the orchestrator captured no exploit transactions), the experiment will fail and the run is marked as non-compliant.

Level What's Enforced Use Case
L0 None (always passes) Narrative or conceptual simulation
L1 Attack plugin returned a success status Basic script execution
L2 Chains exist in topology, trace artifacts present, no EVM trace failures State modification confirmed
L3 All L2 + exact_tx_replay=true in evidence, exploit_transactions non-empty, transaction hashes matched on chain Perfect historical transaction replay
L4 All L3 + multi-chain topology + bridge plugin + excluded_components declared Full cross-chain protocol reproduction

L4 topology examples: For an L4 reproduction, you must run the experiment using a multi-chain topology that includes an instrumented bridge plugin:

Topology Bridge Plugin Chains
topologies/nomad_bridge.yaml nomad_bridge ethereum + polygon
topologies/poly_network_bridge.yaml poly_network_bridge ethereum + polygon + bsc
topologies/wormhole_bridge.yaml wormhole_bridge ethereum + polygon

To bypass these strict checks during development or when running a mock/demo experiment that purposely doesn't meet the formal requirements, use the --no-fidelity flag:

crucible experiment run experiments/nomad_replay.yaml --no-fidelity

History & Logs

crucible logs list                           # list completed run manifests
crucible history                             # query experiment history (most recent only)
crucible history --tag wormhole --outcome success --limit 5       # filtered query
crucible history --tier saved                              # show only saved/preserved runs
crucible history --tier scratch                            # show only scratch (auto-cleanable) runs
crucible history --rebuild                   # rebuild index from log manifests
crucible diff <run_a> <run_b>                # canonical comparison of two runs

Publication & Export

Crucible separates two distinct concepts:

  • export — creates a publication artifact bundle (a self-contained directory or archive with all run artifacts, manifests, and provenance data). This is the data you would upload to Zenodo, a conference artifact evaluation, or a shared dataset.
  • publish — marks a run for indefinite retention by setting its tier to published. This protects the run from crucible clean --logs-older-than auto-cleanup and displays it prominently in history queries.

Both are part of the publication lifecycle, but they serve different purposes: export produces shareable data, publish manages local retention.

crucible export <run_id>                          # export run as publication bundle (dir)
crucible export <run_id> --format tar-gz          # compress as tar.gz
crucible export <run_id> --format zip             # compress as zip
crucible export <run_id> --force                  # overwrite existing export bundle
crucible publish <run_id>                         # mark run as published (preserved from auto-cleanup)

crucible verify <path>                            # verify artifact integrity (run, bundle, or .tar.gz/.zip)
crucible verify <path> --verbose                  # show all files, including matched ones
crucible verify <path> --schemas                  # also validate JSONL artifact structure

crucible bundle hash <path>                       # compute SHA-256 hash of bundle
crucible bundle verify <path>                     # verify bundle integrity (alias for `crucible verify` — auto-detects run vs bundle + supports --schemas)

Lifecycle summary: experiment run --tier saved → publish <run_id> → export <run_id> --format tar-gz → upload bundle to Zenodo / archive.

Verify

crucible verify automatically detects whether path is: - A run directory — re-computes hashes against log_integrity.json - An export bundle — re-computes hashes against artifact_bundle_manifest.json - A .tar.gz, .tgz, .zip, or .tar archive — auto-extracts to a temp directory, then verifies - Both run and bundle — runs both checks on the same directory

Archives are extracted transparently before verification. The temp directory is cleaned up automatically when verification completes.

Reports hash mismatches, missing files, and extra files not tracked in the integrity manifest.

With --schemas, also validates the structure of all JSONL artifact streams against expected schemas — catching missing required fields, type mismatches, and data corruption.

crucible verify logs/nomad_replay/DS-2026-00042
#   [ok] Verification: PASS (1 check)
#      [ok]  Run integrity     (log_integrity.json)
#           6 file(s) verified
#   All artifacts intact at: ...

crucible verify datasets/DS-2026-00042
#   [ok] Verification: PASS (1 check)
#      [ok]  Bundle integrity (artifact_bundle_manifest.json)
#           12 file(s) verified
#   All artifacts intact at: ...

crucible verify datasets/DS-2026-00042.tar.gz
#   Extracted DS-2026-00042.tar.gz to /tmp/crucible_verify_... for verification
#   [ok] Verification: PASS (1 check)
#      [ok]  Bundle integrity (artifact_bundle_manifest.json)
#           12 file(s) verified
#   All artifacts intact at: ...

crucible verify datasets/DS-2026-00042 --schemas
#   [ok] Verification: PASS (2 checks)
#      [ok]  Bundle integrity (artifact_bundle_manifest.json)
#      [ok]  Schema validation (4 stream(s), 6 entries)
#   All artifacts intact at: ...

Verify --schemas (JSONL Schema Validation)

Validates each JSONL artifact file against its expected schema:

Stream Required Fields Type Checks
run.jsonl phase, action, status, message exit_code: int
events.jsonl phase, chain, event_name block_number: int
storage_diffs.jsonl phase, chain, contract, slot, before, after —
gas_profile.jsonl phase, step, gas_used gas_used: int
balance_diffs.jsonl phase, chain, contract, account, before, after —
cross_chain.jsonl phase, correlation_id, source_chain, dest_chain block_number: int
agent_reasoning.jsonl step, observation, action step: int

Scans root-level, chain_*, and bridge/ subdirectories automatically.

Attack Pack Tooling

crucible attack init <name>                           # scaffold new attack plugin from template
crucible attack init <name> --chain ethereum           # specify target chain (default: ethereum)
crucible attack init <name> --fidelity L2              # set fidelity level
crucible attack init <name> --with-scenario            # also generate a pre-exploit scenario YAML
crucible attack init <name> --from-tx <tx_hash>        # populate scaffold from on-chain transaction
crucible attack init <name> --from-tx <tx_hash> --rpc-url <url>  # custom RPC for tx fetch

crucible attack extract <tx_hash> --name <name> --chain ethereum
  # Auto-generate attack pack from on-chain transaction (with ABI decoding)
  # Fetches tx, ABI, decodes function call, generates plugin + evidence + scenario
  # Options: --rpc-url <url>, --protocol <name>, --output <dir>
  #
  # [warn] Reliability note: This is a scaffolding tool, not a fully automated
  #   exploit generator. ABI decoding is best-effort (~60% success rate) and
  #   the generated plugin.py contains TODO stubs, not working exploit logic.
  #   The evidence.yaml date is auto-filled from the block timestamp when
  #   available. ABI fetch may fail for unverified contracts. Always review
  #   and customize the generated files before running experiments.

attack init vs attack extract

Command Use Case What It Does
attack init Quick scaffold from scratch Blank template with placeholders
attack init --from-tx Scaffold with real tx metadata Fills fork block, contract address, attacker address from on-chain data
attack extract Full automated extraction Fetches ABI, decodes calldata, generates call code + ABI mapping

Evidence Validation

crucible evidence check <attack>                    # validate evidence.yaml claims against running chains
crucible evidence check <attack> --fork             # fork chains, validate, then clean up (all in one step)
crucible evidence check <attack> --fork --topology bridge  # specify topology for --fork mode

Validates that: 1. Each declared fork block exists on the running chain via eth_getBlockByNumber 2. Each declared contract has non-empty code via eth_getCode (catches EOA vs contract mistakes)

With --fork, chains are started from the specified topology, validated, and stopped — no manual crucible fork needed.

ABI Registry

crucible abi list                           # list registered ABI entries
crucible abi validate                       # validate all ABI JSON files
crucible abi fetch 0xContractAddress        # fetch ABI from Etherscan (default, requires ETHERSCAN_API_KEY)
crucible abi fetch 0xContractAddress --source sourcify # from Sourcify (no API key needed)
crucible abi fetch 0xContractAddress --source etherscan --chain ethereum  # from Etherscan with chain override

Fork Cache Management

crucible cache inspect                      # show cache entries with provenance
crucible cache fingerprint                  # compute aggregate cache fingerprint
crucible cache verify --chain ethereum --fork-block 15259101  # verify cache provenance
crucible cache clean --chain ethereum       # remove cache for specific chain
crucible cache clean --all                  # remove all fork cache