How to use this topic

The first seven pages cover the basics: what prompt engineering is, how a model reads a prompt, the parts of a good prompt, clear instructions, context, roles and system prompts, and examples. The next six make prompts dependable: structured output, reasoning, prompt chaining, reducing hallucinations, testing and templates. The last five apply it: prompts for IT work and for code, prompts inside applications, context engineering and agents, and prompt security.

Most pages have a Try it yourself box: two or more prompts to paste into an AI assistant such as Claude, ChatGPT, Microsoft Copilot or Gemini, with what to look for in the answers. Model answers differ from run to run, so the pages never show them as fixed output. The prompts use made-up data; never paste confidential or personal information into a public AI tool. The background — what language models are and how they are trained — is in Artificial Intelligence.

There is no established certification for prompt engineering alone. Pages marked AWS AI Practitioner cover the prompt-engineering objectives of the AWS Certified AI Practitioner exam (AIF-C01), which the Artificial Intelligence topic also follows.

Learning path

  1. 01What Is Prompt Engineering?What prompt engineering is, why the wording of a request changes what an AI model gives back, and where good prompting stops helping.BeginnerAWS AI Practitioner
  2. 02How a Model Reads Your PromptTokens, the context window and next-token prediction: what a language model actually does with your text, and why that makes phrasing, order and length matter.BeginnerAWS AI Practitioner
  3. 03Anatomy of a Good PromptThe building blocks of a prompt that works: the task, context, input, output format, examples and constraints, and how to put them together.BeginnerAWS AI Practitioner
  4. 04Clear and Specific InstructionsWriting instructions a model cannot misread: being specific, naming the audience and length, saying what to do instead of what not to do, and explaining why.BeginnerAWS AI Practitioner
  5. 05Giving Context and Reference MaterialGiving a model the documents, data and background it needs, marking them off clearly, and telling it to answer from that material only.BeginnerAWS AI Practitioner
  6. 06Roles and System PromptsWhat a role or persona in a prompt does and does not do, the difference between system and user prompts, and how to write standing instructions.Beginner
  7. 07Zero-Shot, One-Shot and Few-Shot PromptingWhen a prompt needs examples, how many to give, and how to choose examples that teach the pattern instead of being copied.BeginnerAWS AI Practitioner
  8. 08Structured OutputAsking for JSON, tables and fixed formats, describing the shape with a schema, and checking in code that the answer really has that shape.Intermediate
  9. 09Reasoning: Step by Step and Thinking ModelsLetting a model work through a problem before answering: chain-of-thought prompting, reasoning models with built-in thinking, and when extra reasoning does not help.IntermediateAWS AI Practitioner
  10. 10Breaking Down Tasks: Prompt ChainingSplitting a large job into a chain of smaller prompts, passing results from one step to the next, and checking each step before going on.Intermediate
  11. 11Reducing HallucinationsWhy models state wrong things confidently, and the prompting habits that reduce it: grounding in sources, allowing "I don't know", asking for quotes and verifying the answer.IntermediateAWS AI Practitioner
  12. 12Iterating and Testing PromptsImproving a prompt on evidence instead of gut feeling: test sets, success criteria, comparing versions and catching regressions when a prompt or model changes.IntermediateAWS AI Practitioner
  13. 13Prompt Templates and ReuseTurning a prompt that works into a reusable template with variables, keeping prompts in version control, and sharing them in a team.IntermediateAWS AI Practitioner
  14. 14Prompts for IT WorkPractical prompts for everyday IT tasks: tickets, log analysis, runbooks, documentation, status updates and screenshots — and what to check before you use the answer.Beginner
  15. 15Prompting for CodeGetting useful help with code: describing the task, environment and constraints, asking for reviews and explanations, debugging with error messages, and checking what you get.Intermediate
  16. 16Prompts in Applications: the APIHow prompts work inside software: messages and roles in an API request, parameters such as temperature and maximum tokens, tool use and structured outputs.AdvancedAWS AI Practitioner
  17. 17Context Engineering and AgentsManaging everything a model sees, not just the prompt: retrieved documents, tool results, memory and conversation history, and writing instructions for AI agents.AdvancedAWS AI Practitioner
  18. 18Prompt Security and Responsible UseKeeping prompts safe: defending against prompt injection, keeping secrets and personal data out of prompts, company rules, and the myths about magic phrases.IntermediateAWS AI Practitioner

Prompt Engineering glossary

Short definitions of the terms used in this topic. The full glossary covers every topic.