From Prompts to Contracts: Toward Deterministic Control in AI Execution

By Geoffrey Chen

The widespread use of large language models has led to an operational paradigm in which prompts serve as the primary mechanism for controlling system behavior. In this paradigm, instructions, constraints, and expected outputs are all embedded within natural language input. While this approach provides flexibility and accessibility, it introduces a fundamental limitation when applied to execution-oriented systems.

A prompt is inherently interpretive. It does not define behavior in a deterministic sense, but instead provides guidance that the model may follow to varying degrees depending on context, phrasing, and prior state. Even when carefully engineered, prompts remain sensitive to small variations, and their effects are difficult to guarantee across repeated executions.

This lack of determinism becomes problematic in systems where reliability and consistency are required. When prompts are used as the primary control mechanism, the boundary between instruction and interpretation remains fluid. As a result, the same logical task may produce different outcomes across runs, and execution cannot be reliably reproduced or audited.

In contrast, execution systems in traditional software engineering rely on explicit contracts. A contract defines not only what should be done, but also how outputs must be structured, what constraints must be satisfied, and how results can be validated. Contracts reduce ambiguity by constraining the space of acceptable behavior, enabling systems to produce consistent and verifiable outcomes.

Applying this concept to AI systems suggests a shift from prompts to structured contracts.

A contract-based approach introduces an explicit layer between natural language intent and execution. Instead of relying on loosely defined instructions, the system defines reusable, structured specifications that guide model behavior. These specifications constrain output format, enforce required fields, and encode execution logic in a form that can be consistently interpreted.

In such a system, natural language remains important, but its role changes. It becomes a means of selecting or parameterizing a contract, rather than directly determining behavior. The contract itself defines the execution boundary, ensuring that model outputs can be reliably transformed into actions.

This approach addresses several limitations of prompt-based systems. First, it reduces variability by narrowing the range of acceptable outputs. Second, it enables validation, as outputs can be checked against the contract before execution. Third, it improves composability, allowing contracts to be reused across different contexts without rewriting prompts.

SmallClaw implements this idea through its concept of Skills. A Skill is not merely a prompt template, but a structured, reusable contract that defines how a task should be interpreted and executed. It specifies both semantic intent and executable structure, effectively producing a dual-layer output: one layer for human-readable meaning, and another for machine-executable instruction.

By introducing Skills as contracts, the system separates interpretation from execution. The language model contributes to generating content within defined constraints, while the contract ensures that this content remains actionable and consistent. This design reduces reliance on implicit prompt behavior and shifts control toward explicit structure.

The transition from prompts to contracts reflects a broader evolution in AI systems. As these systems move from interactive tools to execution platforms, the need for determinism, validation, and reproducibility becomes increasingly important. Prompts alone are insufficient to meet these requirements.

A contract-based model does not eliminate the flexibility of natural language, but it anchors that flexibility within a stable execution framework. In doing so, it enables AI systems to operate not only as interpreters of intent, but as reliable agents of action.

Discover more from After the Subject

Subscribe now to keep reading and get access to the full archive.

Continue reading