Prompt engineering is the practice of designing instructions and context that help a generative AI system produce a more useful response. In plain English, it means asking an AI tool clearly for what you need: a concise summary, a SQL query, a draft email, a Python function, or a structured analysis.
It is most often associated with large language models (LLMs), which power conversational AI tools and many AI features in workplace software. Prompt engineering does not retrain a model or give you perfect control over its answer. It is a communication and review skill: define the job, provide relevant information, set boundaries, and check the result.
Prompt engineering, explained simply
A prompt can be as short as “Explain cash flow.” A more useful version might say: “Explain operating cash flow to a new business analyst in 150 words. Use one simple example and avoid accounting jargon.”
Both requests concern the same topic. The second one tells the AI who the answer is for, how detailed it should be, and how it should sound. Those details reduce ambiguity and make the output easier to use.
Many AI applications also apply instructions or controls outside the user’s prompt. Depending on the product and organization, those may set rules a user cannot change, including safety, security, or data-access limits. The practical takeaway is simple: treat your prompt as a request within the tool’s approved boundaries, not as a command that overrides every other rule.
Why prompt engineering matters
Generative AI can interpret a vague request in several reasonable ways. “Analyze these sales figures” might produce a narrative overview when you needed a month-by-month table. It might also discuss trends without knowing whether returns are included in revenue.
A stronger prompt surfaces requirements that would otherwise stay implicit, including the audience, business definitions, source material, required exclusions, and the desired format. Google’s prompt design strategies similarly emphasize clear instructions, relevant context, and examples when they help establish the desired pattern. These are useful practices, not a universal formula for every model or workflow.
Prompting is not a magic phrase for making AI correct. Review the response, identify the gap, then clarify the request or improve the supplied material.
The building blocks of an effective prompt
There is no single template that works identically for every task. Still, most effective prompts use some combination of four building blocks.
Task and goal
State the action you want performed and the outcome you need. Specific verbs help: summarize, compare, classify, extract, draft, calculate, explain, debug, or rewrite.
Instead of “Help with this report,” try: “Draft a three-paragraph executive summary of this report for a department manager. Focus on revenue trends, operational risks, and recommended next actions.”
Context and source material
Context is the information the model needs to do the task well. It may include a business definition, a table schema, an audience description, a policy excerpt, or source text to summarize. Relevant context reduces guesswork; unrelated background can obscure the task.
Be explicit about the evidence boundary. “Use only the material below” can help produce a faithful summary, but it does not establish that the supplied material is accurate, current, or complete.
Do not paste confidential customer information, credentials, banking details, protected personal data, proprietary code, or regulated records into a public AI service. Even with an approved workplace tool, share only the minimum permitted data and follow your organization’s data-classification, retention, access-control, and contractual requirements.
Constraints and success criteria
Constraints define what a good response looks like. They can cover length, tone, scope, assumptions, prohibited content, and required checks. Useful examples include: “Use a neutral tone”; “Do not invent figures”; “State assumptions before calculating”; and “Flag claims that require source verification.”
Output format
Request the format you need next: a table, checklist, email draft, SQL query, Python function, JSON object, or numbered action plan. A defined format makes the result easier to inspect and reuse.
If an application depends on JSON or another schema, validate it programmatically. Valid-looking JSON can still omit required fields, use the wrong data type, or contain values that fail business rules.
Prompt engineering examples: from vague to useful
Example: summarizing a business document
Vague prompt:
Summarize this report.
Improved prompt:
Summarize the report below for a busy operations director.
Return:
- A 120-word executive summary
- Three key findings
- Two risks or open questions
- Three action items, each beginning with an action verb
Use only the supplied report. Do not add facts that are not stated.
If a metric is unclear or unsupported, flag it.
[Paste report]
The revision defines the audience, length, sections, and evidence boundary. Check the original report before acting on the summary: an accurate summary can still repeat a flawed or outdated source.
Example: analyzing data or writing SQL
Vague prompt:
Write SQL for monthly revenue.
Improved prompt:
Write a read-only PostgreSQL SELECT query that calculates net monthly revenue for calendar year 2025.
Table: orders
Columns:
- order_id (integer)
- order_date (date)
- gross_amount (numeric)
- refund_amount (numeric, nullable)
- order_status (text)
Definition: net revenue = gross_amount - COALESCE(refund_amount, 0).
Include only orders where order_status = 'completed'.
Return:
1. The SQL query
2. A brief explanation of the grouping logic
3. Two validation checks I should run before using the result
Do not use INSERT, UPDATE, DELETE, CREATE, ALTER, DROP, or other commands that change data or database structure.
This request supplies the SQL dialect, schema, metric definition, filter, safety boundary, and expected deliverables. Review and test generated SQL against the real schema and known totals before using it.
Example: drafting or debugging Python
Vague prompt:
Fix my Python code.
Improved prompt:
Debug this Python 3.11 function.
Expected behavior: accept a list of dictionaries containing 'customer_id' and 'amount', then return total amount by customer as a dictionary.
Actual error:
TypeError: unsupported operand type(s) for +=: 'int' and 'str'
[Paste minimal reproducible code here]
Please:
1. Explain the likely cause in plain English.
2. Provide a corrected version using only the standard library.
3. Include two small test cases, including one where amount is a numeric string.
4. State any assumptions about invalid or missing values.
For code, include the smallest reproducible example, the exact error, the environment, and the expected behavior. Run proposed code yourself; a plausible fix can still introduce edge cases, security problems, or incorrect business logic.
Common prompt engineering techniques
Zero-shot prompting
Zero-shot prompting means asking the model to perform a task without examples. “Classify each customer comment as positive, negative, or neutral” is a zero-shot request. It can work well for straightforward tasks when the labels and decision rules are clear.
One-shot and few-shot prompting
One-shot prompting provides one example. Few-shot prompting provides several examples. Examples can establish a classification rule, writing style, extraction pattern, or output structure that would be awkward to describe in abstract terms.
Classify each support message as Billing, Access, or Technical.
Examples:
Message: “I was charged twice this month.”
Category: Billing
Message: “The password reset link has expired.”
Category: Access
Now classify:
Message: “The dashboard shows an error when I export a CSV.”
Category:
The examples show both the label format and the intended categories. Use accurate, representative examples: misleading examples can establish the wrong pattern. The term is widely associated with in-context examples in language-model research, including Brown and colleagues’ work on few-shot learners.
Staged work and structured outputs
For complex work, divide the request into checkable stages. You might ask the model to list assumptions, perform a calculation, and provide validation checks. On selected reasoning benchmarks and model settings, Wei and colleagues’ chain-of-thought study found that step-by-step prompt examples could improve performance.
That does not make a fluent explanation evidence that a conclusion is correct. Ask for information you can verify, such as formulas, source references, intermediate totals, test cases, or unresolved questions. Structured outputs such as tables and JSON can make review easier, but the format and the underlying facts still need separate checks.
Iterative refinement
Start with a reasonable request, review the response, then revise based on a specific gap. If a summary is too generic, add the audience and decision context. If a query is wrong, clarify the metric definition. Save useful prompts for recurring tasks, along with the checks required before reuse.
Prompt engineering vs. related AI concepts
Prompt engineering vs. AI model training and fine-tuning
Prompt engineering guides a model at use time through instructions and supplied context. Training and fine-tuning are learning processes that use data to adapt model behavior. A well-written prompt can improve a task immediately, but it does not change the underlying model.
Prompt engineering vs. RAG
Retrieval-augmented generation (RAG) is a system design in which relevant external or proprietary information is retrieved and supplied to a model as context. The foundational RAG research by Lewis and colleagues describes retrieval as part of the generation system. Prompts can still instruct the model how to use retrieved sources or identify gaps in them.
RAG does not automatically make an answer correct. Retrieved material can be irrelevant, incomplete, outdated, or unavailable because of permissions. Retrieval quality, source freshness, and the final answer each need evaluation.
Prompt engineering vs. programming
Prompting can help people write, explain, and debug code, but it does not replace software engineering. Applications still need clear requirements, secure design, tests, version control, access controls, reliable data, and human review. A better prompt also cannot repair a flawed metric definition or poor-quality source data.
Limitations and responsible use
An AI response can be fluent, well formatted, and wrong. It may state an incorrect fact, draw a conclusion from incomplete context, reflect bias, or give a different answer when the prompt is run again. Good prompting reduces ambiguity; it does not turn unverified output into an authoritative source.
Prompting alone is insufficient when work requires approved source retrieval, calculations that must be reliably repeatable, database permissions, code tests, workflow controls, or qualified professional judgment. In banking, finance, compliance, legal, medical, employment, security, and other consequential settings, verify claims and calculations against trusted sources and involve qualified reviewers. AI output is not professional advice or a final basis for a high-stakes decision.
Privacy and intellectual-property obligations also matter. Check what material you are permitted to submit, where it may be retained or processed, and whether licenses or contracts affect the source material or reuse of the output. The NIST Generative AI Profile (PDF) identifies governance, testing, documentation, and human oversight as important elements of generative AI risk management.
How to start practicing prompt engineering
Choose one low-risk task that you do repeatedly, such as summarizing meeting notes, turning rough findings into an email, classifying feedback, or drafting a read-only SQL query. Then follow a short test cycle:
- Define what a good output must contain.
- Write a prompt with a clear task, relevant context, constraints, and format.
- Try two or three variations rather than assuming the first version is best.
- Compare results with known answers, source documents, or trusted calculations.
- Save the version that works, including its validation steps.
Before using workplace material, read the approved tool’s current documentation and your organization’s data-handling guidance. Interfaces, connected data sources, and privacy settings vary by provider and account configuration.
Prompt Engineering: From Clear Requests to Reviewed Results
Frequently asked questions about prompt engineering
What is prompt engineering?
Prompt engineering is the practice of designing instructions and context that help a generative AI system produce a more useful response. It involves defining the task, providing relevant information, setting constraints, requesting a usable format, and reviewing the result.
How do you write an effective AI prompt?
State the task and goal clearly, provide relevant context or source material, define constraints and success criteria, and specify the desired output format. Use only the detail needed for the task and refine the prompt after reviewing the response.
What are common prompt engineering techniques?
Common techniques include zero-shot prompting, one-shot and few-shot prompting, staged work with structured outputs, and iterative refinement. The best approach depends on the task, model, and workflow.
What is the difference between zero-shot and few-shot prompting?
Zero-shot prompting asks a model to perform a task without examples. One-shot prompting provides one example, while few-shot prompting provides several examples to establish a classification rule, writing style, extraction pattern, or output structure.
Can prompt engineering replace programming or model training?
No. Prompting can help with writing, explanation, and code drafting or debugging, but it does not replace requirements, secure design, testing, version control, access controls, or human review. It also guides a model at use time rather than changing the underlying model.
Do prompts work the same across AI models?
No. Principles such as clarity, context, examples, constraints, and requested format often transfer, but models differ in instruction behavior, available tools, and safety controls. Test important prompts in the approved tool and workflow where they will be used.
What are the risks and limitations of prompt engineering?
A response can be fluent, well formatted, and wrong. It may rely on incomplete context, reflect bias, or produce different results when run again. Review important outputs, protect confidential and regulated information, and involve qualified reviewers for consequential work.
Sources
- Google AI for Developers: Prompt design strategies
- Brown et al.: Language Models are Few-Shot Learners
- Wei et al.: Chain-of-Thought Prompting Elicits Reasoning in Large Language Models
- Lewis et al.: Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks
- NIST: Artificial Intelligence Risk Management Framework: Generative Artificial Intelligence Profile (PDF)







