Skip to content
Review

Trust the Spec, Not the Code - A Specification-First, AI-Assisted Case Study in Online Banking

Sep 2026 · 0 citations · 20 references
Computer Science

TL;DR

It is argued that AI removes much of that cost: natural language enriched with lightweight mathematics, written in \LaTeX, can serve as an intermediate specification language that is precise enough to reason over and prove, while a large language model reviews it for ambiguity, drafts proofs, and generates the implementation.

Abstract

Formal specification promises early error detection, explicit invariants, and correctness by design, yet its notational cost has kept it out of mainstream practice. We argue that AI removes much of that cost: natural language enriched with lightweight mathematics, written in \LaTeX, can serve as an intermediate specification language that is precise enough to reason over and prove, while a large language model (LLM) reviews it for ambiguity, drafts proofs, and generates the implementation. The specification becomes the artifact one authors, reviews, proves, and refines; the code becomes regenerable output. This paper is a follow-on to a prior study that established the discipline on an organizational-knowledge-growth simulation~\cite{predecessor2026}. Here we replicate the discipline in a different domain---an online-banking fund-transfer service---and extend it. The two domains share one spine: a conservation invariant (knowledge in the prior study, money here), which suggests the approach generalizes across domains. We contribute: (i) a second, independent case study of the method; (ii) a stress-test of the method on a richer problem---\emph{scheduled/recurring} transfers---whose generated code grows substantially while the invariant and its proof do not; (iii) an \emph{AI-proposed runtime coverage model} for invariants (``never violated $\neq$ covered''); and (iv) a Z formalization, including paired success/failure operation schemas and an invariant proved over the inductive set of all reachable configurations, together with an experiment in which the AI proposes the Z interfaces itself. We are explicit about the method's limits: the proofs and runtime checks live at the specification level and do not establish that the generated code refines the specification---that step is delegated to the AI. This is a case study, not a controlled experiment.

View source

Similar papers

Conference Sep 2026

Don’t Just Test It, Prove It: Verifying AI-Written Rust

AI coding agents can write code faster than humans can meaningfully review it. Tests exercise selected cases; formal verification can establish whether specified properties hold within stated assumptions and bounds. This talk explores a workflow in which humans define the contracts, agents implement against them, and p...

Alexander Kalankhodzhaev · 0 citations
Book Open access Oct 2026

Trust the Delta: Rethinking Software Validation in the AI Era (Keynote)

This keynote argues that software changes offer a uniquely tractable setting for establishing correctness, and reframes the oracle problem from determining absolute correctness to validating a behavioral delta by asking which behaviors changed, which remained stable, and whether the observed differences match the inten...

Michael Pradel · 0 citations
Preprint Sep 2026

Specification Before Generation: A Pre-Registered, Five-Model Paired Evaluation of a Specification Frame for LLM-Generated Code in Money, Time, Idempotency, and Access Tasks

Code generated by large language models passes security checks at a rate that has barely moved in four years. In regulated backends, the defect classes that matter most are money arithmetic, time handling, retry safety, and access control. Teams answer with instruction files, yet the largest controlled study of instruc...

Sandeep Dhuri · 0 citations
Preprint Sep 2026

Access Control as Verified Parse Constraints

This work encodes a bounded policy language's decision function into a fixed-size byte buffer and verify the enforcement code once, proving the validator accepts if and only if the decision function accepts, for every policy, request, and session.

Saranachon Iammongkol, Zhi-Yi Huang, D. Eyers · 0 citations
Preprint Sep 2026

Scanning the Harness: An Empirical Study of Supply-Chain Defects in AI Coding-Agent Configurations

This work measures only rules whose condition is decidable from bytes and whose consequence is a security exposure, a configuration that cannot work as written, or a departure from the Agent Skills specification, and validates every finding before it counts.

Benjamin Kapner, Carmel Soceanu, A. Petrunin et al. · 0 citations

We use cookies to run the site and, with your consent, for analytics and to show ads. See our Cookie Policy.