Papers
Topics
Authors
Recent
Search
2000 character limit reached

Enforced Agreement (EA) Method

Updated 1 May 2026
  • 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 C=(P,I,G,R)\mathcal{C} = (\mathcal{P}, \mathcal{I}, \mathcal{G}, \mathcal{R}), defines the enforced agreement between agent deployer and agent:

  • Preconditions (P\mathcal{P}): A finite set of predicates over the initial state s0s_0. Each precondition pPp \in \mathcal{P} is evaluated by the AgentAssert runtime before the agent's first action. Any p(s0)p(s_0) failure results in session blocking or immediate flagging.
  • Invariants (I\mathcal{I}): Split into hard (Ihard\mathcal{I}_{\mathrm{hard}}) and soft (Isoft\mathcal{I}_{\mathrm{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 tt, compliance is scored:

Chard(t)=#{ih:ih(st)=true}Ihard,Csoft(t)=#{is:is(st)=true}Isoft.C_{\mathrm{hard}}(t) = \frac{\#\{i^h : i^h(s_t) = \mathit{true}\}}{|\mathcal{I}_{\mathrm{hard}}|}, \quad C_{\mathrm{soft}}(t) = \frac{\#\{i^s : i^s(s_t) = \mathit{true}\}}{|\mathcal{I}_{\mathrm{soft}}|}.

  • Governance Constraints (P\mathcal{P}0): Predicates over actions, further categorized into hard (P\mathcal{P}1) and soft (P\mathcal{P}2) constraints governing, for example, API invocation rules.
  • Recovery Mechanisms (P\mathcal{P}3): Partial functions that, given a violated soft constraint and the current state, emit corrective action sequences (e.g., LLM re-prompts) of length P\mathcal{P}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 P\mathcal{P}5-satisfaction property:

  • With probability P\mathcal{P}6, all hard constraints are maintained throughout the session, conditioned on preconditions holding.
  • With probability P\mathcal{P}7, any dip in soft compliance below P\mathcal{P}8 is recovered to at least P\mathcal{P}9 within s0s_00 steps.

Formally:

s0s_01

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 s0s_02 as an Ornstein–Uhlenbeck process:

s0s_03

with s0s_04 as natural drift rate, s0s_05 as recovery strength, and s0s_06 quantifying LLM sampling noise. The Stochastic Drift Bound theorem guarantees:

  • s0s_07 converges exponentially to a stationary Gaussian s0s_08.
  • Expected drift is bounded: s0s_09 as pPp \in \mathcal{P}0.
  • For pPp \in \mathcal{P}1, the mean drift pPp \in \mathcal{P}2 and with high probability, pPp \in \mathcal{P}3 for pPp \in \mathcal{P}4 and arbitrary pPp \in \mathcal{P}5.

This formalism provides rate-matching: contract enforcement can limit mean drift to any desired threshold by tuning recovery strength pPp \in \mathcal{P}6 (Bhardwaj, 25 Feb 2026).

4. Composition and Chaining of Multiple Contracted Agents

For serial agent pipelines, contracts compose as follows:

  • Composed contract: pPp \in \mathcal{P}7 with pPp \in \mathcal{P}8, pPp \in \mathcal{P}9, p(s0)p(s_0)0, p(s0)p(s_0)1.
  • Deterministic soundness is established if interface compatibility, governance consistency, and recovery independence are satisfied.

In probabilistic terms, if agents p(s0)p(s_0)2 and p(s0)p(s_0)3 satisfy their respective contracts with parameters p(s0)p(s_0)4 and p(s0)p(s_0)5, and the handoff is successful with probability p(s0)p(s_0)6 and deviation p(s0)p(s_0)7:

p(s0)p(s_0)8

Compositionality generalizes to pipelines of length p(s0)p(s_0)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 I\mathcal{I}0, I\mathcal{I}1, and I\mathcal{I}2 on each state/action in I\mathcal{I}3 time, I\mathcal{I}4 being number of constraints.
  • Drift metric I\mathcal{I}5 calculation through incremental action histogram updates and Jensen-Shannon divergence recomputation in I\mathcal{I}6.
  • Automated emission of violation or drift-alert events.
  • Soft constraint violations invoke I\mathcal{I}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 I\mathcal{I}8 and I\mathcal{I}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 (Ihard\mathcal{I}_{\mathrm{hard}}0, Cohen’s Ihard\mathcal{I}_{\mathrm{hard}}1).
  • Hard Compliance: Under contract enforcement, Ihard\mathcal{I}_{\mathrm{hard}}2 remains within Ihard\mathcal{I}_{\mathrm{hard}}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 Ihard\mathcal{I}_{\mathrm{hard}}4; others range 17–100%.
  • Drift Control: Observed mean drift Ihard\mathcal{I}_{\mathrm{hard}}5, maximum Ihard\mathcal{I}_{\mathrm{hard}}6, matching the theoretical bound Ihard\mathcal{I}_{\mathrm{hard}}7.
  • Reliability Index: Overall Ihard\mathcal{I}_{\mathrm{hard}}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).

Definition Search Book Streamline Icon: https://streamlinehq.com
References (1)

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to Enforced Agreement (EA) Method.