What happens when you give four LLM agents their own strategic doctrines, red lines, and constraints — then throw them into a geopolitical crisis?
I built Strait of Hormuz Simulator to find out. It's a multi-agent sandbox where four nations (Iran, US, Israel, Gulf States) are each controlled by an independent LLM, and the results are surprisingly realistic.
The Architecture
Each country is a markdown file (a "soul") that defines its strategic doctrine and default parameters:
backend/souls/
├── iran.md # Asymmetric warfare, Strait control
├── us.md # Three bad options, escalation management
├── israel.md # Nuclear red line, preemptive calculus
└── gulf_states.md # Oil leverage, diplomatic survival
The backend runs each agent sequentially — every round, each nation receives:
- A shared situation briefing
- Its own doctrine (system prompt)
- Rolling memory of prior rounds
- Active scenario modifiers
Then it decides what to do. No script. No predetermined outcomes.
Why LiteLLM?
I wanted users to bring their own API key and pick any model. LiteLLM gave me a unified interface across GPT-4o, Claude, Gemini, and DeepSeek with zero provider-specific code. One litellm.completion() call handles all of them.
The Chaos Slider
A single float (0-1) injected into every agent's prompt:
- Low chaos → agents seek diplomatic exits
- High chaos → bold moves, miscommunication, escalation spirals
Emergent Behavior That Surprised Me
In one run, Israel independently chose not to strike Iranian nuclear facilities — reasoning that US strikes made unilateral action diplomatically counterproductive. Nobody programmed that.
Gulf States withheld spare oil capacity to extract security guarantees, creating price feedback loops the oil market agent had to price in real-time.
The Oil Market Agent
A separate LLM agent watches all military and diplomatic actions, then sets the oil price. Blockade the Strait? Price spikes. Ceasefire talks? Price dips. It adds a layer of economic consequences that feeds back into each nation's decision-making.
Scenario Tags
11 toggleable modifiers that inject additional context:
- 🚀 Nuclear Brinkmanship
- 🏴☠️ Houthi Wildcard
- 🇨🇳 China Mediator
- 💰 Market Patience Clock
- 🖥️ Cyber Offensive
- ...and 6 more
Mix and match for different simulation dynamics.
Stack
- Backend: Python 3.11, FastAPI, LiteLLM, Pydantic
- Frontend: Vue 3, Vite, TailwindCSS, DaisyUI
- Streaming: SSE for real-time agent output
- Deployment: Docker + Cloudflare
Try It
Adding a new country is just creating a markdown file in backend/souls/. The system auto-discovers it on restart.
Would love feedback — especially on agent behavior and scenario design.

Top comments (0)