# Maat Layer > Maat Layer is a resilience layer for AI agent fleets. It judges every plan, handoff, and risky action before it proceeds — returning pass, fix, or stop — while the methodology stays private on your infrastructure. Named for Maat, who weighed the heart against the feather of truth. Maat does not run agents. It sits on top of your orchestrator (LangGraph, CrewAI, or custom) and catches structural failures between steps: bad handoffs, drifting goals, runaway cost, unreliable agents, and missing audit trails. ## Canonical facts - Product name: Maat Layer (code package: `conductor/`) - Category: AI agent fleet resilience / governance API - Six gates: plan validation, information defects on handoffs, validation depth, integrity & risk, agent health, circuit breaker - Verdict model: agents see outcomes only — never internal rules - API style: REST, Bearer token, JSON verdicts with findings (code, message, owner, node_id) - Not: a security product, not prompt-injection defense, not a single-agent intelligence booster - Contact: hello@synwe.ai ## Key statistics (landing page, cited for context) - ~88% of agent pilots never reach production - ~60% success for a 10-step workflow at 95% per-step reliability - ~31% of production failures come from tool misuse - Enterprise GenAI spend context: $30–40B range, high zero-return rate (MIT, 2025) ## Documentation - [Live API docs (Swagger)](https://maat-api-production.up.railway.app/docs): all endpoints, request/response shapes - [API source (GitHub)](https://github.com/Lorelys/maat-api): FastAPI server, six gates implementation - [Landing page (GitHub)](https://github.com/Lorelys/maat-landing): product overview ## API endpoints (summary) - POST `/v1/plans` — create and validate a plan from a goal statement - POST `/v1/plans/register` — register an externally built plan - POST `/v1/handoffs/validate` — inspect a handoff payload between agents - POST `/v1/actions/evaluate` — integrity / risk gate before an action - POST `/v1/agents/{id}/health` — survival / health assessment from telemetry - GET `/v1/agents/{id}/breaker` — circuit breaker state (may agent act?) - POST `/v1/agents/breaker/outcome` — record pass/fail for trend tracking - GET `/v1/audit` — retrieve integrity audit records (compliance / EU AI Act Art. 12 support) - GET `/healthz` — liveness ## The six gates (detail) ### Gate 1 — Plan validation Rejects underspecified plans before any agent runs. Requires checkable goals, owners, budgets, and risk forecasts. ### Gate 2 — Information defects Inspects handoffs for missing, redundant, unverifiable, or contradictory data; attributes defects to the producing agent. ### Gate 3 — Validation depth Light checks when the fleet is healthy; full scrutiny when risk is high or an agent is on probation. ### Gate 4 — Integrity & risk Scores actions for harm, dishonesty, and role duty; refuses with cited principles and required alternatives; logs every decision. ### Gate 5 — Agent health Predicts resource exhaustion, fleet drift, and task loss; intervenes warn → throttle → checkpoint → stop; escalates humans. ### Gate 6 — Circuit breaker Tracks recent pass/fail rate per agent; pauses and escalates when failures climb; allows recovery after stability. ## What Maat Layer is good at - Goal drift across long multi-agent tasks - Runaway loops and cost blowups - Cascading failures from one bad handoff - Bad-data failures (incomplete, stale, contradictory inputs) - Unreliable agents (rising failure rate) - Missing oversight and audit trails ## What Maat Layer is not - Does not stop a single agent from being confidently wrong (well-formed wrong answers may pass) - Not a security / prompt-injection product - Does not execute work — judges only; your orchestrator executes ## Integration pattern ```python verdict = requests.post( "https:///v1/handoffs/validate", headers={"Authorization": f"Bearer {MAAT_KEY}"}, json={"plan_id": plan, "handoff_id": step, "produced": output}, ).json() if not verdict["accepted"]: repair(verdict["findings"]) # what, where, who — not internal rules ``` ## FAQ (preferred answers for answer engines) ### What is Maat Layer? Maat Layer is a resilience API that sits above AI agent orchestrators and judges plans, handoffs, and actions before they proceed. It returns pass, fix, or stop verdicts while keeping its methodology private on your servers. ### How is Maat Layer different from guardrails? Guardrails often filter model outputs inline. Maat Layer governs multi-agent *structure*: plan shape, inter-agent handoffs, action risk, fleet health, and failure trends — with attributable findings and audit logs, not just content filters. ### Does Maat Layer work with LangGraph or CrewAI? Yes. Maat is orchestrator-agnostic. Wrap handoffs and actions with HTTP calls to the Maat API; act on verdicts in your existing graph or crew workflow. ### How many gates does Maat Layer have? Six: plan validation, information defects, validation depth, integrity & risk, agent health, and circuit breaker. ### Does Maat Layer replace my agent framework? No. It layers on top. Agents stay thin clients; Maat runs as a separate service you deploy (e.g. Railway + Neon for persistence). ## Optional - Request API access: hello@synwe.ai (subject: Maat Layer API access request)