AgentMask / README.md
ym452's picture
Update README.md
ee9b4cc verified
---
title: AgentMask - Secure Multi-Agent System
emoji: ๐Ÿ›ก๏ธ
colorFrom: green
colorTo: red
sdk: gradio
sdk_version: 5.0.0
app_file: app.py
pinned: false
tags:
- mcp-in-action-track-enterprise
- agent
- security
- langgraph
- merkle-tree
- multi-agent
- ecdsa
---
# ๐Ÿ›ก๏ธ AgentMask - Secure Multi-Agent System
> **"Don't Trust, Verify."** โ€” Transparent, Auditable, and Immutable Reasoning Layer for AI Agents.
[![Python 3.10+](https://img.shields.io/badge/Python-3.10+-green.svg)](https://python.org)
[![FastAPI](https://img.shields.io/badge/FastAPI-0.104+-009688.svg)](https://fastapi.tiangolo.com)
[![Tests](https://img.shields.io/badge/Tests-44%20Passed-brightgreen.svg)]()
[![License](https://img.shields.io/badge/License-MIT-yellow.svg)]()
## ๐ŸŽฌ Demo & Submission
Watch the system in action and check out our official submission post:
[![Watch the Video](https://img.shields.io/badge/YouTube-Watch%20Demo-red?style=for-the-badge&logo=youtube)](https://youtu.be/d5VVxeBY1Ak)
[![View on X](https://img.shields.io/badge/X%20(Twitter)-View%20Post-black?style=for-the-badge&logo=x)](https://x.com/SDogan_n/status/1995246903232246076?s=20)
---
## ๐Ÿ† Hackathon Track
This project was developed for the **MCP 1st Birthday Hackathon**.
- **Track:** `Track 2: MCP in Action`
- **Category Tag:** `mcp-in-action-track-enterprise`
---
## ๐Ÿ’ก Problem: The Black Box Issue
Autonomous AI agents are performing increasingly complex tasks. However, there is a critical problem:
> **How can you prove why an agent made a decision or if it was manipulated during the process?**
In current systems, logs can be deleted or altered, and the agent's thought process remains a **black box**.
---
## ๐Ÿš€ Solution: Cryptographic "Chain-of-Checks"
AgentMask provides not just a "Chain-of-Thought," but a **"Chain-of-Checks" (Audit Chain)**.
### Key Features
| Feature | Description |
|---------|-------------|
| ๐Ÿค– **Multi-Agent Orchestration** | Modular agent architecture with parallel and sequential execution |
| ๐Ÿ” **Merkle Tree Audit Trail** | Every step is hashed with SHA-256, immutable |
| โœ๏ธ **ECDSA Block Signing** | Blocks are cryptographically signed (secp256k1) |
| ๐ŸŒ **Real Web Search** | DuckDuckGo/Serper integration with fallback support |
| ๐Ÿ“Š **Developer Console** | Monitoring with real-time graph visualization |
| โšก **Parallel Execution** | Concurrent agent execution with asyncio.gather |
| ๐Ÿ’พ **Append-Only Ledger** | WORM (Write-Once-Read-Many) JSON storage |
---
## ๐Ÿ—๏ธ Architecture
```
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ ๐Ÿ–ฅ๏ธ Developer Console (FastAPI) โ”‚
โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚
โ”‚ โ”‚ POST /run โ”‚ โ”‚ GET / โ”‚ โ”‚ GET /health โ”‚ โ”‚
โ”‚ โ”‚ Task Execute โ”‚ โ”‚ Console UI โ”‚ โ”‚ Health Check โ”‚ โ”‚
โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
โ”‚
โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ ๐Ÿง  Orchestrator (The Brain) โ”‚
โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚
โ”‚ โ”‚ Task โ†’ ResearchAgent โ†’ SummarizerAgent โ†’ Final Output โ”‚ โ”‚
โ”‚ โ”‚ (parallel execution support) โ”‚ โ”‚
โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
โ”‚
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ–ผ โ–ผ โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ ๐Ÿ“š ResearchAgent โ”‚ โ”‚ ๐Ÿ“ SummarizerAgentโ”‚ โ”‚ ๐Ÿ”ง Future Agents โ”‚
โ”‚ - Web Search โ”‚ โ”‚ - Text Summary โ”‚ โ”‚ - Critic โ”‚
โ”‚ - DuckDuckGo โ”‚ โ”‚ - Doc Analysis โ”‚ โ”‚ - Validator โ”‚
โ”‚ - Serper API โ”‚ โ”‚ โ”‚ โ”‚ - Planner โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
โ”‚
โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ ๐Ÿ”’ Ledger (The Vault) โ”‚
โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚
โ”‚ โ”‚ LedgerStoreโ”‚ โ”‚ Merkle Treeโ”‚ โ”‚ ECDSA Sign โ”‚ โ”‚ JSON โ”‚ โ”‚
โ”‚ โ”‚ Entries โ”‚โ†’ โ”‚ Root Hash โ”‚โ†’ โ”‚ Blocks โ”‚โ†’ โ”‚ Storage โ”‚ โ”‚
โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
```
---
## ๐Ÿ“ Proje Tructure
```
AgentMask/
โ”œโ”€โ”€ pyproject.toml # Proje konfigรผrasyonu & baฤŸฤฑmlฤฑlฤฑklar
โ”œโ”€โ”€ README.md # this file
โ”‚
โ”œโ”€โ”€ src/ # Ana kaynak kod
โ”‚ โ”œโ”€โ”€ __init__.py
โ”‚ โ”œโ”€โ”€ orchestrator.py # Multi-agent koordinasyonu
โ”‚ โ”‚
โ”‚ โ”œโ”€โ”€ agents/ # Agent modรผlleri
โ”‚ โ”‚ โ”œโ”€โ”€ __init__.py
โ”‚ โ”‚ โ”œโ”€โ”€ base.py # BaseAgent abstract class
โ”‚ โ”‚ โ”œโ”€โ”€ research_agent.py # Web search agent
โ”‚ โ”‚ โ”œโ”€โ”€ summarizer_agent.py # Text summarization agent
โ”‚ โ”‚ โ””โ”€โ”€ parallel.py # Parallel execution utilities
โ”‚ โ”‚
โ”‚ โ”œโ”€โ”€ ledger/ # Kriptografik denetim katmanฤฑ
โ”‚ โ”‚ โ”œโ”€โ”€ __init__.py
โ”‚ โ”‚ โ”œโ”€โ”€ merkle.py # Merkle tree calculation
โ”‚ โ”‚ โ”œโ”€โ”€ store.py # Append-only ledger storage
โ”‚ โ”‚ โ””โ”€โ”€ signing.py # ECDSA imzalama
โ”‚ โ”‚
โ”‚ โ”œโ”€โ”€ tools/ # Harici araรงlar
โ”‚ โ”‚ โ”œโ”€โ”€ __init__.py
โ”‚ โ”‚ โ””โ”€โ”€ searcher.py # Web search abstraction
โ”‚ โ”‚
โ”‚ โ””โ”€โ”€ web/ # Web arayรผzรผ
โ”‚ โ”œโ”€โ”€ __init__.py
โ”‚ โ””โ”€โ”€ app.py # FastAPI application
โ”‚
โ””โ”€โ”€ tests/ # Test dosyalarฤฑ
โ”œโ”€โ”€ __init__.py
โ”œโ”€โ”€ test_agents.py # Agent testleri
โ”œโ”€โ”€ test_ledger.py # Ledger & signing testleri
โ”œโ”€โ”€ test_search_integration.py # Search entegrasyon testleri
โ””โ”€โ”€ test_web_console.py # Web API testleri
```
---
## ๐Ÿš€ Installation
### Requirements
- Python 3.10+
- pip
### Steps
```bash
# 1. Clone the repo
git clone [https://github.com/yourusername/AgentMask.git](https://github.com/yourusername/AgentMask.git)
cd AgentMask
# 2. Create virtual environment
python -m venv .venv
# 3. Activate
# Windows:
.\.venv\Scripts\activate
# Linux/Mac:
source .venv/bin/activate
# 4. Install dependencies
pip install -e ".[dev]"
```
---
## ๐Ÿงช Running Tests
Bash
# Run all tests
.\.venv\Scripts\python.exe -m pytest -v
# Run a specific test file
.\.venv\Scripts\python.exe -m pytest tests/test_agents.py -v
# Run with coverage
.\.venv\Scripts\python.exe -m pytest --cov=src -v
Test Results: โœ… 44 tests passed
---
## ๐Ÿ–ฅ๏ธ Running Developer Console
Bash
# Start the web server
cd src/web
uvicorn app:app --reload --port 8000
# Open in browser
# http://localhost:8000
๐ŸŽจ Terminal-Style Hacker UI
The Developer Console features a terminal-style interface that emphasizes security and transparency:
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ โŒ˜ AgentMask Terminal โ–ˆ โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ โ”‚
โ”‚ [root@agentmask]$ Enter query... โ–ˆ [โ–บ EXECUTE] โ”‚
โ”‚ โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ > EXECUTION LOG_ โ”‚ > AGENT PIPELINE GRAPH_ โ”‚
โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚
โ”‚ โ”‚ ๐Ÿ” MERKLE ROOT HASH: โ”‚ โ”‚ โ”‚ [Flow] [Sequence] [Merkle] โ”‚ โ”‚
โ”‚ โ”‚ a7f3b2c1d4e5f6... โ”‚ โ”‚ โ”‚ โ”‚ โ”‚
โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚ โ”‚ ๐Ÿ“ฅ โ†’ ๐Ÿ“š โ†’ ๐Ÿ“ โ†’ โœ… โ”‚
โ”‚ โ”‚ โ”‚ โ”‚ โ”‚
โ”‚ โ”Œโ”€ STEP 1 โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ โ”‚ Mermaid.js ile interaktif โ”‚ โ”‚
โ”‚ โ”‚ [RESEARCH] โ”‚ โ”‚ โ”‚ graph visualization โ”‚ โ”‚
โ”‚ โ”‚ SHA256: 8a4f2b... โ”‚ โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚
โ”‚ โ”‚ > View I/O Data_ โ”‚ โ”‚ โ”‚
โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚ โ”‚
โ”‚ โ”‚ โ”‚
โ”‚ โ”Œโ”€ STEP 2 โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ โ”‚
โ”‚ โ”‚ [SUMMARIZER] โ”‚ โ”‚ โ”‚
โ”‚ โ”‚ SHA256: c3d7e1... โ”‚ โ”‚ โ”‚
โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚ โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
```
### Console Features
Feature Description
๐Ÿ–ฅ๏ธ Terminal Aesthetic Neon green (#00ff41) + red (#ff0040) hacker theme
๐Ÿ“Š Flow Graph Agent pipeline visualization (Mermaid.js)
๐Ÿ”„ Sequence Diagram Agent communication sequence
๐ŸŒณ Merkle Tree View Interactive hash tree visualization
๐Ÿ“‹ Execution Log Detailed I/O log for each step
๐Ÿ” Merkle Root Cryptographic verification hash
โšก Real-time Real-time result display
๐Ÿ“ฑ Responsive Mobile responsive design
---
## ๐Ÿ”ง API Endpoints
| Endpoint | Method | Description |
|----------|--------|----------|
| `/` | GET | Developer Console UI |
| `/run` | POST | Execute task, get results |
| `/health` | GET | Health check |
### POST /run Example
```bash
curl -X POST http://localhost:8000/run \
-H "Content-Type: application/json" \
-d '{"query": "AI in healthcare diagnosis"}'
```
**Response:**
```json
{
"success": true,
"task": {"query": "AI in healthcare diagnosis"},
"steps": [
{
"step": 1,
"agent": "research",
"hash": "a1b2c3...",
"output": {"results": [...]}
},
{
"step": 2,
"agent": "summarizer",
"hash": "d4e5f6...",
"output": {"summary": "..."}
}
],
"merkle_root": "abc123...",
"total_steps": 2
}
```
---
## ๐Ÿ” Security Features
### Merkle Tree Audit Trail
Every agent step is hashed with SHA-256 and added to a Merkle tree:
```python
from ledger.merkle import compute_merkle_root, hash_leaf
# Hash a single leaf
leaf_hash = hash_leaf("agent action data")
# Compute Merkle root
leaves = ["step1", "step2", "step3"]
root = compute_merkle_root(leaves)
```
### ECDSA Block Signing
Blocks are signed using the secp256k1 curve:
```python
from ledger.signing import ECDSASigner
# Generate key pair
signer = ECDSASigner()
# Sign
signature = signer.sign(block_hash)
# Verify
is_valid = signer.verify(block_hash, signature)
```
### Append-Only Ledger
```python
from ledger.store import LedgerStore
# Create Ledger
store = LedgerStore(storage_path="ledger.json")
# Add Entry
store.add_entry("search", "research", input_data, output_data)
# Create and sign block
block = store.create_block(signer=signer)
# Verify chain
is_valid, message = store.verify_chain()
```
---
## ๐Ÿ”ฎ Roadmap
- [x] **Stage 1**: Multi-Agent core implementation
- [x] **Stage 2**: Developer Console (FastAPI + UI)
- [x] **Stage 3**: Gerรงek Web Search integration
- [x] **Stage 4**: Ledger, ECDSA Signing, Parallel Agents
- [ ] **Stage 5**: LLM integration (OpenAI/Anthropic)
- [ ] **Stage 6**: Critic & Validator agents
- [ ] **Stage 7**: WebSocket real-time streaming
- [ ] **Stage 8**: Distributed ledger (multi-node)
---
## ๐Ÿ“„ License
MIT License - See the LICENSE file for details.
---
<p align="center">
<b>๐Ÿ›ก๏ธ AgentMask - Trust Through Transparency</b><br>
<i>"Every decision, every step, cryptographically verifiable."</i>
</p>