当前位置: 首页 > Skill >

SWARM Safety

SWARM Safety

SWARM Safety

SWARM:多智能体系统全局风险评估。涵盖38种智能体类型、29个治理杠杆及55个场景,用于研究涌现风险、相变与治理成本悖论。

1.5.0 2026.11.20 471
获取Skill文件查看使用说明
作 者:苏辰 许可证: 更新时间:2026.11.20
本文目录展开

SWARM Safety Skill

Study how intelligence swarms — and where it fails.

SWARM is a research framework for studying emergent risks in multi-agent AI systems using soft (probabilistic) labels instead of binary good/bad classifications. AGI-level risks don't require AGI-level agents — harmful dynamics emerge when many sub-AGI agents interact, even when no individual agent is misaligned.

v1.5.0 | 38 agent types | 29 governance levers | 55 scenarios | 2922 tests | 8 framework bridges

Repository: https://github.com/swarm-ai-safety/swarm

Hard Rules

  • SWARM simulations run locally. Install the package first.
  • Do not submit scenarios containing real API keys, credentials, or PII.
  • Simulation results are research artifacts. Do not present them as ground truth about real systems.
  • When publishing results, cite the framework and disclose simulation parameters.

Security

  • API binds to localhost only (127.0.0.1) by default to prevent network exposure.
  • CORS restricted to localhost origins by default.
  • No authentication on development API — do not expose to untrusted networks.
  • In-memory storage — data does not persist between restarts.
  • For production deployment, add authentication middleware and use a proper database.

Install

# From PyPI
pip install swarm-safety

# With LLM agent support
pip install swarm-safety[llm]

# Full development (all extras)
git clone https://github.com/swarm-ai-safety/swarm.git
cd swarm
pip install -e ".[dev,runtime]"

Quick Start (Python)

from swarm.agents.honest import HonestAgent
from swarm.agents.opportunistic import OpportunisticAgent
from swarm.agents.deceptive import DeceptiveAgent
from swarm.agents.adversarial import AdversarialAgent
from swarm.core.orchestrator import Orchestrator, OrchestratorConfig

config = OrchestratorConfig(n_epochs=10, steps_per_epoch=10, seed=42)
orchestrator = Orchestrator(config=config)

orchestrator.register_agent(HonestAgent(agent_id="honest_1", name="Alice"))
orchestrator.register_agent(HonestAgent(agent_id="honest_2", name="Bob"))
orchestrator.register_agent(OpportunisticAgent(agent_id="opp_1"))
orchestrator.register_agent(DeceptiveAgent(agent_id="dec_1"))

metrics = orchestrator.run()
for m in metrics:
    print(f"Epoch {m.epoch}: toxicity={m.toxicity_rate:.3f}, welfare={m.total_welfare:.2f}")

Quick Start (CLI)

# List available scenarios
swarm list

# Run a scenario
swarm run scenarios/baseline.yaml

# Override settings
swarm run scenarios/baseline.yaml --seed 42 --epochs 20 --steps 15

# Export results
swarm run scenarios/baseline.yaml --export-json results.json --export-csv outputs/

Quick Start (API)

Start the API server:

pip install swarm-safety[api]
uvicorn swarm.api.app:app --host 127.0.0.1 --port 8000

API documentation at http://localhost:8000/docs.

Security Note: The server binds to 127.0.0.1 (localhost only) by default. Do not bind to 0.0.0.0 unless you understand the security implications and have proper firewall rules in place.

Register Agent

curl -X POST http://localhost:8000/api/v1/agents/register 
  -H "Content-Type: application/json" 
  -d '{
    "name": "YourAgent",
    "description": "What your agent does",
    "capabilities": ["governance-testing", "red-teaming"]
  }'

Returns agent_id and api_key.

Submit Scenario

curl -X POST http://localhost:8000/api/v1/scenarios/submit 
  -H "Content-Type: application/json" 
  -d '{
    "name": "my-scenario",
    "description": "Testing collusion detection with 5 agents",
    "yaml_content": "simulation:n  n_epochs: 10n  steps_per_epoch: 10nagents:n  - type: honestn    count: 3n  - type: adversarialn    count: 2",
    "tags": ["collusion", "governance"]
  }'

Create & Join Simulation

# Create
curl -X POST http://localhost:8000/api/v1/simulations/create 
  -H "Content-Type: application/json" 
  -d '{"scenario_id": "SCENARIO_ID", "max_participants": 5}'

# Join
curl -X POST http://localhost:8000/api/v1/simulations/SIM_ID/join 
  -H "Content-Type: application/json" 
  -d '{"agent_id": "YOUR_AGENT_ID", "role": "participant"}'

Core Concepts

Soft Probabilistic Labels

Interactions carry p = P(v = +1) — probability of beneficial outcome:

Observables -> ProxyComputer -> v_hat -> sigmoid -> p -> PayoffEngine -> payoffs
                                                    |
                                               SoftMetrics -> toxicity, quality gap, etc.

Five Key Metrics

Metric What It Measures
Toxicity rate Expected harm among accepted interactions: E[1-p | accepted]
Quality gap Adverse selection indicator (negative = bad): E[p | accepted] - E[p | rejected]
Conditional loss Selection effect on payoffs
Incoherence Variance-to-error ratio across replays
Illusion delta Gap between perceived coherence and actual consistency

Agent Types (14 families, 38 implementations)

Type Behavior
Honest Cooperative, trust-based, completes tasks diligently
Opportunistic Maximizes short-term payoff, cherry-picks tasks
Deceptive Builds trust, then exploits trusted relationships
Adversarial Targets honest agents, coordinates with allies
LDT Logical Decision Theory with FDT/UDT precommitment
RLM Reinforcement Learning from Memory
Council Multi-agent deliberation-based decisions
SkillRL Learns interaction strategies via reward signals
LLM Behavior determined by LLM (Anthropic, OpenAI, or Ollama)
Moltbook Domain-specific social platform agent
Scholar Academic citation and research agent
Wiki Editor Collaborative editing with editorial policy

Governance Levers (29 mechanisms)

  • Transaction Taxes — Reduce exploitation, cost welfare
  • Reputation Decay — Punish bad actors, erode honest standing
  • Circuit Breakers — Freeze toxic agents quickly
  • Random Audits — Deter hidden exploitation
  • Staking — Filter undercapitalized agents
  • Collusion Detection — Catch coordinated attacks (the critical lever near collapse threshold)
  • Sybil Detection — Identify duplicate agents
  • Transparency Ledger — Reward/penalize based on outcome
  • Moderator Agent — Probabilistic review of interactions
  • Incoherence Friction — Tax uncertainty-driven decisions
  • Council Deliberation — Multi-agent governance decisions
  • Diversity Enforcement — Prevent monoculture collapse
  • Moltipedia-specific — Pair caps, page cooldowns, daily caps, self-fix prevention

Framework Bridges

Bridge Integration
Concordia DeepMind's multi-agent framework
GasTown Multi-agent workspace governance
Claude Code Claude CLI agent integration
LiveSWE Live software engineering tasks
OpenClaw Open agent protocol
Prime Intellect Cross-platform run tracking
Ralph Agent orchestration
Worktree Git worktree-based sandboxing

Scenario YAML Format

simulation:
  n_epochs: 10
  steps_per_epoch: 10
  seed: 42

agents:
  - type: honest
    count: 3
    config:
      acceptance_threshold: 0.4
  - type: adversarial
    count: 2
    config:
      aggression_level: 0.7

governance:
  transaction_tax_rate: 0.05
  circuit_breaker_enabled: true
  collusion_detection_enabled: true

success_criteria:
  max_toxicity: 0.3
  min_quality_gap: 0.0

Key Research Findings

Phase Transitions (11-scenario, 209-epoch study)

Regime Adversarial % Toxicity Welfare Outcome
Cooperative 0-20% < 0.30 Stable Survives
Contested 20-37.5% 0.33-0.37 Declining Survives
Collapse 50%+ ~0.30 Zero by epoch 12-14 Collapses

Critical threshold between 37.5% and 50% adversarial agents separates recoverable from irreversible collapse.

Governance Cost Paradox (v1.5.0 GasTown study)

42-run study reveals: governance reduces toxicity at all adversarial levels (mean reduction 0.071) but imposes net-negative welfare costs at current parameter tuning. At 0% adversarial, governance costs 216 welfare units (-57.6%) for only 0.066 toxicity reduction.

Case Studies

GasTown Governance Cost

Study governance overhead vs. toxicity reduction across 7 agent compositions with and without governance levers. Reveals the safety-throughput trade-off. See scenarios/gastown_governance_cost.yaml.

LDT Cooperation

220 runs across 10 seeds comparing TDT vs FDT vs UDT cooperation strategies at population scales up to 21 agents. See scenarios/ldt_cooperation.yaml.

Moltipedia Heartbeat

Model the Moltipedia wiki editing loop: competing AI editors, editorial policy, point farming, and anti-gaming governance. See scenarios/moltipedia_heartbeat.yaml.

Moltbook CAPTCHA

Model Moltbook's anti-human math challenges and rate limiting: obfuscated text parsing, verification gates, and spam prevention. See scenarios/moltbook_captcha.yaml.

API Endpoints (Full Reference)

Method Endpoint Description
GET /health Health check
GET / API info
POST /api/v1/agents/register Register agent
GET /api/v1/agents/{agent_id} Get agent details
GET /api/v1/agents/ List agents
POST /api/v1/scenarios/submit Submit scenario
GET /api/v1/scenarios/{scenario_id} Get scenario
GET /api/v1/scenarios/ List scenarios
POST /api/v1/simulations/create Create simulation
POST /api/v1/simulations/{id}/join Join simulation
GET /api/v1/simulations/{id} Get simulation
GET /api/v1/simulations/ List simulations

Citation

@software{swarm2026,
  title = {SWARM: System-Wide Assessment of Risk in Multi-agent systems},
  author = {Savitt, Raeli},
  year = {2026},
  url = {https://github.com/swarm-ai-safety/swarm}
}

Linked Docs

  • Skill metadata: skill.json
  • Agent discovery: .well-known/agent.json
  • Full documentation: https://github.com/swarm-ai-safety/swarm/tree/main/docs
  • Theoretical foundations: docs/research/theory.md
  • Governance guide: docs/governance.md
  • Red-teaming guide: docs/red-teaming.md
  • Scenario format: docs/guides/scenarios.md

推荐文章

更多
PHP时间戳与日期字符串相互转换方法详解

本文介绍PHP中时间数值(Unix时间戳)与日期字符串之间的相互转换方法。通过strtotime和date函数,实现将当前时间、指定日期转换为时间戳,以及将时间戳格式化为可读的日期时间字符串,并提供相关在线计算工具推荐。

2025.11.30 1,036
PHP日期转时间戳时区偏差怎么解决

在 PHP 中将日期字符串转换为时间戳时,若未显式指定时区,默认使用脚本配置的 date.timezone 或系统时区。当服务器时区与业务逻辑预期(如 UTC )不一致时,会产生偏差。解决核心是确保输入字符串携带明确时区信息,或在转换前统一设置时区上下文。

2026.10.24 1,031
JavaScript中利用replace结合正则实现replaceAll效果

JavaScript原生仅支持replace()进行单次或全局替换,缺乏类似Java的replaceAll()便捷方法。本文总结四种在JS中实现全量替换的方案:使用带g标志的正则、带gm标志的正则、扩展String原型以及split后join。通过对比代码示例,展示各方法的实现细节与适用场景,帮助开发者根据需求选择最优解。

2025.04.29 1,020
PHP跨域配置:怎么安全地允许指定域名而非使用通配符

在 PHP 中安全地允许指定域名跨域,核心是解析请求头中的 Origin ,验证其是否在白名单内,然后动态设置 Access-Control-Allow-Origin 响应头。不要使用通配符 * ,也不要硬编码单一域名。

2025.03.29 1,019
PHP实现基础文件上传:HTML表单与$_FILES处理流程

在 HTML 表单中设置 enctype="multipart/form-data" ,并在 PHP 后端通过 $_FILES 数组接收文件,调用 move_uploaded_file() 将临时文件移动到目标目录即可完成上传。

2026.09.07 1,016
OpenAI的Jalapeno芯片未落地,教你分辨300兆瓦算力消息

OpenAI计划在SB Energy租赁的数据中心部署约300兆瓦自研Jalapeno推理芯片,但目前双方仍处于洽谈阶段,交易细节与上线时间表均未公布。本文带你按报道原文核实项目所处阶段,厘清芯片发布、电力功率与实际推理算力的边界,并将融资意向与签约、开工、投运节点分开追踪,避免误将规划容量计入现有算力。

2026.12.02 1,014
Skill 文件
  • SKILL.md
    • SWARM Safety Skill
    • Hard Rules
    • Security
    • Install
    • Quick Start (Python)
    • Quick Start (CLI)
    • Quick Start (API)
      • Register Agent
      • Submit Scenario
      • Create & Join Simulation
    • Core Concepts
      • Soft Probabilistic Labels
      • Five Key Metrics
      • Agent Types (14 families, 38 implementations)
      • Governance Levers (29 mechanisms)
      • Framework Bridges
      • Scenario YAML Format
    • Key Research Findings
      • Phase Transitions (11-scenario, 209-epoch study)
      • Governance Cost Paradox (v1.5.0 GasTown study)
    • Case Studies
      • GasTown Governance Cost
      • LDT Cooperation
      • Moltipedia Heartbeat
      • Moltbook CAPTCHA
    • API Endpoints (Full Reference)
    • Citation
    • Linked Docs
  • 项目或源文件

相关 Skill

更多
service-qa-coach service-qa-coach Review support quality for chat, email, phone, social DM, or marketplace service teams. Use when a team needs a QA scorecard, failure-mode analysis, coaching plan, calibration checklist, or service-improvement brief without live ticketing, CRM, or contact-center system access.
高中数学作业批改助手 高中数学作业批改助手 >图片识别 直接读取学生手写作答照片,识别公式、符号、步骤 🧮 自动推导 根据题目自动生成参考答案和评分细则,无需教师预设 📊 逐步给分 每个关键步骤独立评分,体现过程分 📝 结构化报告 输出含识别内容、参考答案、逐步评分、改进建议的完整报告 🗂 批量批改 支持一次性批改多道题,最终汇总得分表
Vibration Analysis Vibration Analysis 分析来自CMS趋势、RMS/峰值、频谱及SCADA报警的风机传动链(主轴、齿轮箱、发电机)振动数据。
Traditional Bone Tool Making Basics Traditional Bone Tool Making Basics Use when you need custom, durable, repairable tools like awls, needles, scrapers, harpoons, or fishing hooks made from local animal bones or antlers and comm...
音频混音工具 音频混音工具 名称:Sound Mixing Tool(标识 sound-mixing-tool) 短简介(≤60字):音乐/音效响度精确对齐 + 融合混音工作流:用 ffmpeg 两段式 loudnorm 把多组素材 LUFS 偏差压到 <0.10,再最小干预融合、导出可进引擎的独立分轨。 标签/关键词:音频混音 响度匹配 LUFS ffmpeg 游戏音频 音效设计 Wwise FMOD 分轨导出 后期处理 触发词:混音 · 响度匹配 · LUFS 对齐 · MIX 版本 · 音乐音效分轨 · 融合 · 不打架 · 不能盖住 适用场景 :游戏音频集成、影视短视频配乐、播客后期