Applied AI / Forward Deployed Engineer · Prompt Engineering · Lesson 1 of 4
Anatomy of a production prompt
Amateurs write a sentence. Professionals write a structured prompt with clear roles and sections. A strong production prompt usually has:
- Role / system prompt: who the model is and its high-level goal + constraints.
- Task instructions: precise, unambiguous steps. Tell it what to do and what not to do.
- Context: retrieved documents, user data, examples — clearly delimited.
- Output format: exact shape (JSON schema, sections). Show, don't just tell.
- Guardrails: how to handle unknowns ("If the answer isn't in the context, say 'I don't know'").
SYSTEM: You are a support-ticket classifier for an e-commerce company. Classify each ticket into exactly one category and rate urgency. Rules: - Use ONLY these categories: [billing, shipping, returns, technical, other] - If unsure, use "other". Never invent a category. - Output valid JSON only, no prose. Output schema: { "category": string, "urgency": "low"|"medium"|"high", "reason": string } Ticket: """{ticket_text}"""
Delimiters matterWrap user/injected content in clear delimiters (triple quotes, XML tags like <document>). It reduces confusion and is your first line of defense against prompt injection.
◆ Lock it in
- Structure a prompt into role, instructions, context, output format, guardrails.
- State the negative space: what NOT to do, and how to handle unknowns.
- Delimit injected content clearly — clarity + injection defense.
Feynman drill — say it out loudList the five sections of a robust production prompt from memory.
Step 1 rate your confidence · Step 2 pick your answer
Which addition most improves reliability of a classification prompt?
Step 1 — how sure are you?