Prompt Patterns

Constraint Scoping

Defines the boundaries within which a language model is allowed to operate.

Also known asNegative PromptingOutput BoundingBehavioral ConstraintsExclusion Rules
Constraint Scoping pattern diagram

Problem

Even with a clear task, the model fills gaps with high-probability but risky completions (speculation, over-commitment, policy promises, verbosity).

Solution

Add explicit boundaries for what is in-bounds and out-of-bounds while keeping the task unchanged. Clear "only use" and "do not" constraints suppress unsafe continuation paths and keep output within operational limits.

Example

One worked example. The book has 2–4 per technique.

Prompt
Write an apology to customers for yesterday's payroll processing disruption.

Constraints:
* Use only information provided here: We experienced a disruption to payroll processing yesterday. Service has been restored. We are investigating.
* Do not speculate about root cause or timeline.
* Do not admit fault or legal liability.
* Do not promise refunds, credits, or "this will never happen again."
Response
We're sorry for yesterday's disruption to payroll processing. Service has been restored, and we are investigating what happened. We will share an update when we have confirmed details. Thank you for your patience.

Techniques

Concrete ways to implement Constraint Scoping. Each technique fits a different situation.

  • 01

    Inclusion Scoping

    State what the task must cover so the model selects only matching information from the source and treats everything else as out of bounds.

  • 02

    Exclusion Scoping

    State what the task must not cover so high-probability but unwanted completions (speculation, commitments, comparisons) are suppressed.

Prompt Patterns book cover

Full treatment in the book

Constraint Scoping — the complete chapter

  • Mechanism — why this pattern works
  • 2–4 worked examples per technique
  • Placement, sequencing, and debugging rules
  • Composition with related patterns