- Context — the background, role, or scenario the model should adopt.
- Instruction — the specific task the model must perform.
- Input — any data the model needs to complete the task (text to summarize, a schema, etc.).

Three-component prompt: a concise example
When all three components are present, the model must infer less and deliver more predictable results. Example:- Context: “You are a cybersecurity analyst.”
- Instruction: “Summarize the following incident report in five bullet points.”
- Input:
Incident report: <incident_text>(include who the summary is for, e.g., senior management)
![A slide titled "Workflow: Example Prompt Components" shows a sample prompt broken into three color-coded parts. The parts read: "You are a cybersecurity analyst" (context), an instruction to summarize an incident report in five bullet points, and an "Incident report: [text]" input placeholder.](https://mintcdn.com/kodekloud-c4ac6d9a/BVCvDn4rl3j0TCQq/images/Introduction-to-Amazon-Bedrock/Basic-Concepts-of-Prompt-Engineering/Components-of-a-Prompt/cybersecurity-analyst-incident-summary-prompt.jpg?fit=max&auto=format&n=BVCvDn4rl3j0TCQq&q=85&s=c5e0076d4905a89553573079bb9481d1)

Extraction example with schema (machine-readable output)
For structured extraction tasks, include an explicit schema and require the model to return a machine-parseable format (for example, JSON). Example prompt structure:- Context: “You are a system that extracts structured information from text.”
- Instruction: “Extract the customer name, product name, and quantity from the following sentence, and return a valid JSON document matching the given schema.”
- Input: the sentence to parse and the JSON schema.
Quick reference: prompt components (table)
Common prompt mistakes and how to avoid them
Avoid these frequent errors:- Vague instructions — be specific about what you want.
- Missing audience specification — state who will consume the output.
- No output-format guidance — require JSON, bullets, or other structure when needed.
- Overloading the prompt with conflicting or excessive information.
- Not validating generated output before using it in production.

Validate model outputs (schema validation, type checks, business-rule checks) before using them in downstream systems or showing them to users.
Audience matters: same task, different tone and detail
Changing the context or audience produces different language and levels of detail even for the same instruction. Compare these:- Context A:
You are head of IT operations.Instruction:Summarize the service outage incident report in five bullet points for the CEO, CFO, and CTO to present at the next board meeting. - Context B:
You are head of IT operations.Instruction:Summarize the service outage incident report in five bullet points for the tech lead and development team.

Benefits of consistently structured prompts
When you design prompts that always include context, clear instructions, input data, and any output constraints (format or schema), you’ll typically see:- More predictable outputs
- Reduced effort tuning prompts
- Faster development of generative AI features

Checklist: build a reliable prompt
- Define the role and audience (Context).
- State the task and required structure (Instruction).
- Provide the necessary data (Input).
- Specify exact output format or schema (Output constraints).
- Validate outputs before using them in production.
- Iterate only when outputs do not meet requirements.
Summary
Effective prompts combine:- Explicit, unambiguous instructions,
- Relevant context (role and audience),
- Required input data and output constraints (format or schema).
Links and references
- JSON Schema (official site)
- Guide to prompt engineering and best practices (practical tutorials)
- OpenAI Best Practices for System Messages and Prompts