Zagros — Open Agent Operating System
The open-source operating system and runtime for persistent AI agents that keep working across laptop closes, serverless clouds, and distributed machine runners.
the deep dive — architecture & implementation
Engineered Zagros as an open-source operating system for persistent AI agents. Delivers durable state machines where agent tasks survive laptop sleeps, server restarts, and machine loss. Features hybrid local/cloud execution, standard Model Context Protocol (MCP) tool bindings with OAuth 2.1, Agent Client Protocol (ACP) bridges to provider-native agents (Claude Code, Codex, Gemini CLI), A2A multi-agent delegation, mobile-first installable PWA interface, signed SKILL.md runtime capabilities, and cryptographic audit logs verified across 10 end-to-end milestone test gauntlets.
Zagros: The Open-Source Runtime for Persistent AI Agents
Zagros is an open-source operating system and runtime for persistent AI agents. Use any model. Connect any MCP tool. Run locally, serverlessly, or across distributed machines. Close your laptop and let cloud-capable work continue uninterrupted.
- GitHub Repository:
RegaLabs/ZagrosAI - Architecture Model: Durable State Machines + Hybrid Cloud/Runner Protocol + MCP/ACP/A2A Open Standards
- Platforms: Node.js 22+, Cloudflare Workers/Workflows, Local Runner daemons, Mobile PWA
Any Model + MCP Tools + Skills + Distributed Runners + Serverless Cloud = Zagros
🏛️ Core Architecture Pillars
1. Persistent State Machines & Task Durability
A chatbot returns an answer and forgets. Zagros owns a durable lifecycle:
Task Request → Plan → Execute → Wait → Recover → Ask Permission → Continue → Verify → Deliver Artifacts
Tasks are durable state machines replicated across SQLite / D1 and object storage (R2/S3), surviving server restarts, machine transitions, and network interruptions.
2. Hybrid Execution & Zagros Runners
- Always-on Cloud: Serverless execution (Cloudflare Workflows) executes orchestration, scheduling, webhooks, and cloud API integrations continuously.
- Local Runners: Lightweight desktop daemons connect securely via WebSockets to execute browser automation (Playwright/Puppeteer), shell commands, local filesystem access, and hardware GPU tasks.
- Laptop-Close Resiliency: When a machine goes offline, only hardware-specific steps pause — all cloud tasks continue, and tasks resume as soon as any compatible runner reconnects.
3. Open Protocols First (MCP, ACP, A2A)
- Model Context Protocol (MCP): Native stdio and HTTP MCP server bindings with OAuth 2.1 authorization flows.
- Agent Client Protocol (ACP): Bridges to provider-native coding harnesses (Claude Code, Codex, Gemini CLI) while respecting provider security boundaries.
- Agent-to-Agent (A2A): Hierarchical agent delegation, parallel subtask dispatching, and agent card discovery.
4. Signed Skills & Cryptographic Audit Trails
- SKILL.md Standard: Modular, auditable capability packages with parameter schema validation.
- Security Hardening: Prompt-injection defenses, credential secret redaction, and SHA-256 tamper-evident execution audit chains.
🚀 Quick Start
# Clone and install monorepo dependencies
git clone https://github.com/RegaLabs/ZagrosAI.git
cd ZagrosAI
pnpm install
# Start local server and PWA
pnpm dev
# Build and connect a local desktop runner
pnpm --filter @zagros/runner build
pnpm --filter @zagros/runner start