A constraint is a falsifiable condition that limits what a model’s response may contain or claim. In a structured prompt, instructions define the task; constraints bound acceptable results. Context supplies background, while output format prescribes the response’s shape. A constraint can restrict length, tone, content, or scope regardless of the task or format. section 2.3 section 2.0
Write constraints so someone can check the generated response:
- Specify observable limits: “Use 120 to 160 words” or “Include exactly five bullet points,” rather than “write well.” section 2.3
- Bound factual scope when needed: “Use only the provided information” or “Do not speculate.” section 2.3
- Keep restrictions relevant, mutually consistent, and aligned with the instruction. Add only those needed for the task. section 2.3 section 2.8
Secure logging policy
Instruction: “Write secure logging guidelines for backend services.” Constraints: “Use 100 to 130 words. Include at least two explicit prohibitions using ‘Do not.’ Include ‘correlation ID’ at least once. Use a strict policy tone.” The instruction identifies the deliverable; the separate constraints make its length, wording, and tone checkable. section 2.3.1
Constraints also govern operational decisions. An incident-update prompt can require a neutral tone and prohibit speculation beyond supplied notes; a deployment brief can require concrete signals and, for a NO-GO recommendation, a rollback command. Put fixed headings and section order in the output-format specification so each requirement has a clear place. section 2.8.1 section 2.8.2
Test constraints against realistic inputs, especially requests that pull the model outside its assigned role. “Decline inappropriate requests” left a code-review assistant room to reinterpret its scope. A narrower prompt accepted only code for review and specified an exact fallback for other requests. Likewise, a policy assistant’s broad helpfulness instruction competed with a privacy restriction until the prompt explicitly excluded individual records and supplied a fallback. Constraints improve the likelihood of compliance; they do not enforce it. section 10.3.1 section 10.3.2 section 2.3


















