Introduction
A prompt contract is a structured specification created before a non-trivial task is executed. It contains four major sections:
Goal
The goal states what the task is intended to achieve. It should describe the desired outcome rather than merely naming an activity.
Constraints
Constraints define the non-negotiable boundaries. These can include design preferences, technical limits, required tools, prohibited approaches, length limits, performance standards, or environmental requirements.
Output Format
The output format defines what the finished result should contain and how it should be organized or delivered.
Failure Conditions
Failure conditions state what would make the result unacceptable. They prevent the agent from declaring completion while important defects remain.
For a website, failure conditions might include looking like a generic template, breaking on mobile, using poor animations, or exceeding a file-length limit. For an outreach task, a failure might be sending to fewer recipients than required or omitting mandatory information.
A prompt contract is similar to a project scope. It creates agreement before the work begins. It prevents the user from judging the result against requirements that were never communicated, and it prevents the agent from inventing the meaning of success.