Masumi-compatible AI agents for the Cardano ecosystem.
AI-powered triage of Aikido security analysis findings for Aiken smart contracts. Classifies each finding as true/false positive with detailed reasoning, mitigating patterns, and remediation priorities.
Single plan:
- Deep Analysis (4.99 USDM) — Two-pass LLM review with cross-finding correlation.
railway.toml is configured for API service deployment (agents/aikido-reviewer/Dockerfile).
railway.worker.toml is provided for the Kodosumi worker service (agents/aikido-reviewer/Dockerfile.kodosumi-worker).
Create these Railway services in the same project:
aikido-reviewer-api(public MIP-003 API)aikido-reviewer-kodosumi-worker(internal execution worker)aikido-reviewer-kodosumi-panel(Kodosumi admin web panel/control plane + colocated form runtime)
Optional:
4. aikido-reviewer-kodosumi-ui (standalone public OpenAPI/form endpoint for direct testing only)
Set these Railway variables on the API service:
ANTHROPIC_API_KEYPAYMENT_SERVICE_URL(must end with/api/v1)PAYMENT_API_KEYAGENT_IDENTIFIERSELLER_VKEYNETWORK=PreprodKODOSUMI_ENABLED=false(default, enable for canary rollout)KODOSUMI_INTERNAL_URL=https://<worker-service>.up.railway.appKODOSUMI_INTERNAL_TOKEN=<shared-secret>KODOSUMI_REQUEST_TIMEOUT_SECONDS=90KODOSUMI_CANARY_HEADER_NAME=x-kodosumi-canaryKODOSUMI_FALLBACK_ON_ERROR=true
Set these Railway variables on the worker service:
ANTHROPIC_API_KEYKODOSUMI_INTERNAL_TOKEN=<same-shared-secret-as-api>HOST=0.0.0.0PORT=8021
Set these Railway variables on the optional standalone Kodosumi UI service:
ANTHROPIC_API_KEYHOST=0.0.0.0PORT=8031KODOSUMI_LAUNCH_TIMEOUT_SECONDS=20KODOSUMI_RAY_NUM_CPUS=1KODOSUMI_RAY_OBJECT_STORE_MEMORY=78643200- optional:
KODOSUMI_INTERNAL_TOKEN(only needed if you also expose internal execution on same runtime)
Set these Railway variables on the Kodosumi panel service:
ANTHROPIC_API_KEYKODO_ADMIN_EMAIL(admin account contact email, e.g.admin@example.com)KODO_ADMIN_PASSWORD(password for panel login useradmin)KODO_SECRET_KEY(JWT signing secret for panel auth)HOST=0.0.0.0PORT=8080KODO_LOCAL_UI_ENABLED=true(recommended; starts colocated UI in same service so launch/status/timeline share state)- optional:
KODO_LOCAL_UI_PORT=8031 - optional:
KODO_LOCAL_UI_HOST=127.0.0.1 - optional:
KODO_LOCAL_UI_HEALTH_TIMEOUT_SECONDS=45 - optional:
REGISTER_ENDPOINT=https://<external-openapi>/openapi.json(used only whenKODO_LOCAL_UI_ENABLED=false, or when explicitly included) - optional:
KODO_LOCAL_UI_INCLUDE_EXTERNAL_REGISTERS=false(settrueonly if you intentionally want both local + external registers) - optional one-time reset:
KODO_RESET_ADMIN_DB=true(set back tofalseafter first successful login) - optional:
KODO_PATCH_HEALTH_AUTH=true(recommended on Railway; keeps/healthpublicly checkable for platform probes) - optional:
KODO_PATCH_HTTPS_PROXY=true(recommended on Railway; prevents panel form POST downgrade through proxy) - optional:
KODO_PATCH_PROXY_HOST=true(recommended on Railway; avoids forwarding panel host header to registered services) - optional:
KODOSUMI_RAY_NUM_CPUS=1 - optional:
KODOSUMI_RAY_OBJECT_STORE_MEMORY=78643200
Optional (auto-scan tuning):
AIKIDO_TIMEOUT_SECONDSAIKIDO_GIT_CLONE_TIMEOUT_SECONDSALLOWED_REPO_HOSTS
Suggested Railway config usage:
# API service
cp railway.toml railway.current.toml
# Worker service (set in Railway service settings or deploy from this file)
cp railway.worker.toml railway.current.tomlFor the optional standalone UI service use Dockerfile:
agents/aikido-reviewer/Dockerfile.kodosumi-ui
Start command is baked into image:
python ui_main.py
For the panel service use:
railway.panel.toml- Dockerfile
agents/aikido-reviewer/Dockerfile.kodosumi-panel
Start command is baked into image:
python panel_main.py
Panel URL to open in browser:
https://<panel-service>.up.railway.app/
Important: the kodosumi-ui URL is not the panel frontend. It is only an OpenAPI/form app.
For end-to-end panel execution on Railway, use colocated UI in the panel service (KODO_LOCAL_UI_ENABLED=true) so submitted executions and status/timeline reads use the same execution store.
Panel login username is always admin; password is KODO_ADMIN_PASSWORD.
Panel routes to use after login:
/admin/flow/admin/routes/admin/timeline/view/admin/dashboard
If you curl panel root without browser-style HTML accept headers, a 401 JSON response is expected. Open the URL in browser for the frontend UI.
cp .env.masumi.example .env.masumi
# Fill in BLOCKFROST_API_KEY_PREPROD and ADMIN_KEY
docker compose up -d./scripts/register-agent.sh
# Follow prompts — fund wallet, register via admin dashboard, note your identifierscd agents/aikido-reviewer
cp .env.example .env
# Fill in ALL values from registration:
# ANTHROPIC_API_KEY, PAYMENT_SERVICE_URL, PAYMENT_API_KEY,
# SELLER_VKEY, AGENT_IDENTIFIER, NETWORK
python main.pyThe agent will validate all required config on startup and refuse to start if anything is missing.
The agent supports two workflows:
scan_mode=manual(default):- provide
aikido_report(Aikido JSON,aikido.findings.v1) - provide
source_files(JSON map of path -> source)
- provide
scan_mode=auto:- provide
source_fileswith a full Aiken project (must includeaiken.toml) ORrepo_url - omit
aikido_report - agent runs Aikido CLI after payment, then performs triage
- provide
review_depth is deprecated and ignored. The agent always runs deep analysis.
Optional controls for canary routing:
input_datakeyexecution_backend:default(local execution)kodosumi(worker execution, requiresKODOSUMI_ENABLED=true)
- HTTP header
x-kodosumi-canary: 1(header name configurable viaKODOSUMI_CANARY_HEADER_NAME)
/status includes:
execution_backendexecution_meta.worker_request_idexecution_meta.duration_msexecution_meta.fallback_used
For Masumi preprod testing, use the official dispenser at dispenser.masumi.network.
It supports claiming test assets (including ADA and USDM) using the verification code from your Masumi registration email.
If you see repeated Blockfrost 402 Project Over Limit errors in payment/registry logs, your E2E payment flow will fail until you replace or upgrade the BLOCKFROST_API_KEY_PREPROD.
Hybrid runtime behavior:
- Default jobs execute in-process on API service.
- Canary jobs can execute on Kodosumi worker by either:
execution_backend=kodosumiininput_data, or- request header
x-kodosumi-canary: 1(whenKODOSUMI_ENABLED=true).
- Worker failures can automatically fall back to default execution (
KODOSUMI_FALLBACK_ON_ERROR=true).
Local worker startup:
cd agents/aikido-reviewer
pip install -r requirements-worker.txt
python worker_main.pyRay Serve + Koco bootstrap:
# Validate toolchain
./scripts/koco-bootstrap.sh check
# Deploy serve config + app config
./scripts/koco-bootstrap.sh deploy
# Start koco runtime (if needed in your environment)
./scripts/koco-bootstrap.sh startOperational checklist: docs/kodosumi-rollout-runbook.md
- Buyer discovers the agent on Sokosumi or calls
/start_jobdirectly - Masumi creates a payment request — buyer pays in USDM on Cardano
- On payment confirmation, the agent runs the Aikido review:
- default backend: local in-process pipeline
- canary backend: Kodosumi worker (
/internal/execute) with retry + optional fallback
- Results are delivered via
/statusand settled on-chain
Unit tests validate the pipeline without making LLM calls or requiring payment:
cd agents/aikido-reviewer
pip install pytest pydantic anthropic
python -m pytest tests/ -vFor Railway-first smoke testing (no local docker required):
# 1) Inspect assigned purchasing/selling wallets on your payment service
PAYMENT_SERVICE_URL=https://<payment-service>/api/v1 \
PAYMENT_ADMIN_TOKEN=<admin-token> \
./scripts/inspect-payment-wallets.sh
# 2) Smoke test deployed agent API flow up to awaiting_payment
AGENT_BASE_URL=https://<agent-service>.up.railway.app \
./scripts/e2e-railway.sh
# Optional: force canary backend request markers in /start_job
AGENT_BASE_URL=https://<agent-service>.up.railway.app \
KODOSUMI_CANARY=1 \
./scripts/e2e-railway.shGitHub CI is included at .github/workflows/ci.yml and runs pytest for every push and pull request.
masumi-agents/
├── agents/aikido-reviewer/
│ ├── main.py # MIP-003 FastAPI (payment-gated)
│ ├── execution_backend.py # Backend router + worker client
│ ├── kodosumi_app.py # Kodosumi form app + internal worker endpoints
│ ├── worker_main.py # Dedicated worker service entrypoint
│ ├── agent.py # Pipeline orchestrator
│ ├── analyzer.py # LLM + heuristic analysis
│ ├── prompts.py # Domain-aware prompt templates
│ ├── schemas.py # Pydantic I/O models
│ ├── source_extractor.py # Code snippet extraction
│ ├── report_builder.py # Risk scoring + report assembly
│ ├── Dockerfile # API service image
│ ├── Dockerfile.kodosumi-worker
│ └── tests/ # 42 unit tests
├── data/config/ # Kodosumi deployment configs
├── railway.toml # API service Railway config
├── railway.worker.toml # Worker service Railway config
├── docker-compose.yml # Masumi node (Postgres + Payment + Registry)
├── scripts/ # Setup and registration scripts
└── .env.masumi.example # Masumi node config template
| Plan | Anthropic Cost | USDM Price | Description |
|---|---|---|---|
| Deep Analysis | ~$0.40-0.60 | 4.99 USDM | Two-pass LLM review with correlation |
Masumi AgentPricing amount for this price is 4990000 with unit USDM.