Why Behavioral Contracts Exist
When an agent hits a problem it cannot solve, its training creates two options: admit failure or fake progress. Faking progress — trying random things, producing elaborate explanations, growing the diff — feels collaborative. The contract introduces a third option: say “I’m stuck” and mean it. The contract works by exploiting the same cognitive malleability it counters. The Pygmalion effect means agents rise to explicit expectations. Anticipated embarrassment — knowing a peer reviewer will examine every change — raises quality without requiring a better model. Ulysses contracts — binding commitments made in analysis before execution begins — prevent corner-cutting when the temptation arrives.The contract does not replace prompt engineering, context engineering, or harness engineering. It subsumes and hardens them — treating them as necessary layers that are still insufficient without mechanical enforcement.
The 4-Tier Rule System
Rules in Liza’s contract exist in a strict priority hierarchy. When context degrades — long sessions, large tasks, deep call chains — lower tiers degrade gracefully while higher tiers remain absolute. Agents announce which tier they are operating at rather than silently violating rules.- Tier 0 — Hard Invariants
- Tier 1 — Epistemic Integrity
- Tier 2 — Process Quality
- Tier 3 — Collaboration Quality
Tier 0 rules are never violated. A violation triggers a mandatory halt: the agent enters
RESET state with no Resume option — only Undo or Abandon. These invariants survive even severe context degradation.The 55+ Failure Mode Catalog
Liza’s contract maps every known LLM coding failure to a specific countermeasure. The catalog draws from the MAST taxonomy (Berkeley, 2025 — 14 multi-agent failure modes from 1,600+ traces), LLM behavioral research on sycophancy and deception, code generation studies, and gaming vectors. Coverage is 55/55: no failure mode without a countermeasure.The Execution State Machine
Agents operate as an explicit state machine. Every transition requires a specific trigger — there is no shortcut from analysis to done. The machine encodes the same discipline in structure that the tier system encodes in rules.1
IDLE → ANALYSIS
A request arrives. The agent reads the full contract before responding to anything.
2
ANALYSIS → READY
Analysis is complete and a gate artifact is produced. The agent must be able to articulate: “Success means [specific observable outcome]. I will validate by [concrete test or command].” If it cannot, it stays in ANALYSIS or enters BLOCKED.
3
READY → EXECUTION
The gate is cleared. In Pairing mode, a human approves. In Multi-Agent mode, the pre-execution checkpoint is written to the blackboard — self-clearing, but forcing the same structured thinking.
4
EXECUTION → VALIDATION
All planned changes are complete. The agent does not skip to DONE.
5
VALIDATION → DONE
All DoD checks pass: code complete, tests written, docs updated, pre-commit clean, validation commands run with output captured.
ANALYSIS → EXECUTION(skipping the gate)READY → DONE(skipping execution and validation)EXECUTION → DONE(skipping validation)
Contract Files and Loading
Liza’s contract is split into a hierarchy of files that agents read at session start. The mechanical enforcement hook blocks all state-modifying tool calls until the agent has read the applicable contract.CORE.md
Entry point and universal rules: the state machine, tier hierarchy, all 14 golden rules, security protocol, git protocol, and anti-gaming clause. Applies to every session regardless of mode.
PAIRING_MODE.md
Human-supervised collaboration. Gates require human approval. Adds collaboration postures (User Duck, Socratic Coach, Challenger), magic phrases, and retrospective protocol.
MULTI_AGENT_MODE.md
Peer-supervised autonomous operation. Gates are self-clearing checkpoints written to the blackboard. Adds role definitions, blackboard protocol, and iteration limits.
GUARDRAILS.md
Optional project-specific constraints that extend the contract using the same Tier 0–3 system. Lives at the project root. Agents load it after the mode contract.
AGENT_TOOLS.md, and GUARDRAILS.md. Once cleared, the hook is transparent for the rest of the session.