AI Prompting · Level 1: Prompting Basics · Lesson 3

Add the right context and constraints

AI models respond to context and constraints. Without constraints, an assistant might write in a generic tone or invent missing facts. In this lesson, you will learn how to set boundaries that keep AI answers relevant, accurate, and concise.

  • About 12 minutes
  • No account needed
  • Beginner level

By the end of this lesson, you can:

  • Distinguish helpful context from unnecessary information overload.
  • Apply tone controls and audience scoping to match your communication style.
  • Use negative constraints to prevent AI hallucinations and unwanted filler.

Why context transforms AI responses

AI models do not possess background knowledge about your specific project, your team's culture, or your client's preferences unless you provide it. When you omit context, the AI falls back on generic averages derived from its training data.

Low context

Generic baseline

Write an apology email for a late shipment.

Produces a generic, overly formal template that sounds like a standard corporate auto-responder.

Scoped context & constraints

Tailored result

Write an apology email for an artisan coffee roastery. A courier truck broke down, delaying 40 orders by 24 hours. Keep it warm, informal, and offer a free bag of coffee on their next order. Do NOT use legal language or formal jargon.

Matches your brand voice instantly and addresses the exact situation with authentic warmth.

The power of negative constraints

Telling an AI what not to do is often more effective than telling it what to do. Negative constraints act as guardrails that prevent the model from slipping into common failure modes:

  • Preventing Hype: "Do not use buzzwords like revolutionary, seamless, or game-changing."
  • Preventing Hallucinations: "Do not invent facts, dates, or prices not provided in the source text."
  • Controlling Length: "Do not write more than 150 words."
  • Eliminating Filler: "Do not include introductory pleasantries (e.g. 'Sure, I can help with that!')."

Avoiding context overload

While context is crucial, dumping thousands of words of irrelevant background information can confuse the model or cause it to overlook your core instruction. Apply the Need-to-Know Rule:

Include only the background details that directly influence the required output. If a detail does not change what the AI should write, edit it out before sending your prompt.

Illustrative example

Prompt Makeover

A product manager wants to announce a new software update to existing beta testers. See how adding negative constraints and audience context prevents generic hype.

Original prompt

Write an email telling users about our new dark mode feature.

What is missing

  • Target audience: who is receiving this email?
  • Tone: what voice should be used?
  • Negative constraints: what buzzwords or claims should be avoided?
  • Call to action: what specific step should users take next?

Improved prompt

Write a short announcement email for our technical beta testers about the release of Dark Mode v2.

Use a direct, helpful tone. Keep the message under 120 words.

CONSTRAINTS:
- Do NOT use marketing hype, clichés, or words like 'game-changing', 'revolutionary', or 'supercharge'.
- Do NOT invent unstated features; mention only custom themes and reduced eye strain in low-light environments.
- End with a single CTA link asking users to enable dark mode under Account Settings.

Why it is better

  • It scopes the audience: technical beta testers.
  • It sets explicit negative constraints eliminating marketing clichés.
  • It bounds the facts so the AI does not invent unsupported sub-features.
  • It specifies an exact word limit (<120 words) and a single call to action.

What still needs checking

  • Confirm that Dark Mode v2 is actually located under Account Settings.
  • Ensure the tone reflects your company's actual brand voice.

Practice

Identify the prompt with effective negative constraints

Read both instructions for drafting a client proposal summary. Select the option that uses negative constraints to protect fact accuracy.

Illustrative example

A freelancer is summarizing a client scope agreement. They need a 1-page overview without added promises or estimated completion dates.

Which request effectively prevents the AI from assuming unstated timeline details?
Check the model answer

Option B uses explicit negative constraints.

Option B explicitly tells the AI what NOT to do ('Do NOT state an estimated delivery date unless explicitly in the text'). Option A encourages the AI to be 'optimistic', which risks inventing imaginary timelines or over-promising.

Knowledge check

What are negative constraints in prompt engineering?
Check the answer

Option B is the correct answer.

Negative constraints (e.g. 'Do NOT use jargon', 'Do NOT assume unstated dates') set firm boundaries that stop AI models from adding unwanted filler or hallucinating facts.

Keep this

The Context & Constraints Formula

Combine positive context with negative boundaries to keep responses on target:

TASK: [What to produce]
AUDIENCE: [Who will read/use this]
TONE: [Direct / Professional / Friendly / Concise]
MUST INCLUDE: [Essential facts, links, or details]
DO NOT INCLUDE: [Prohibited buzzwords, assumed dates, or unverified claims]

Negative constraints are especially powerful when writing customer-facing copy, legal summaries, or technical guides where accuracy is critical.

Optional browser progress

Your progress

0 of 5 available lessons completed

0 of 5

Progress stores only the course identifier and completed lesson identifiers in this browser. It does not save your answers, prompt text or identity, and it does not sync to another device. Clearing browser data removes it.