Software factory

Run contract

stable definition
Machine-readable Download Markdown

Definition

A machine-readable, human-auditable agreement defining one agent run's objective, authority, evidence, limits, and recovery path. It should identify the task, relevant inputs, allowed tools and resources, credentials or permissions, time and cost budgets, acceptance criteria, prohibited effects, stop conditions, escalation path, and the state the run may produce or promote.

Dark Factory Dev uses run contract for the admitted unit of autonomous work. The contract turns an open-ended request into something the runtime can enforce and an auditor can reconstruct. It should be resolved before execution far enough to answer: what may this run touch, what consequence can it cause, how will success be checked, and what happens when the check is unavailable?

Contract and evidence

The record needs both declared intent and observed execution. A useful post-run artifact links the original contract to tool calls, state changes, costs, evidence, exceptions, and final disposition. If the objective or authority changes during the run, that is a contract amendment or a new run, not an invisible prompt adjustment.

Distinguish it from nearby terms

A prompt communicates instructions to a model. A task specification describes the desired result. A run contract binds that result to operational authority, budgets, verification, lifecycle, and recovery. A policy may apply across many runs; the contract resolves applicable policy for this run.

Check your understanding

An agent is asked to clean up test accounts, but the contract does not identify the environment, deletion boundary, or recovery method. Should the scheduler admit it? No. The missing details affect irreversible authority. Resolve them before execution rather than relying on the agent to infer a safe scope.