WEEK 1 · LESSON 3 · TOPIC 10 OF 17 · Prompt Contracts

Prompt Contracts

Lesson progress

0% Complete

SECTION 1 OF 5

In this topic · 5 sections
  1. Introduction
  2. Goal
  3. Constraints
  4. Output Format
  5. Failure Conditions

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.