Enforced Agreement (EA) Method
- The EA Method is a framework that decomposes agent behavior into preconditions, invariants, governance constraints, and recovery mechanisms to ensure robust compliance.
- It offers probabilistic guarantees and drift bounding by modeling agent behavior with stochastic processes and rigorous enforcement protocols.
- The method enables composable runtime enforcement in agent pipelines with minimal overhead, validated by empirical benchmarks on multiple LLM models.
The Enforced Agreement (EA) Method operationalizes formal, runtime-enforceable contracts for autonomous AI agents, specifically as realized in the Agent Behavioral Contracts (ABC) framework. By decomposing agent behavior into preconditions, invariants, governance constraints, and recovery mechanisms, the EA Method ensures that LLM-based agents comply with declarative, probabilistic contracts throughout execution. This approach extends design-by-contract principles from traditional software engineering to the inherently non-deterministic field of LLM agents, introducing strict formalism for contract structure, provable probabilistic guarantees, drift bounding, composability in agent pipelines, and practical runtime enforcement with empirical validation across diverse agentic platforms (Bhardwaj, 25 Feb 2026).
1. Formal Structure of Enforced Agreement Contracts
Each ABC contract, denoted , defines the enforced agreement between agent deployer and agent:
- Preconditions (): A finite set of predicates over the initial state . Each precondition is evaluated by the AgentAssert runtime before the agent's first action. Any failure results in session blocking or immediate flagging.
- Invariants (): Split into hard () and soft () invariants; hard invariants (e.g., “no PII emission”) must be satisfied at every turn, with breach leading to contract violation, while soft invariants (e.g., “professional tone”) can be transiently violated but must be restored by the recovery mechanism within a bounded window. At each turn , compliance is scored:
- Governance Constraints (0): Predicates over actions, further categorized into hard (1) and soft (2) constraints governing, for example, API invocation rules.
- Recovery Mechanisms (3): Partial functions that, given a violated soft constraint and the current state, emit corrective action sequences (e.g., LLM re-prompts) of length 4. If undefined, a RecoveryFailed event is emitted.
This modularized structure enables continuous runtime enforcement: evaluating preconditions before execution, checking invariants and governance at each step, and invoking recovery upon soft constraint violation (Bhardwaj, 25 Feb 2026).
2. Probabilistic Satisfaction and Compliance Guarantees
Given the stochasticity of LLM agents, the EA Method defines contract satisfaction via the 5-satisfaction property:
- With probability 6, all hard constraints are maintained throughout the session, conditioned on preconditions holding.
- With probability 7, any dip in soft compliance below 8 is recovered to at least 9 within 0 steps.
Formally:
1
These conditions correspond to PCTL formulas, providing a rigorous probabilistic semantics fully accounting for the non-determinism of LLM outputs. This approach yields explicit, measurable contract compliance guarantees across agent sessions (Bhardwaj, 25 Feb 2026).
3. Drift Bounding via Stochastic Process Modeling
To quantify and control behavioral drift, the EA Method models cumulative deviation 2 as an Ornstein–Uhlenbeck process:
3
with 4 as natural drift rate, 5 as recovery strength, and 6 quantifying LLM sampling noise. The Stochastic Drift Bound theorem guarantees:
- 7 converges exponentially to a stationary Gaussian 8.
- Expected drift is bounded: 9 as 0.
- For 1, the mean drift 2 and with high probability, 3 for 4 and arbitrary 5.
This formalism provides rate-matching: contract enforcement can limit mean drift to any desired threshold by tuning recovery strength 6 (Bhardwaj, 25 Feb 2026).
4. Composition and Chaining of Multiple Contracted Agents
For serial agent pipelines, contracts compose as follows:
- Composed contract: 7 with 8, 9, 0, 1.
- Deterministic soundness is established if interface compatibility, governance consistency, and recovery independence are satisfied.
In probabilistic terms, if agents 2 and 3 satisfy their respective contracts with parameters 4 and 5, and the handoff is successful with probability 6 and deviation 7:
8
Compositionality generalizes to pipelines of length 9 via induction, with reliabilities multiplying and drifts adding, mirroring the well-studied cascading degradation effects (the "broken telephone" phenomenon) (Bhardwaj, 25 Feb 2026).
5. AgentAssert: Runtime Enforcement Architecture
AgentAssert implements the EA Method's runtime enforcement:
- Constraint evaluation for 0, 1, and 2 on each state/action in 3 time, 4 being number of constraints.
- Drift metric 5 calculation through incremental action histogram updates and Jensen-Shannon divergence recomputation in 6.
- Automated emission of violation or drift-alert events.
- Soft constraint violations invoke 7 if defined; resulting actions (e.g., LLM re-prompt) are verified post-execution.
This provides an enforcement overhead consistently below 10 ms per action for 8 and 9, negligible when compared to LLM generation latency (100–2000 ms), confirming practical runtime feasibility (Bhardwaj, 25 Feb 2026).
6. Empirical Validation and Observed Performance
Empirical evaluation on the AgentContract-Bench suite, spanning 1,980 sessions across 7 LLM models (including GPT-5.2, Claude Opus 4.6, DeepSeek-R1, Grok-4 Fast, Llama 3.3 70B, Mistral 3, and GPT-4o-mini), demonstrates several key outcomes:
- Soft Violations: Contracted agents surface 5.2–6.8 soft violations per session, undetected by uncontracted baselines, with statistical significance (0, Cohen’s 1).
- Hard Compliance: Under contract enforcement, 2 remains within 3, with up to +4.5 percentage point compliance improvements for weaker models.
- Recovery Success: For 12-turn sessions, frontier models exhibit 100% soft recovery within 4; others range 17–100%.
- Drift Control: Observed mean drift 5, maximum 6, matching the theoretical bound 7.
- Reliability Index: Overall 8 across all evaluated cases.
These results affirm the EA Method's capacity to formally enforce behavioral contracts, provide robust drift control, support modular agentic compositions, and surface violations and compliance deviations previously invisible in LLM agent operation (Bhardwaj, 25 Feb 2026).