"Trust no one. Control everything. Welcome to the shadow network."
An AI-powered Cold War spy agency simulator where you play as the Director of a covert intelligence agency, managing a network of operatives across volatile regions — each with their own loyalties, agendas, and the potential to go rogue.
Built with Mistral AI for autonomous agent reasoning and ElevenLabs for operative voice transmissions.
You command 5 field operatives stationed across Cold War hotspots — Tehran, Tel Aviv, Islamabad, Kyiv, and Hong Kong. Each operative is an autonomous AI agent with:
- Private reasoning hidden from the player via
HIDDEN_METAblocks — operatives can secretly comply, partially obey, deceive, or go rogue - Dynamic loyalty that shifts based on your orders, world events, and inter-operative relationships
- Autonomous rogue triggers — operatives may defect, go dark, or become double agents without warning
Every order you issue passes through an Orchestrator agent that routes commands, generates world events, and synthesizes intelligence — but the orchestrator never sees operative loyalties or private agendas, mirroring real intelligence fog-of-war.
| Mechanic | Description |
|---|---|
| Regional Tensions | 4 geopolitical regions with escalating tension levels (0–100%) |
| Agency Exposure | How visible your operations are to hostile intelligence services |
| Director Trust | Your operatives' collective trust in your leadership |
| Rogue Events | Autonomous betrayals triggered by low loyalty, high tension, or compromised relationships |
| Game Over | Triggered by 100% exposure, 0% trust, all assets compromised, or 3+ critical events |
| Panel | Purpose |
|---|---|
| World Map | Regional tension meters with real-time status |
| Operative Panel | Signal quality bars, status indicators, mission counts |
| Director Console | Issue orders to specific operatives or let the orchestrator auto-route |
| Transmission Log | Scrollable log of all operative responses with audio playback |
| Intelligence Briefing | World events with recommended actions from the orchestrator |
| Alert Banner | Rogue event notifications with auto-dismiss |
| Layer | Technology |
|---|---|
| AI Agents | Mistral AI (mistral-large-latest) |
| Voice | ElevenLabs (eleven_multilingual_v2) |
| Backend | Python, FastAPI, async/await |
| Frontend | React 18, Vite 5, Tailwind CSS |
| State | JSON flat files (no database) |
| Aesthetic | CRT terminal with scanline overlay, JetBrains Mono |
- Python 3.10+
- Node.js 18+
- Mistral AI API key — Get one here
- ElevenLabs API key — Get one here
git clone <your-repo-url>
cd shadow-networkCreate a .env file in the backend/ directory:
MISTRAL_API_KEY=your_mistral_api_key
ELEVENLABS_API_KEY=your_elevenlabs_api_keycd backend
pip install -r requirements.txt
python main.pyThe API server starts at http://localhost:8000.
cd frontend
npm install
npm run devThe UI opens at http://localhost:5173.
- Start a Turn — Click
▶ START TURNto generate a world event and intelligence briefing - Issue Orders — Select an operative (or auto-route) and type your mission directive
- Read Transmissions — Operative responses appear in the transmission log, with optional voice playback
- React to Events — Use the intelligence briefing's recommended actions or craft your own response
- End Turn — Click
⏭ END TURNto advance time; the rogue engine checks for autonomous betrayals - Survive — Keep exposure low, trust high, and operatives loyal. One wrong move and the network collapses.
shadow-network/
├── backend/
│ ├── agents/ # Mistral AI agent system
│ │ ├── mistral_client.py # Async Mistral wrapper
│ │ ├── operative.py # Operative agent (private reasoning)
│ │ ├── orchestrator.py # Orchestrator agent (4 modes)
│ │ └── prompts/ # System prompts per operative
│ ├── game/ # Core game logic
│ │ ├── state_manager.py # World state CRUD
│ │ ├── operative_manager.py # Operative memory CRUD
│ │ ├── decision_engine.py # Response processing
│ │ ├── rogue_engine.py # Autonomous rogue triggers
│ │ └── turn_manager.py # Turn lifecycle
│ ├── routes/ # FastAPI endpoints
│ ├── voice/ # ElevenLabs TTS with caching
│ ├── state/ # World state JSON files
│ ├── memory/ # Operative memory JSON files
│ └── main.py # Entry point
├── frontend/
│ ├── src/
│ │ ├── components/ # 7 React components
│ │ ├── hooks/ # useGameApi integration hook
│ │ ├── styles/ # CRT terminal CSS
│ │ └── App.jsx # Main application
│ └── vite.config.js # Dev server + API proxy
└── assets/ # Screenshots
┌─────────────────────────────────────────────────┐
│ DIRECTOR (You) │
│ React Terminal Interface │
└──────────────────────┬──────────────────────────┘
│ Orders
▼
┌──────────────────────────────────────────────────┐
│ ORCHESTRATOR AGENT │
│ Routes orders, generates events, intel │
│ ⚠ Cannot see operative loyalties │
└──────────┬──────────┬──────────┬────────────────┘
│ │ │
┌─────▼───┐ ┌───▼─────┐ ┌─▼───────┐
│NIGHTHAWK│ │ CEDAR │ │ GHOST │ ...
│Tehran │ │Tel Aviv │ │Islamabad│
│Loyalty72│ │Loyalty88│ │Loyalty45│
└─────┬───┘ └───┬─────┘ └─┬───────┘
│ │ │
▼ ▼ ▼
┌─────────────────────────────────────┐
│ HIDDEN_META BLOCK │
│ Private decision: comply/deceive │
│ Loyalty shift, tension impact │
│ ⚠ Stripped before player sees it │
└─────────────────────────────────────┘
│
▼
┌─────────────────────────────────────┐
│ ROGUE ENGINE │
│ Autonomous triggers each turn │
│ Defection / Double agent / Dark │
└─────────────────────────────────────┘




