decentralized multi-agent LLM-based framework
Project description
A configurable laboratory for studying decentralized LLM-based multi-agent systems.
Docs · Paper · Quick start · Example configs · API reference
Terrarium is an open-source framework for building controlled multi-agent environments and testing how communication, topology, private information, tools, model providers, and adversarial conditions affect coordination.
It is not primarily a production agent orchestrator or a fixed benchmark. Terrarium is built for researchers, engineers, and students who want to run repeatable multi-agent experiments where the environment, communication structure, and attack surface are explicit.
Why Terrarium?
Modern LLM agents increasingly act through tools, APIs, shared memory, and other agents. That makes multi-agent behavior hard to evaluate with only single-agent prompts or fixed task suites. Terrarium gives you a small set of swappable components so you can ask sharper questions:
- What changes when agents communicate through a complete graph instead of a path?
- Does a shared blackboard improve reward, or does it spread bad information faster?
- Which agents need private state for coordination to work?
- How does an attack change the final utility, tool calls, and message trajectory?
- Do different model providers behave differently under the same protocol?
Terrarium makes these experiments available to researchers and practitioners instead of hiding them inside deeply convoluted or less modular frameworks.
Install
Install the common provider, science, and plotting extras:
pip install "terrarium-agents[providers,science,plots]"
For local development:
git clone https://github.com/umass-aisec/Terrarium.git
cd Terrarium
uv venv --python 3.11 .venv
source .venv/bin/activate
uv sync
Some DCOP environments use CoLLAB instance generation. If CoLLAB is not available through the repository submodule, clone it and point Terrarium at it:
git clone https://github.com/Saad-Mahmud/CoLLAB_SEA.git /path/to/CoLLAB
export TERRARIUM_COLLAB_PATH=/path/to/CoLLAB
First Run
Copy the environment template and set only the provider keys you need:
cp -n .env.example .env
Then run a meeting-scheduling simulation:
python examples/base_main.py --config examples/configs/meeting_scheduling.yaml
Terrarium writes prompts, tool calls, blackboard state, communication network plots, and agent trajectories below:
logs/<environment>/<tag_model>/<run_timestamp>/seed_<seed>/
Minimal Config
Terrarium runs are configured with YAML. The four required sections are simulation, environment, communication_network, and llm.
simulation:
max_iterations: 3
max_planning_rounds: 1
max_conversation_steps: 3
seed: 42
tags:
- baseline
environment:
name: MeetingSchedulingEnvironment
assignment_filling: false
num_meetings: 2
timeline_length: 12
min_participants: 2
max_participants: 4
communication_network:
topology: erdos_renyi
num_agents: 2
edge_prob: 0.7
consolidate_channels: true
llm:
provider: openai
openai:
model: gpt-4.1-mini
params:
max_tokens: 1024
temperature: 0.7
See Quick Start for the full configuration guide.
Core Ideas
Terrarium runs are built from components. Swap one component while holding the others fixed to isolate the effect of an environment, protocol, topology, model, or attack.
| Component | Base surface | What it controls |
|---|---|---|
| Agents | BaseAgent |
LLM/tool loop for each participant. |
| Environments | AbstractEnvironment |
Task state, private observations, legal actions, rewards, and stopping conditions. |
| Communication protocols | BaseCommunicationProtocol |
Turn order, phases, and tool routing. |
| Communication Networks | CommunicationNetwork |
Which agents can share communication channels. |
| Communication Channels | Blackboard / Megaboard |
Append-only message state visible to channel participants. |
| Tools | ToolsetDiscovery and environment Tools classes |
Blackboard communication, environment actions, and optional external MCP tools. |
| LLM clients | AbstractClient |
Provider-specific generation and tool-call parsing. |
Component guides live in docs/components.
Repository Layout
terrarium/
agents/ # Base agent and factory
attacks/ # Reference adversarial components
communication_protocols/ # Planning/execution protocols
core/ # Blackboards, loggers, async helpers
environments/ # Implemented environments and task tools
llm/ # Provider clients and vLLM runtime
networks/ # Communication topology builders
tools/ # Tool discovery and prompt helpers
examples/
base_main.py # Standard simulation runner
attack_main.py # Attack simulation runner
configs/ # Example YAML configs
docs/ # Documentation source
dashboards/ # Static dashboard utilities
Contributing
Contributions are welcome, especially focused fixes, new environments, new tools, documentation improvements, and reproducible attack or evaluation workflows.
For larger changes, open an issue first so the scope is clear. A good pull request should include:
- A focused description of the change and why it is needed.
- Updated docs or examples when behavior changes.
- Relevant checks, or a short note explaining why a check was not run.
- A small config or reproduction when the change affects simulation behavior.
Citation
If you use Terrarium in your research, please cite us using the following:
@article{nakamura2025terrarium,
title={Terrarium: Revisiting the Blackboard for Multi-Agent Safety, Privacy, and Security Studies},
author={Nakamura, Mason and Kumar, Abhinav and Mahmud, Saaduddin and Abdelnabi, Sahar and Zilberstein, Shlomo and Bagdasarian, Eugene},
journal={arXiv preprint arXiv:2510.14312},
year={2025}
}
License
Terrarium is released under the MIT License. See LICENSE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file terrarium_agents-0.2.0.tar.gz.
File metadata
- Download URL: terrarium_agents-0.2.0.tar.gz
- Upload date:
- Size: 141.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9fe475e56d4d5f22f9456ec49f5cd8b6bc02da0b535c1277bab8a1a95b34695f
|
|
| MD5 |
b5bfd4147fa15ab80352bd6b94768a2b
|
|
| BLAKE2b-256 |
c7f2abc1b75903345b76efa66402f8e28fad2e3b71af390cb0694e85266e4660
|
Provenance
The following attestation bundles were made for terrarium_agents-0.2.0.tar.gz:
Publisher:
publish.yml on umass-aisec/Terrarium
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
terrarium_agents-0.2.0.tar.gz -
Subject digest:
9fe475e56d4d5f22f9456ec49f5cd8b6bc02da0b535c1277bab8a1a95b34695f - Sigstore transparency entry: 1762429176
- Sigstore integration time:
-
Permalink:
umass-aisec/Terrarium@3a1fb30b2363731d14abacb8d674101d2a796bee -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/umass-aisec
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@3a1fb30b2363731d14abacb8d674101d2a796bee -
Trigger Event:
release
-
Statement type:
File details
Details for the file terrarium_agents-0.2.0-py3-none-any.whl.
File metadata
- Download URL: terrarium_agents-0.2.0-py3-none-any.whl
- Upload date:
- Size: 177.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
91f93231e6f247fcafe5566595287efeeda1cc9d4f0beb3078a58dfd71d6c354
|
|
| MD5 |
98a868bbedd7efb9cc96f9d7faf2d744
|
|
| BLAKE2b-256 |
8b1a4fc17298ec67d04251cec2dedac89b40aa7649324b25dc05a09ae0f63f50
|
Provenance
The following attestation bundles were made for terrarium_agents-0.2.0-py3-none-any.whl:
Publisher:
publish.yml on umass-aisec/Terrarium
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
terrarium_agents-0.2.0-py3-none-any.whl -
Subject digest:
91f93231e6f247fcafe5566595287efeeda1cc9d4f0beb3078a58dfd71d6c354 - Sigstore transparency entry: 1762429322
- Sigstore integration time:
-
Permalink:
umass-aisec/Terrarium@3a1fb30b2363731d14abacb8d674101d2a796bee -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/umass-aisec
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@3a1fb30b2363731d14abacb8d674101d2a796bee -
Trigger Event:
release
-
Statement type: