How monolithic-dev/agent-mandate works
Agent Mandate is an authority gateway for AI agents: instructions and delegations are grounded in trusted human utterances, checked at the action boundary, and explained through graph lineage. The principal path is agent action → gateway check → authority decision → tenant graph, with held actions available for owner approval. The product also includes REST/MCP interfaces, lineage analysis, evaluations, notifications, and a web console. Some subsystem links are documented rather than shown in sampled implementation, so those links are marked dashed or omitted.
Main entry points: service.py Authority service · app.py REST API · Studio.tsx Console workflows · tenancy.py Tenant runtime
Components 22
Authority enforcement
- Action gateway
src/mandate/gateway/guard.py - Authority service
src/mandate/authority/service.py - Authority checks
src/mandate/authority/check.py - Instruction parser
src/mandate/authority/parser.py - Domain models
src/mandate/models/domain.py
Authority graph
- Tenant graph store
src/mandate/graph/store.py - FalkorDB client
src/mandate/graph/client.py - Tenant runtime
src/mandate/api/tenancy.py
Interfaces and operations
- REST API
src/mandate/api/app.py - MCP servers
src/mandate/mcp_servers/agent_server.py - Audit trail
src/mandate/api/audit.py - Webhook delivery
src/mandate/api/notify.py
Lineage and evaluation
- Lineage analysis
src/mandate/lineage/whatif.py - Evaluation harness
src/mandate/eval/runner.py
Web console
- Console application
ui/src/App.tsx - Console workflows
ui/src/pages/Studio.tsx - Typed API client
ui/src/api.ts - Graph explorer view
ui/src/components/GraphExplorer.tsx - Console UI primitives
ui/src/components/ui.tsx - Icon components
ui/src/icons.tsx
Other components
- AI agent
- Trusted owner
Connections 27
- AI agent → Action gateway: proposes action
README.md - Action gateway → Authority service: requests decision
README.md - Authority service → Authority checks: checks authority
src/mandate/authority/service.py - Authority service → Instruction parser: parses utterances
src/mandate/authority/service.py - Instruction parser → Domain models: creates instructions
src/mandate/authority/parser.py - Authority service → Domain models: validates entities
src/mandate/authority/service.py - Authority service → Tenant graph store: persists authority
- Tenant runtime → Authority service: builds runtime
src/mandate/api/tenancy.py - Tenant runtime → FalkorDB client: configures graph
src/mandate/api/tenancy.py - Tenant graph store → FalkorDB client: executes queries
- FalkorDB client → Tenant graph store: reads and writes
- REST API → Tenant runtime: resolves tenant
src/mandate/api/tenancy.py - REST API → Authority service: handles authority routes
- REST API → Action gateway: exposes action gate
README.md - REST API → Audit trail: records changes
src/mandate/api/app.py - REST API → Webhook delivery: notifies owners
src/mandate/api/app.py - MCP servers → Action gateway: offers agent tools
README.md - Trusted owner → REST API: manages authority
README.md - Authority service → Lineage analysis: supports what-if
src/mandate/lineage/whatif.py - Lineage analysis → Tenant graph store: replays graph state
README.md - Evaluation harness → Tenant runtime: runs scenarios
- Console application → Console workflows: routes workflows
ui/src/App.tsx - Console workflows → Typed API client: requests API data
ui/src/api.ts - Typed API client → REST API: calls REST endpoints
ui/src/api.ts - Console workflows → Graph explorer view: renders graph exploration
- Console workflows → Console UI primitives: uses primitives
ui/src/App.tsx - Console UI primitives → Icon components: renders icons
ui/src/components/ui.tsx