Prompt Constraints

What Are Constraints?

Constraints are limits you set in the prompt that define the boundaries of acceptable output. Without them, the model defaults to a verbose, neutral register at an assumed reading level for an assumed audience. That default is rarely exactly what you need.

The Purpose of Constraints

Constraints narrow the model's output space from "anything plausible" to "exactly what this use case requires." Each constraint eliminates a class of outputs you would have had to filter or rework after the fact.

Types of Constraints

01

Length — "In under 100 words." / "In exactly three sentences." / "In five bullet points." — controls how much the model produces

02

Tone — "Use a professional, formal tone." / "Keep it conversational and friendly." / "Be concise and direct." — sets the register and style

03

Audience — "Assume the reader is a complete beginner." / "Write for a senior engineer." — calibrates reading level and assumed knowledge

04

Scope — "Focus only on Python 3." / "Do not discuss edge cases." / "Answer only from the provided text." — defines what topics are in and out

05

Vocabulary — "Use only simple English." / "Write in second-person." / "Avoid jargon." — sets specific language requirements

Explicit vs. Vague Constraints

Vague (unreliable)

"Keep it short."

"Short" means different things to different models and different contexts. You will get outputs ranging from one sentence to three paragraphs.

"Be simple."

"Simple" is interpreted relative to what the model assumes is normal. It may still include vocabulary your audience does not know.

Explicit (reliable)

"In under 50 words."

A hard number. The model can check its own output against it. You get consistent length control.

"Use only words a 10-year-old would know. No technical vocabulary."

Concrete audience + explicit prohibition. The model has a clear target to optimize toward.

How to Write Effective Constraints

01

Use numbers, not adjectives — "under 100 words" not "short"; "exactly 5 bullet points" not "a few points"

02

Use negation to prevent defaults — "Do not include code examples" prevents the model from adding examples it would insert by default

03

Stack constraints freely — multiple constraints apply simultaneously and narrow the output space further; they do not conflict unless logically contradictory

04

Place constraints near the task instruction — constraints buried at the end of a long prompt are less reliably followed than those adjacent to the task

Conflicting Constraints

What Happens When Constraints Conflict

Contradictory constraints produce unpredictable output. "Explain this in technical detail" and "Use no technical vocabulary" are contradictory — the model must choose one to follow and may satisfy neither cleanly. Before sending a prompt with multiple constraints, verify that they are mutually compatible. If two constraints genuinely cannot coexist, decide which is higher priority and keep only that one.

Summary

Key Takeaways
  • Constraints narrow the output space from "anything plausible" to exactly what the use case requires
  • Types: length, tone, audience, scope, and vocabulary constraints
  • Use explicit numbers and specific language, not vague adjectives like "short" or "simple"
  • Use negation to prevent model defaults you do not want
  • Stack multiple constraints freely — they narrow the output space without conflicting unless logically contradictory
  • Place constraints near the task instruction for more reliable adherence
  • Check that all constraints are mutually compatible before sending the prompt

Need Help?

Ask the AI if you need help understanding prompt constraints, how to write length or tone constraints, how to combine multiple constraints, or what to do when constraints conflict with each other.