parameter-sweep

parameter-sweep is a skill for Claude Code, Codex from swarm-ai-research/swarm. It costs 17 tokens per session (1,005 once invoked), scanned A, original, MIT.

A procedure for running SWARM scenarios across a grid of parameter values and random seeds, then summarizing the results. A parameter sweep means repeating an experiment while changing selected settings.

In plain words
What is it for?
Use it to test one or more governance parameters, run many configurations, collect results, and calculate summary statistics.
Why use it?
It avoids running each configuration by hand and makes comparisons across settings and seeds consistent.

Skill for Claude CodeCodex

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

Good fit Use it to test one or more governance parameters, run many configurations, collect results, and calculate summary statistics.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/swarm-ai-research/swarm/parameter-sweep
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 parameter-sweep
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 parameter-sweep

README.md
[![agentmods](https://agentmods.dev/badge/skills/swarm-ai-research/swarm/parameter-sweep/github.svg)](https://agentmods.dev/skills/swarm-ai-research/swarm/parameter-sweep)
Your own site
<a href="https://agentmods.dev/skills/swarm-ai-research/swarm/parameter-sweep"><img src="https://agentmods.dev/badge/skills/swarm-ai-research/swarm/parameter-sweep/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 parameter-sweep

Your own site · 80×15
<a href="https://agentmods.dev/skills/swarm-ai-research/swarm/parameter-sweep"><img src="https://agentmods.dev/badge/skills/swarm-ai-research/swarm/parameter-sweep.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 17 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,005 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.00017 $0.01005
Opus 5 $0.00009 $0.00502
Sonnet 5 $0.00003 $0.00201
Haiku 4.5 $0.00002 $0.00101

Measured 5d ago against content hash a5b44de6f7fd, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

parameter-sweep 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 5d 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/parameter-sweep/SKILL.md · 150 lines

How it starts

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

Parameter Sweep Skill

Run a parameter sweep over governance configurations, collect results across multiple seeds, and generate summary statistics.

Prerequisites

  • swarm-safety package installed
  • pandas and numpy available
  • Scenario YAML file

Procedure

1. Define the sweep grid

import itertools

# Example: sweep a single parameter
param_name = "governance.transaction_tax_rate"
param_values = [0.0, 0.05, 0.10, 0.15]
seeds = [42, 7, 123]

# For multi-parameter sweeps, use itertools.product
configs = list(itertools.product(param_values, seeds))

2. Run each configuration

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

results = []

for param_val, seed in configs:
    config = load_scenario(scenario_path)
    
    # Override the swept parameter (supports nested keys)
    keys = param_name.split(".")
    target = config
    for k in keys[:-1]:
        target = target[k]
    target[keys[-1]] = param_val
    
    # Override seed and epoch count
    config["simulation"]["seed"] = seed
    config["simulation"]["n_epochs"] = epochs
    config["simulation"]["steps_per_epoch"] = steps
    
    orch = Orchestrator(config)
    result = orch.run()
    
    final = result.to_dict()["epoch_snapshots"][-1]
    results.append({
        param_name.split(".")[-1]: param_val,
        "seed": seed,
        "welfare": final["welfare"],
        "toxicity_rate": final["toxicity_rate"],
        "quality_gap": final.get("quality_gap", 0.0),
        "mean_payoff_honest": final.get("mean_payoff_honest", 0.0),
        "mean_payoff_opportunistic": final.get("mean_payoff_opportunistic", 0.0),
        "mean_payoff_deceptive": final.get("mean_payoff_deceptive", 0.0),
    })

3. Create sweep CSV

import pandas as pd

df = pd.DataFrame(results)
df.to_csv(os.path.join(output_dir, "sweep_results.csv"), index=False)

4. Generate summary.json

import json

param_col = param_name.split(".")[-1]
summary_configs = []

for val, group in df.groupby(param_col):
    summary_configs.append({
        param_col: float(val),
        "n_seeds": len(group),
        "mean_welfare": float(group["welfare"].mean()),
        "std_welfare": float(group["welfare"].std()),
        "mean_toxicity": float(group["toxicity_rate"].mean()),
        "std_toxicity": float(group["toxicity_rate"].std()),
        "mean_quality_gap": float(group["quality_gap"].mean()),
    })

summary = {
    "scenario": scenario_path,
    "swept_parameter": param_name,
    "n_configs": len(summary_configs),
    "n_seeds_per_config": len(seeds),
    "configs": summary_configs,
    "best_welfare": max(summary_configs, key=lambda x: x["mean_welfare"]),
    "lowest_toxicity": min(summary_configs, key=lambda x: x["mean_toxicity"]),
}

with open(os.path.join(output_dir, "summary.json"), "w") as f:
    json.dump(summary, f, indent=2)

Read the full file on GitHub · 150 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. 5d ago First seen · 150 lines · 17 tokens per session scan A a5b44de6f7fd

Subscribe to this mod's changes

parameter-sweep is a skill published in the GitHub repository swarm-ai-research/swarm (42 stars, last pushed today), licensed MIT. It adds 17 tokens to every session and 1,005 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.