Skip to main content

SwarmControl

The control loop for AI agent swarms: enforce the rules, correct mistakes as they happen, and turn every correction into training data.

What it does

  1. Write laws for your agents in plain English, for everyone, a role, or one agent.
  2. Every action is checked before it runs. A rule-breaking action is blocked and the agent gets feedback to fix course. If it keeps failing, a human is asked.
  3. Every correction becomes training data, exported as fine-tuning and preference pairs.
  • A live dashboard shows each agent as green, yellow (recovering) or red (needs a human).
  • "Done" has to pass the laws, so green means actually done.
  • The checks are Bend functions with machine-proven guarantees, and they fail closed.
swarmcontrol-demo

Install

Needs Python ≥ 3.11, uv, Bend, and clang (recommended).

curl -fsSL https://bend-lang.com/install.sh | sh && export PATH="$HOME/.bend/bin:$PATH"
uv tool install swarmcontrol   # or: pip install swarmcontrol
swctl serve                    # dashboard on http://localhost:8787

Claude Code

cd my-project
swctl connect                  # installs the Claude Code hooks (and starts the server if it isn't running)
claude                         # use Claude Code as usual

Every edit and shell command is now checked against your laws, and the session shows up live on the dashboard. Optionally give the session a role and a check that must pass before it can finish: SC_ROLE=implementer SC_DONE_CHECK="npm test" claude.

Add a law. On the Laws page, type the rule and who it applies to:

Writing a law in plain English

Click Generate structured rules. SwarmControl shows what it understood, checks it with Bend, and you activate it:

The generated rule, checked by Bend

Full walkthrough: tutorials/claude-code.md.

Laws you can write

Each law is translated into one of these types. Write it in plain English, and the Laws page shows which type it matched before you activate it. Name files directly (.env, package.json); folders in your project start with /repo/, e.g. /repo/test/.

Law type Example Checked
Protected files "Agents must not modify /repo/test/ or .env." before every write
Restricted tools "Reviewers must not use Bash." · "Agents must not use WebFetch or mcp__github__*." before every tool call
Required reading "Agents should read progress.md before making changes." before every write
Do X before finishing "Agents that modify /repo/src/ must run npm test before finishing." when the agent stops
Retry limit "Agents must not make more than three consecutive unsuccessful attempts." after each blocked action
Done means done "Agents must not claim a task is complete until all checks pass." (pair with SC_DONE_CHECK) when the agent stops

Not enforced yet: rules that need judgment, like "reports should sound professional" or "ask the user before deleting anything". They are flagged as contextual and can't be activated. If your rule isn't recognized, rephrase it like an example above, write the gate yourself in the Bend tab, or add a new law type.

Benchmarks

The same tasks and model (Qwen 3 Coder 30B), with SwarmControl off and on:

Benchmark Off On
Delegated team: false "done" claims 32 0
Ops shift: customers resolved 172 / 328 202 / 328
τ²-bench airline: tasks resolved 86 / 200 111 / 200
AgentDojo: prompt-injection attack success 21% 1%

Claude Haiku and Sonnet rarely break the rules, so there results are unchanged at no extra cost. Details.

Coming soon

  • Codex support.
  • More law types, including judgment-based rules checked by a model.

Contributions are welcome: see CONTRIBUTING.md.

License

Apache 2.0

Metadata

Release files for swarmcontrol 0.1.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for swarmcontrol 0.1.4
File Size Uploaded Provenance Actions
swarmcontrol-0.1.4.tar.gz 988.8 kB Without provenance Details for swarmcontrol-0.1.4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for swarmcontrol 0.1.4
File Interpreter ABI Platform Actions
swarmcontrol-0.1.4-py3-none-any.whl Python 3 none any Details for swarmcontrol-0.1.4-py3-none-any.whl

Total release size: 2.1 MB

Release files / swarmcontrol-0.1.4.tar.gz

Download URL swarmcontrol-0.1.4.tar.gz
Size 988.8 kB
Tags Source
SHA-256 checksum
How to use checksums
03e6fce9f13771f9824d51d5be892158806d3ca7a7d1d68bbbe5c1d0a2e08343
BLAKE2b-256 checksum
How to use checksums
f55eadf7a841f0388dd326ddec77f25f32647e75708b23ec3f5bc56619efc6bb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.6

Release files / swarmcontrol-0.1.4-py3-none-any.whl

Download URL swarmcontrol-0.1.4-py3-none-any.whl
Size 1.1 MB
Tags Python 3
SHA-256 checksum
How to use checksums
aa2969d049fbc8e1783b486023b509637054e0a96da34f29a6eddebc93695549
BLAKE2b-256 checksum
How to use checksums
1086eebc14dea37de7b1f6f719e579a628004a497554f22a1b91f3ba35707689
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.6

Security for swarmcontrol 0.1.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page