To address the lack of verifiability of the output of large-scale language models (LLMs), this paper proposes a contract layer that applies design-by-contract (DbC) and type-theoretic principles. This contract layer mediates all LLM invocations, specifies semantic and type requirements for inputs and outputs, and provides probabilistic corrections for compliance. This presents the LLM as a dual-viewpoint: a semantic parser and a probabilistic black-box component. Contract satisfaction is probabilistic, and semantic verification is operationally defined through programmer-specified conditions on well-defined data structures. Furthermore, this paper argues that two agents that satisfy the same contract are functionally equivalent for that contract.