Docs / Introduction / Quick start

Quick start

The repository carries a recorded run and 11 golden cases. Everything on this page works after a git clone with Python 3.12 and nothing else: no Docker, no GPU, no model key and no network.

Get the code#

$ git clone https://github.com/virqdroid/swarmlabre
$ cd swarmlabre

SwarmLabRE uses only the Python standard library, so there is nothing to install. The recorded run is demo/sfaef16e6: a harmless generated program that only exits, analysed with a scripted mock model. It shows the pipeline and its checks and says nothing about the quality of any model.

Replay the recorded run#

$ python3 -m swarmlabre replay demo/sfaef16e6

The command rebuilds the board and every report file offline and compares each file with the SHA-256 in the run's manifest.json. It exits 0 only if every byte is the recorded one, and 1 if one byte differs.

output, exit code 0
{
 "checks": {
  "board": "identical",
  "bundle_outputs": {
   "board.json": "identical",
   "detection.yar": "identical",
   "iocs.csv": "identical",
   "iocs.misp.json": "identical",
   "iocs.stix.json": "identical",
   "report.html": "identical",
   "report.json": "identical",
   "report.md": "identical"
  },
  "inputs_untouched": "identical",
  "outputs": {
   "board.json": "identical",
   "detection.yar": "identical",
   "iocs.csv": "identical",
   "iocs.misp.json": "identical",
   "iocs.stix.json": "identical",
   "report.html": "identical",
   "report.json": "identical",
   "report.md": "identical"
  },
  "record": "identical",
  "sample": "identical",
  "summary": "identical"
 },
 "level": "full",
 "ok": true,
 "run": "sfaef16e6"
}

The outputs block has one entry for each file the replay rebuilt. Reproducibility says what the other checks mean and what the replay does not cover.

Watch it in the web UI#

$ python3 -m swarmlabre serve --replay demo/sfaef16e6 --speed 8

The server prints one address with a #token= part; open that address. By default it listens on this machine only (127.0.0.1, port 8810). The page plays the recording eight times faster than it happened. It runs no model and needs no Docker.

A replayed view is a view of a recording: it does not check anything again. The byte-for-byte guarantee belongs to swarmlabre replay, which the server runs first, refusing to show a recording that does not come out identical.

Run the tests#

$ python3 -m unittest discover -s tests
$ python3 tests/goldenrun.py --check --twice

The first command runs the whole suite, golden cases included. The second replays every golden case twice and compares each output with the committed one. The browser checks in the suite skip themselves when Firefox and geckodriver are missing, and SWARMLABRE_SKIP_BROWSER=1 skips them on purpose.

Analyse a new file#

Docker is needed only to analyse a new file (the agents and Ghidra/jadx run in containers); replaying, the UI, the static demo, the tests and CI never use it. Analyse a file covers the two images, the mock model and the first run.

Set it up with your own agent#

Open an empty folder in a coding agent that can run shell commands and reads AGENTS.md (Claude Code, Codex, Cursor, Gemini CLI and others) and paste this:

prompt for your agent
Set up SwarmLabRE on this machine and check that it works.

1. Clone https://github.com/virqdroid/swarmlabre and read AGENTS.md before you run anything.
2. Check that Python 3.12 is installed.
3. Run the offline replay of demo/sfaef16e6 and the unit tests as AGENTS.md describes. Neither needs Docker, a model or the network.
4. If Docker works and this is arm64 Linux, build the two images as AGENTS.md describes (about 10 minutes) and run the generated demo sample with the scripted mock model. Otherwise skip this step and say why.
5. Report what passed, what failed and what you did not run, with the exit codes.

Do not put an API key in a file, on a command line or in this chat. Do not analyse any file except the generated demo.elf. Do not change any file in the repository.

The prompt stays short because AGENTS.md holds the exact commands, the order and the traps. The agent runs what that file says, so read it first if you do not trust your copy.

A real model needs two things you do yourself: the endpoint in swarmlabre.toml and the key exported in the environment variable named by api_key_env. Do not hand the key to the agent. Use a real model shows the file.

SwarmLabRE alpha 0.1.0Edit this page on GitHub