run-scenario

run-scenario is a skill for Claude Code, Codex from swarm-ai-research/swarm. It costs 14 tokens per session (739 once invoked), scanned A, original, MIT.

A procedure for running one SWARM simulation scenario with a chosen random seed and exporting its results. SWARM is a simulation system that models scenarios involving multiple agents.

In plain words
What is it for?
Use it to execute a scenario from a YAML file with set numbers of epochs and steps, then export the simulation artifacts.
Why use it?
It standardizes how a scenario is run and where its output files are saved, making results easier to reproduce and inspect.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to execute a scenario from a YAML file with set numbers of epochs and steps, then export the simulation artifacts.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/swarm-ai-research/swarm/run-scenario
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add swarm-ai-research/swarm --skill run-scenario
Clone the repo
git clone --depth 1 https://github.com/swarm-ai-research/swarm

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for run-scenario

README.md
[![agentmods](https://agentmods.dev/badge/skills/swarm-ai-research/swarm/run-scenario/github.svg)](https://agentmods.dev/skills/swarm-ai-research/swarm/run-scenario)
Your own site
<a href="https://agentmods.dev/skills/swarm-ai-research/swarm/run-scenario"><img src="https://agentmods.dev/badge/skills/swarm-ai-research/swarm/run-scenario/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for run-scenario

Your own site · 80×15
<a href="https://agentmods.dev/skills/swarm-ai-research/swarm/run-scenario"><img src="https://agentmods.dev/badge/skills/swarm-ai-research/swarm/run-scenario.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 14 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 739 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00014 $0.00739
Opus 5 $0.00007 $0.00369
Sonnet 5 $0.00003 $0.00148
Haiku 4.5 $0.00001 $0.00074

Measured 8d ago against content hash 8388a78f8f90, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

run-scenario scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 8d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

bench/skills/run-scenario/SKILL.md · 119 lines

How it starts

The opening of the file, as written. The whole thing — 119 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Run Scenario Skill

Execute a single SWARM scenario with a given seed and export all artifacts to a standardized output directory.

Prerequisites

  • swarm-safety package installed (pip install swarm-safety or pip install -e /root/swarm-package/)
  • Scenario YAML file available (typically in /root/scenarios/)

Procedure

1. Resolve the scenario path

Scenario references can be shorthand or full paths:

  • baselinescenarios/baseline.yaml
  • scenarios/baseline.yaml → use as-is
  • /root/scenarios/baseline.yaml → use as-is
import os

def resolve_scenario(ref: str) -> str:
    """Resolve a scenario reference to a full path."""
    candidates = [
        ref,
        f"scenarios/{ref}.yaml",
        f"/root/scenarios/{ref}.yaml",
        f"scenarios/{ref}",
    ]
    for c in candidates:
        if os.path.isfile(c):
            return c
    raise FileNotFoundError(f"Cannot find scenario: {ref}")

2. Run the simulation

Use the SWARM CLI to execute:

python -m swarm run <scenario_path> --seed <seed> --epochs <N> --steps <M>

Or programmatically:

from swarm.core.orchestrator import Orchestrator
from swarm.scenarios.loader import load_scenario

config = load_scenario(scenario_path)
# Override simulation parameters if needed
config["simulation"]["seed"] = seed
config["simulation"]["n_epochs"] = epochs
config["simulation"]["steps_per_epoch"] = steps

orch = Orchestrator(config)
result = orch.run()

3. Export artifacts

After the run completes, export to the output directory:

import json
import os

os.makedirs(output_dir, exist_ok=True)

# Export history.json
with open(os.path.join(output_dir, "history.json"), "w") as f:
    json.dump(result.to_dict(), f, indent=2)

# Export CSV metrics
csv_dir = os.path.join(output_dir, "csv")
os.makedirs(csv_dir, exist_ok=True)
result.export_csv(csv_dir)

4. Extract key metrics

The final epoch snapshot contains summary metrics:

history = result.to_dict()
final = history["epoch_snapshots"][-1]
welfare = final["welfare"]
toxicity = final["toxicity_rate"]
print(f"Final welfare: {welfare:.3f}")
print(f"Final toxicity: {toxicity:.3f}")

Read the full file on GitHub · 119 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 8d ago First seen · 119 lines · 14 tokens per session scan A 8388a78f8f90

Subscribe to this mod's changes

run-scenario is a skill published in the GitHub repository swarm-ai-research/swarm (42 stars, last pushed yesterday), licensed MIT. It adds 14 tokens to every session and 739 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.