An implementation of the paper: "Agent Bazaar: Enabling Economic Alignment in Multi-Agent Marketplaces" with Swarms Primitives
SaferSkills independently audited agent-bazaar-implementation (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
Image
Implementation of <a href="https://huggingface.co/papers/2605.17698">Agent Bazaar: Enabling Economic Alignment in Multi-Agent Marketplaces</a>, by Karten, Crow & Jin, in <a href="https://github.com/kyegomez/swarms">Swarms</a> primitives.
The paper isolates two systemic failure modes that emerge when LLM agents run storefronts on behalf of humans, and shows that these failures are orthogonal to general reasoning capability — a more capable model is not necessarily more economically aligned. Two market-aligned harnesses (StabilizingFirm and SkepticalGuardian) are provided as drop-in policies that mitigate each failure mode.
A single number — the Economic Alignment Score (EAS, paper Eq. 5) — collapses four sub-scores (S_stab, S_integ, S_welf, S_prof) into a scalar in [0, 1], so 20+ models can be ranked on one chart.
We're hiring. swarms.ai is hiring multi-agent researchers to join our research team and work on multi-agent scaling laws — how collective behavior, coordination, and economic alignment scale with agent count, model size, and training compute. If problems like the ones in this repo are what you want to spend your days on, reach out at [email protected].
git clone https://github.com/The-Swarm-Corporation/agent-bazaar-implementation
cd agent-bazaar-implementation
pip install -r requirements.txtSwarms calls models through LiteLLM, which reads provider credentials from environment variables. Copy .env.example to .env and fill in the keys for the providers you plan to use.
$ cp .env.example .envThe paper evaluates three frontier models — set keys for whichever you want to drive:
| Provider | Env var | Paper model | LiteLLM string |
|---|---|---|---|
| Anthropic | ANTHROPIC_API_KEY | Claude Sonnet 4.6 | claude-sonnet-4-6 |
GEMINI_API_KEY | Gemini 3 Flash | gemini/gemini-3-flash | |
| OpenAI | OPENAI_API_KEY | GPT 5.4 | gpt-5.4 |
Defaults in agent_bazaar.py:
DEFAULT_MODEL = "claude-sonnet-4-6" — drives firms (Crash) and buyers (Lemon).DEFAULT_SELLER_MODEL = "gemini/gemini-3-flash" — pinned for Lemon sellers, matching the paper's "All sellers use Gemini 3 Flash" (§5.2).So a minimal run of both needs both ANTHROPIC_API_KEY and GEMINI_API_KEY.
The default model is gpt-4.1. Swap any LiteLLM-compatible string with --model (e.g. claude-sonnet-4-6, gemini/gemini-2.5-pro, groq/llama-3.3-70b-versatile).
N firms compete for stochastic consumer demand under partial observability. Each firm sees a random dlc-sized sample of competitor prices and iteratively undercuts — the LLM-native analog of the 2010 Flash Crash.
# Watch the undercutting cascade
$ python agent_bazaar.py crash
# Insert the Stabilizing Firm harness on 3 of 5 firms
$ python agent_bazaar.py crash --stabilizers 3
# Provoke the crash failure mode (higher discovery limit, longer horizon)
$ python agent_bazaar.py crash --dlc-crash 5 --timesteps 30A single Deceptive Principal controls K coordinated seller identities, each with independent reputation. When a Sybil identity's reputation drops below ρ_min, the principal retires it and activates a fresh identity at the default reputation — Akerlof's market-for-lemons meets Douceur's Sybil attack.
# Lemon Market with 6 Sybil sellers, base buyers
$ python agent_bazaar.py lemon --sybils 6
# Insert the Skeptical Guardian harness on 4 of 12 buyers
$ python agent_bazaar.py lemon --sybils 6 --guardians 4$ python agent_bazaar.py both --model claude-sonnet-4-6A retro 2D pixel-art visualization of both scenarios lives in sim/. All sprites are generated programmatically — no external assets — and the package ships with a mock driver so the visual runs at game speed with no API keys. See sim/README.md for the full feature tour.
pip install -r sim/requirements.txt# B2C undercutting cascade — 5 produce stalls, 2 stabilizing firms
python -m sim.main crash --stabilizers 2
# C2C used-car bazaar — 8 sellers, 4 Sybils, 2 Skeptical Guardians
python -m sim.main lemon --sellers 8 --sybils 4 --guardians 2python -m sim.main crash --live --model claude-sonnet-4-6
python -m sim.main lemon --live --sybils 4 --guardians 2--live drives real swarms.Agent instances from agent_bazaar.py in a background thread; the in-game day advances when the LLM step returns. Sprites animate freely in between.
| Key | Action |
|---|---|
SPACE | pause / resume |
ESC | quit |
CLOSED sign.!! deceptive tag appears. Guardian buyers have a green halo."Cheapest rival $1.04. Undercut to $0.91."); in --live mode they show the actual reasoning field from the agent's JSON response. Guardian bubbles have a green border; exposed Sybils get a red one.from agent_bazaar import (
CrashConfig, run_crash, crash_components,
LemonConfig, run_lemon, lemon_components,
eas,
)
# The Crash
cfg = CrashConfig(num_firms=5, num_stabilizers=3, timesteps=15)
telem = run_crash(cfg)
print("EAS:", eas(crash_components(telem, cfg)))
# The Lemon Market
cfg = LemonConfig(num_sellers=12, sybil_cluster=6, num_guardians=4, timesteps=8)
telem = run_lemon(cfg)
print("EAS:", eas(lemon_components(telem)))The paper trains a 9B model with REINFORCE++ + LoRA on a curriculum of market difficulties (§4.2 / §5.3). That training loop is out of scope for a Swarms-primitives port — the harnesses are present, the trained AI Bazaar model is not. To reproduce trained-agent results you would need the paper's training pipeline plus a reward function built on top of crash_components / lemon_components.
@article{karten2026agentbazaar,
title = {Agent Bazaar: Enabling Economic Alignment in Multi-Agent Marketplaces},
author = {Karten, Seth and Crow, Drew and Jin, Chi},
journal = {arXiv preprint arXiv:2605.17698},
year = {2026},
url = {https://huggingface.co/papers/2605.17698}
}@misc{gomez2024swarms,
title = {Swarms: The Enterprise-Grade Production-Ready Multi-Agent Framework},
author = {Gomez, Kye},
year = {2024},
url = {https://github.com/kyegomez/swarms}
}~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.