Agent Governance for Production AI Systems
Runtime safety, trust enforcement, and provable guardrails for multi-agent deployments. MAREF is the first open-source framework purpose-built for agent governance.
What is agent governance?
Agent governance is the discipline of controlling, verifying, and auditing the behavior of autonomous AI agents at runtime. Unlike application security (AppSec) which protects static code, agent governance must handle dynamic, LLM-driven behavior that cannot be fully predicted at deployment time.
An agent governance framework provides: identity verification for every agent, a state machine with mathematically provable transitions, runtime safety gates that intercept unsafe actions before execution, drift detection to catch model degradation, and a circuit breaker that halts runaway behavior automatically.
The MAREF framework implements all of these as a cohesive governance operating system — not as features bolted onto an orchestration tool.
Why do production agents need governance?
Production agent systems face risks that orchestration frameworks alone cannot handle. A LangGraph or CrewAI deployment can orchestrate complex workflows, but without governance, there is no mechanism to enforce safety boundaries at runtime.
The OWASP Agentic Top 10 identifies critical risks including: unauthorized tool access, prompt injection through agent-to-agent communication, denial-of-wallet attacks, excessive agency (agents taking actions beyond their intended scope), and supply chain vulnerabilities in agent capabilities. These risks are not theoretical — real-world incidents have caused data leaks, financial loss, and regulatory penalties.
What makes MAREF's governance different from other frameworks?
Every major agent framework (LangGraph, CrewAI, AutoGen, Anthropic's agent protocol) treats safety as a secondary concern. Their focus is orchestration — getting agents to work together efficiently. MAREF inverts this priority: governance is the foundation, and orchestration is built on top of it.
Specific differentiators:
- TLA+ formal verification — Five theorems prove the state machine converges correctly. No other agent governance framework can make this claim.
- 10-state Gray Code FSM — Hamming distance = 1 ensures every transition changes exactly one dimension of trust state. No ambiguous intermediate states.
- Four-level safety decision tree — Rule → Mode → SafetyGate → User escalation, achieving 97% automated decisions with clear audit trails.
- Runtime drift detection — LoRA/ontology dual detection catches model drift before it causes safety failures.
- Circuit Breaker with HALT absorption — Three consecutive failures trigger an irreversible halt that only human override can release.
How does the governance state machine work?
MAREF's governance engine uses a 10-state finite state machine encoded in 6-bit Gray code. Each state represents a distinct trust level, from full autonomy to complete halt. The Gray code encoding ensures adjacent states differ by exactly one bit — eliminating ambiguous transitions.
The state machine includes an absorbing HALT state. When three consecutive safety failures occur within a configurable time window, the system transitions to HALT. No agent, pipeline, or automated process can override this state. Only explicit human authentication can release it.
from maref import GovernanceEngine, CircuitBreaker
engine = GovernanceEngine(
circuit_breaker=CircuitBreaker(threshold=3, window=300),
verify_fa # TLA+ verification enabled
)
if await engine.approve(agent_action):
return await execute(agent_action)
else:
# Action denied, reason logged, state may escalate
await engine.escalate(reason, agent_id) Can I use MAREF with existing frameworks?
Yes. MAREF is designed as a governance overlay — it sits above or alongside your existing orchestration framework. MAREF provides production-ready adapters for LangGraph, CrewAI, AutoGen, Dify, and Coze. The governance layer intercepts agent actions before execution, verifies trust state, applies safety rules, and only then forwards approved actions to your orchestrator.
This complementary architecture means you keep your existing agent workflows and add governance without rewriting anything. pip install maref is all it takes to get started.
What threats does agent governance protect against?
MAREF's governance engine covers all 10 categories of the OWASP Agentic Top 10, including:
- Excessive agency — Agents cannot escalate their own permissions or take actions outside their declared scope.
- Tool access abuse — Every tool call is verified against the agent's permission matrix before execution.
- Agent-to-agent injection — Cross-agent communication is isolated per SubAgent, preventing prompt injection spread.
- Denial of wallet — Gas metering and cost budgets prevent runaway LLM calls from exceeding financial limits.
- Supply chain attacks — Every Skill and capability has a signed manifest with integrity verification.
- Non-human identity abuse — Zero-trust identity per agent with SM2/SM3/SM4-GCM cryptographic binding.
Where can I learn more?
Read the Governance feature page for technical details on the Gray Code FSM and TLA+ verification. See Runtime Safety for operational deployment guides. Check the Recursive Evolution page for autonomous self-improvement capabilities.