Docs / Concepts / One run, in order

One run, in order

A live run reads one file, prepares it once, lets the agents work in one or two rounds, then writes the reports and seals the run folder.

Stage and parse#

The host copies the sample into the run folder (<state>/runs/<id>/input/), hashes it and parses it. A sample is an ELF, a PE or an APK, up to the size limits in the configuration (max_sample_native_mb for ELF and PE, max_sample_apk_mb for APK). The layout, the regions and the numbers in a report come from this parse, never from an agent.

Prepare#

The tools container opens the sample, which is mounted read-only, and writes the files the agents read under /prep: strings, imports, functions and decompiled code. The script that does this is piped to the container on standard input and never mounted. The host adds a lookup table of ATT&CK techniques written from MITRE's data. No agent has run yet.

Round 1#

Triage, Static, Strings/IOC and Crypto/Config start together. Behaviour starts when the board holds three findings, or when those four tasks have ended. The Reporter runs last. Each agent works in its own task with its own time limit (task_minutes), and max_parallel limits how many model requests are in flight at once. The six roles describes each agent.

A post#

An agent reports a finding by running swarm-post, which prints one line: @@SWARM, a 16-character nonce and a JSON object. The nonce is an HMAC of a per-run key over the role and the task number. A line that does not carry its own task's nonce is ignored, so a line forged inside a sample's strings is not read. The host reads the line from the agent's own tool-result stream and gives it to the board. The board says what happens next.

Round 2#

With max_rounds = 2, the default, the orchestrator model may plan one more round after round 1. It reads structured data about the board and never touches the sample. It can give a verdict on each disputed finding and plan up to eight further tasks for the roles. The verdicts are stored before the tasks start, so the board and the Reporter see them.

There is no round 2 when max_rounds = 1, when no task finished and the board is empty, or when the model plans no tasks.

Report#

The Reporter reads the board only and writes the text of the report. SwarmLabRE cuts its text sentence by sentence by a lint, caps the verdict and the confidence by the evidence on the board, and writes every output file with the clock pinned to the end of the run. If the board is empty and no task finished, the Reporter does not run. Reports describes the files.

Seal#

The run folder gets a manifest.json: the tool version, the sample's hash, the model and its sampling, the image ids, the ATT&CK version, the report format and the SHA-256 of every input and output file. The model trace is compressed without a file name or a time in the gzip header, so it hashes the same every time. Reproducibility says what replay does with the manifest.

One run at a time#

SwarmLabRE starts a run only when no other run is active, in this process or in another one. There is one model, and the containers need memory.

The demo run, by phase#

The recorded run demo/sfaef16e6 had seven tasks in four phases. Round 1 started Behaviour only after the board held three findings; in round 2 the orchestrator ruled on the one disputed finding and planned one task, for Crypto/Config; the Reporter ran in the merge phase.

PrepareRound 1Round 2MergeTriageStaticStrings/IOCCrypto/ConfigBehaviourReportert2 Static, round 1, phase round 1: finished; 0 findings postedt2t4 Crypto/Config, round 1, phase round 1: finished; 1 finding postedt4t3 Strings/IOC, round 1, phase round 1: finished; 4 findings postedt3t1 Triage, round 1, phase round 1: finished; 0 findings postedt1t5 Behaviour, round 1, phase round 1: finished; 1 finding postedt5t6 Crypto/Config, round 2, phase round 2: finished; 0 findings postedt6t7 Reporter, round 1, phase merge: finished; 0 findings postedt7
The seven tasks of the recorded demo run, by phase, from events.jsonl. Hover a square for its role and the number of findings the task posted.
Show as a table
TaskAgentPhaseRoundFindings posted
t1TriageRound 110
t2StaticRound 110
t3Strings/IOCRound 114
t4Crypto/ConfigRound 111
t5BehaviourRound 111
t6Crypto/ConfigRound 220
t7ReporterMerge10
SwarmLabRE alpha 0.1.0Edit this page on GitHub