Foxley Quality Intelligence · Research Brief

Prove the agent plan, inspect actual execution

Lean4Agent distinguishes process structure, conditional semantics and runtime checks. Its formal proof depends on explicit assumptions about model steps.

AI & automationInspection processesValidationTest planningQuality assurance
4 min read
Three assessment levels distinguish process structure, conditions under model assumptions and actual execution. A conditional proof replaces neither observed evidence nor technical outcome checks.Open full-size graphic
FQI original illustration: Separate process proof from actual execution. FQI inspection proposal based on the original study; not study measurements.
View:

Executive summary

An artificial intelligence (AI) agent can follow a formally consistent plan and still execute an individual step incorrectly. Lean4Agent explicitly distinguishes these issues. A formal language checks the structure and conditions of the planned process; actual execution traces are subsequently checked against expected outcomes.

Formally passing processes solve more tasks on average in the experiments. This is bounded empirical evidence, not proof of reliable model answers. Quality practitioners gain a way to make information handovers explicit and to keep planning evidence separate from execution evidence.

FQI takeaway

  • Make handovers testable: Specify what information each step needs and what must be established afterwards.
  • Expose assumptions: A formal process proof does not certify unobserved model performance.
  • Check execution traces separately: Compare expected states with actual tool outputs and independent outcome tests.

The principle at a glance

Lean4Agent uses Lean, a language for machine-checkable mathematical proofs. It represents an agent process as connected steps and transitions. Each step reads information and produces further information. Formal checking can identify a later step that requires data never supplied earlier.

A second level additionally assumes that a model step can establish its promised output conditions when the input conditions hold. This assumption still needs checking during actual execution. A third level therefore examines concrete execution traces rather than stopping at the process plan.

Terms explained

  • Precondition: A property that must hold before a step.
  • Postcondition: A property the step is expected to establish afterwards.
  • Predicate: A precisely expressed statement about data or states that can be checked.
  • Execution trace: A record of the steps, inputs and outcomes actually observed.

Deep dive

The first level looks for structural problems: reachable steps, valid transitions and available variables. The second follows semantic conditions through the process. This includes information handovers that can otherwise remain hidden, such as whether a later step can access earlier conversation content.

One example concerns a verification task that needs evidence from a preceding repair step. The process instead uses isolated tasks and does not adequately pass the required information. The instruction sounds reasonable, but its information supply fails its own prerequisite. Such a gap can be investigated before execution.

The third level examines actual states after execution. Some properties can be checked directly in Lean. Others use external validation programs; language-defined properties are sometimes assessed by another language model. These forms of evidence cannot all be described as mathematical proof of the results.

The experiments use 50 difficult software tasks and 100 research-paper questions. Three formally passing and three failing processes per task domain are compared using five models. Average software-task success is 58.27 versus 43.47 percent.

Research-paper question success is 36.60 versus 27.53 percent. These comparisons concern selected process groups and do not establish a universal causal effect of one verification step.

An additional human review checks 1,460 automatically generated condition annotations and finds 36 faulty formulations. Correcting them changes no pass/fail result across the twelve examined processes. This is a limited robustness observation, not assurance that automatically generated requirements are always adequate.

For an FQI pilot, choose a small recurring inspection process. Give each handover input evidence, expected outcomes and a named reviewer. An automated cause analysis, for example, needs explicit findings before a hypothesis can be assessed.

Check structure and formal conditions before the run. Afterwards, examine actual evidence, tool outputs and technical correctness separately. Record missing information as a handover fault rather than replacing it with a plausible answer.

Limitations and risks

Lean4Agent remains preliminary research on limited task subsets. Some semantics come from model-generated annotations. Requirements that cannot be fully formalised, together with model-based judgements, leave uncertainty outside the proof. Process evolution also partly retests the same previously failed problem; it supplies no independent generalisation guarantee.

Even one successful run proves neither complete requirements coverage nor future reliability. The voluntary National Institute of Standards and Technology (NIST) framework supports traceable validation and evaluation of assessment methods, without confirming particular Lean4Agent performance.

FQI conclusion

The approach is useful when the scope of each assurance claim stays visible. A plan can be structurally correct and internally consistent under stated assumptions. Whether the model meets those assumptions in a specific case requires additional observation.

Quality owners should therefore manage requirements, handovers and runtime evidence separately. For each property, identify whether it is proved, measured or estimated by another model. That distinction makes automated processes more inspectable and helps direct human review to uncertainty that remains outside the formal result.

Sources & transparency

Editorial note: Assessment uses the third version of an earlier preprint. No proof execution or reproduction was performed here. The operational inspection plan is FQI interpretation. AI-assisted article, approved for publication by Johann Fischer on 2026-10-22.