Foundations of Prompt Engineering for Developers
Foundations of Prompt Engineering for Developers
1 Overview
In the previous tutorial you learned that a large language model's behavior is shaped by the text you send it. This tutorial turns that observation into a craft. Prompt engineering is the discipline of writing, structuring, and refining that text so the model produces output your application can rely on — and for developers it is as fundamental as knowing SQL is for working with databases.
The stakes are practical: the difference between a vague prompt and a precise one is routinely the difference between unusable output and production-quality output, from the exact same model at the exact same cost. Because .NET applications consume models through prompts embedded in code, prompt quality is code quality.
You will learn the anatomy of an effective prompt (instruction, context, input data, output constraints), how prompting differs from traditional programming, the core prompting styles (zero-shot, few-shot, multi-shot, role-based), how to iterate on prompts systematically, how to package prompts as reusable C# templates, and how to defend against hallucinations by validating output.
2 Learning Objectives
After completing this tutorial, you will be able to:
- Define what a prompt is and explain why prompt wording directly determines output quality.
- Contrast prompt engineering with traditional programming, and deterministic code with probabilistic models.
- Break a prompt into its four working parts: instruction, context, input data, and output constraints.
- Transform vague prompts into precise ones using concrete developer examples.
- Apply a systematic iteration loop to refine prompts until output is dependable.
- Budget prompts with tokens and context windows in mind.
- Choose appropriately between zero-shot, few-shot, and multi-shot prompting, and between instruction-style and role-based prompts.
- Package prompts as reusable, versionable templates in C# code.
- Reduce hallucinations through prompt design and validate model output before your application trusts it.
3 Prerequisites
- Tutorial 1 (Introduction to Generative AI) — especially tokens, context windows, temperature, and hallucination.
- Working C# knowledge: string interpolation, classes, and basic collections.
- No Azure subscription needed — prompts here can be tried in any chat interface; the C# samples show how they live in application code.
4 What a Prompt Is and Why It Matters
A prompt is everything you send to the model for a request: the instructions, any background context, the data to operate on, and the rules for the response. In a chat API this spans the system message (standing behavior) and user messages (the current request). The model does not see your intentions, your codebase, or your requirements document — it sees only the prompt's tokens, and it generates the continuation those tokens make most likely.
That last sentence explains why prompts matter so much. Generation is conditioned entirely on the prompt: every word you include (or omit) shifts the probability distribution the model samples from. A prompt that says 'summarize this' leaves the model guessing about length, audience, and format, so it guesses — differently each time. A prompt that specifies 'summarize this support ticket in exactly 3 bullet points for a support manager, naming the customer issue, what was tried, and the current status' collapses those guesses into your requirements.
For developers there is a second reason prompts matter: prompts are executed by your application, unattended, at scale. A slightly ambiguous prompt that a human would clarify in conversation instead produces thousands of slightly wrong responses in production. Treating prompt text with the same care as code — reviewed, versioned, tested — is the core mindset of this tutorial.
5 Prompt Engineering vs. Traditional Programming
Traditional programming and prompt engineering are both ways of instructing a machine, but they differ in the machine's contract with you. Code executes deterministically: the same input produces the same output, every time, and deviations are bugs. A language model is probabilistic: it samples from a distribution of likely continuations, so the same prompt can produce different (all 'valid') outputs across runs, and even the best prompt shifts probabilities rather than guaranteeing results.
| Aspect | Traditional code | Prompting a model |
|---|---|---|
| Language | Formal syntax (C#), compiler-enforced | Natural language, no compiler — ambiguity silently accepted |
| Behavior | Deterministic: same input → same output | Probabilistic: same prompt → varying outputs |
| Failure mode | Exceptions, wrong values — usually loud | Plausible-but-wrong text — usually quiet |
| Correctness | Provable against a spec; unit-testable exactly | Statistical: measured over many runs, not proven |
| Change process | Edit code, compile, tests pass or fail | Edit wording, re-run, judge outputs against criteria |
| Precision lever | Types, contracts, assertions | Instructions, examples, constraints, grounding context |
The consequence for engineers: you do not stop being rigorous when you write prompts — you relocate the rigor. Instead of types and assertions inside the computation, you put precision into the prompt (explicit instructions, examples, output constraints) and verification after the computation (parsing and validating what came back, covered in section 13). Deterministic code wraps the probabilistic model on both sides.
6 Anatomy of an Effective Prompt — and Vague vs. Precise
Effective prompts are built from four working parts. You will not always need all four, but when output disappoints, the fix is almost always adding or sharpening one of them.
| Component | What it does | Example fragment |
|---|---|---|
| Instruction | Says what to do — the verb of the request | Summarize the ticket below for a support manager. |
| Context | Grounds the model: domain facts, audience, situation | Our product is a REST API for invoicing; 'sandbox' means the test environment. |
| Input data | The content to operate on, clearly delimited | Ticket text between triple quotes: """...""" |
| Output constraints | Format, length, tone, allowed values for the response | Respond as JSON: { "summary": string, "severity": "low"|"medium"|"high" }. No other text. |
The gap between vague and precise prompts is easiest to feel through developer examples. Each row below is the same task, asked lazily and asked well:
| Vague prompt | Precise prompt | What the precision buys |
|---|---|---|
| Write a C# method to check email. | Write a C# method 'bool IsValidEmail(string input)' using MailAddress parsing, no regex; return false for null/whitespace; include XML doc comments. | Correct signature, chosen technique, edge cases handled, documented |
| Explain this code. | Explain this LINQ query line by line to a junior developer who knows loops but not LINQ; end with one performance caveat. | Right depth, right audience, actionable ending |
| Summarize these logs. | From the log lines below, list each distinct error, its count, and first timestamp, as a markdown table sorted by count descending. | Structured, complete, deterministic ordering |
| Fix this bug. | The method below throws NullReferenceException when 'order.Customer' is null. Propose the minimal fix preserving current behavior for non-null customers, and explain the change in two sentences. | Scoped change, preserved behavior, reviewable rationale |
Notice what precision consists of: nailing down the things the model would otherwise guess — audience, format, technique, scope, edge cases. A useful drafting habit is to ask yourself: 'if I gave this request to a contractor who takes everything literally and asks no questions, what would they need to know?' Write that.
7 Prompt Iteration, Tokens, and Context Windows
First drafts of prompts are rarely right, and that is expected — prompt engineering is an iterative loop, not a single act of writing. The professional version of the loop looks like this:
- Define success first: write down what a good output looks like (format, content, tone) before writing the prompt — otherwise you cannot judge results.
- Draft the prompt with the four-part anatomy: instruction, context, input data, output constraints.
- Run it several times, not once — variation between runs is data about where the prompt is ambiguous.
- Diagnose failures specifically: wrong format → tighten output constraints or add an example; wrong content → add context or sharpen the instruction; invented facts → add grounding data and an 'if unsure, say so' rule.
- Change one thing at a time so you know which edit caused which improvement, exactly like debugging.
- Keep a small set of test inputs (easy, hard, edge-case) and re-run all of them after each change — this is regression testing for prompts.
- Stop when outputs are consistently acceptable across your test inputs, and save the prompt with a version note.
Iteration happens inside a hard budget: the context window. Recall from tutorial 1 that everything — system message, instructions, examples, input data, and the generated response — shares one token limit, and every token is billed. Precision usually pays for itself (a tighter prompt often produces shorter, better output), but examples are the expensive ingredient: each few-shot example you add costs its full token length on every single request. When a prompt must process large inputs, budget explicitly: reserve tokens for the response, and trim or chunk input data rather than letting it crowd out your instructions.
8 Prompting Styles: Zero-Shot, Few-Shot, Multi-Shot, and Roles
Prompting styles differ along two independent axes: how many worked examples you include, and whether you assign the model a persona.
| Style | What it is | When to use it |
|---|---|---|
| Zero-shot | Instructions only, no examples: 'Classify this ticket as billing, technical, or account.' | Simple, well-known tasks; cheapest in tokens; try it first |
| Few-shot | 2–5 input→output examples before the real input | The model must imitate a specific format, style, or subtle classification boundary |
| Multi-shot | Many examples (typically 5+) | Hard patterns with tricky edge cases — pay the token cost only when few-shot underperforms |
| Instruction-style | Direct commands with no persona | Most application tasks; pairs with any shot count |
| Role-based | Assign a persona: 'You are a senior C# code reviewer focused on async correctness.' | Shaping tone, depth, and domain focus — usually set in the system message |
Few-shot prompting deserves emphasis because it is the single most reliable format-control technique. Models are exceptional pattern-continuers: showing two examples of 'ticket text → one-line JSON verdict' teaches the output shape more effectively than a paragraph describing it. The examples must be consistent with each other and with your constraints — the model will faithfully imitate any inconsistency, including your mistakes.
Role-based prompting complements rather than replaces instructions. 'You are an expert' does not add knowledge, but it usefully biases register and focus: a 'patient teacher for beginners' explains, a 'terse senior reviewer' critiques. In applications, the role belongs in the system message where it governs the whole conversation, while per-request instructions travel in user messages. Combine them: role for standing behavior, instruction anatomy for each task.
9 Where Prompts Live in the .NET Ecosystem
In a .NET application, prompts are not chat messages you type — they are artifacts your code assembles and sends. Knowing where each piece lives keeps designs clean:
- System message — standing role, rules, and output policy for the whole conversation; set once by your code (e.g. as the first message in an Azure OpenAI chat request).
- User message(s) — the per-request instruction, context, and input data your application constructs, often from a template plus runtime values.
- Prompt templates — string or file resources with placeholders, kept alongside code, code-reviewed and versioned like any other source artifact.
- Azure AI Foundry playground — the interactive environment for iterating on a prompt against real models before committing it to code.
- Semantic Kernel — a .NET framework (covered in tutorials 17–18) with first-class prompt template support, including template files with variables and functions.
A practical workflow follows from this: iterate in the playground with your test inputs until the prompt is stable, then transfer the final wording into a template in your repository, wire it to real data in C#, and keep the test inputs for regression checks. The playground is the prototyping surface; the repository is the source of truth.
10 Reusable Prompt Templates in Applications
Application prompts repeat: your app summarizes thousands of tickets with the same prompt and different data. That makes templates — fixed wording plus placeholders — the natural unit of prompt reuse, and it brings prompt work fully into software engineering discipline:
- Consistency: every request uses identical, tested wording; quality does not drift between call sites.
- Versioning: templates live in source control; a prompt change is a reviewable diff, and output regressions are traceable to it.
- Separation of concerns: prompt wording changes without touching request-handling code, and vice versa.
- Safe data insertion: a single place to delimit and sanitize runtime data before it enters the prompt.
- Testability: each template pairs with saved test inputs and expected-output criteria, enabling regression checks.
- Localization and variants: the same task can carry audience-specific templates (e.g. terse for the API, verbose for the help page).
Typical template-worthy use cases in .NET applications: summarizing entities (tickets, orders, reviews) for dashboards; extracting structured JSON from free-form text; drafting notification or reply text for human review; explaining domain data to end users; and classifying inbound content. Section 11 turns one of these into working C#.
11 Code Examples in C#
A minimal but production-shaped prompt template: fixed wording, placeholders, delimited data, explicit output constraints.
public static class TicketPrompts
{
public const string SystemMessage =
"You are an assistant that summarizes support tickets for support managers. " +
"Be factual; use only information from the ticket. If information is missing, write 'unknown'.";
// Version note: v3 — added severity constraint and 'no other text' rule (2026-09).
public static string BuildSummaryPrompt(string ticketText) => $"""
Summarize the support ticket below.
Respond with JSON only, exactly this shape, and no other text:
{{ "summary": "<max 40 words>", "severity": "low" | "medium" | "high" }}
Ticket:
\"\"\"
{ticketText}
\"\"\"
""";
}
Few-shot prompting maps naturally onto chat messages: examples become alternating user/assistant message pairs before the real input, teaching the pattern in the model's native format.
// Teaching a strict one-line classification format by example:
List<ChatMessage> messages =
[
new SystemChatMessage(TicketPrompts.SystemMessage),
// --- few-shot examples ---
new UserChatMessage("Classify: 'I was charged twice for my subscription.'"),
new AssistantChatMessage("{\"category\":\"billing\"}"),
new UserChatMessage("Classify: 'The export endpoint returns HTTP 500.'"),
new AssistantChatMessage("{\"category\":\"technical\"}"),
// --- the real request ---
new UserChatMessage($"Classify: '{ticketText}'")
];
Finally, never trust structured output blindly — parse and validate it in ordinary deterministic code, and treat failure as a first-class outcome:
public sealed record TicketSummary(string Summary, string Severity);
private static readonly string[] AllowedSeverities = ["low", "medium", "high"];
public static bool TryParseSummary(string modelOutput, out TicketSummary? result)
{
result = null;
try
{
var parsed = System.Text.Json.JsonSerializer.Deserialize<TicketSummary>(
modelOutput,
new System.Text.Json.JsonSerializerOptions { PropertyNameCaseInsensitive = true });
if (parsed is null ||
string.IsNullOrWhiteSpace(parsed.Summary) ||
!AllowedSeverities.Contains(parsed.Severity))
{
return false; // caller decides: retry, fall back, or queue for a human
}
result = parsed;
return true;
}
catch (System.Text.Json.JsonException)
{
return false;
}
}
12 Step-by-Step: Refining a Prompt from Vague to Reliable
This walkthrough applies the iteration loop to one realistic task: turning free-form support tickets into structured data for a dashboard. Follow it in any chat model.
- Define success: output must be JSON with 'summary' (≤40 words) and 'severity' (low/medium/high), correct on easy tickets and honest ('unknown') on incomplete ones.
- Draft 0 — vague on purpose: 'Summarize this ticket.' Run it on a test ticket. Typical result: a friendly paragraph, no JSON, invented severity. Every failure is a missing anatomy part.
- Add output constraints: specify the exact JSON shape and add 'no other text'. Re-run: format improves but severity judgments drift between runs — the boundary is ambiguous.
- Add context: define the boundaries — 'high = outage or data loss; medium = feature broken with workaround; low = question or cosmetic'. Re-run: severity stabilizes.
- Add a few-shot example of a tricky case (an angry-but-low-severity ticket) to pin the boundary the definition alone did not fix.
- Add an honesty rule: 'If the ticket lacks the information, use "unknown" — do not guess.' Test with a one-line ticket; confirm it says unknown instead of hallucinating.
- Regression-check: run all saved test tickets (easy, hard, edge) several times each; confirm outputs stay within your success criteria.
- Ship it: move the final wording into a C# template (as in section 11), wire the validator around the call, and record a version note for the next engineer.
13 Limitations, Hallucinations, and Output Validation
Prompt engineering improves probabilities; it never creates guarantees. The residual risks — and the standing defenses every application should layer — are:
- Hallucination is reduced, not eliminated, by good prompts. Prompt-level defenses: ground the model with authoritative context ('use only the information provided'), permit uncertainty ('say unknown if not stated'), and constrain output to values you can check. Retrieval-based grounding is covered in tutorial 15.
- Validation belongs in code, not in hope: parse structured output, check schemas and allowed values (as in section 11), verify claims that can be verified (IDs exist, numbers add up), and route failures to retry or human review. The model drafts; deterministic code decides.
- Prompts are model-sensitive: wording tuned on one model may behave differently on another or after a model upgrade — re-run your test inputs when the model changes.
- Instructions compete with data: very long inputs can dilute or truncate instructions (see section 7); guard input sizes in code.
- Examples teach everything, including errors: an inconsistent few-shot example silently degrades output; review examples as carefully as instructions.
- Natural language remains ambiguous: two readers — and two model runs — can parse the same sentence differently; precision plus validation, never precision alone.
14 Best Practices and Common Mistakes
Practices that separate reliable prompts from lucky ones:
- Write the success criteria before the prompt; you cannot iterate toward an undefined target.
- Use the four-part anatomy as a drafting checklist: instruction, context, input data, output constraints.
- Prefer showing to telling: one consistent example beats a paragraph of format description.
- Delimit runtime data (triple quotes, tags) so data can never read as instructions.
- Keep prompts in versioned templates with a small regression set of test inputs.
- Run prompts multiple times while iterating — single runs hide variance.
- Validate every output in code; design the failure path (retry, fallback, human) before shipping.
Mistakes that account for most bad output:
- Vague requests that outsource decisions to the model — then blaming the model for deciding.
- Stuffing the entire task into one paragraph with no structure, so instructions, data, and constraints blur.
- Adding more and more words instead of diagnosing which anatomy part is missing.
- Changing five things per iteration, learning nothing from the result.
- Few-shot examples that contradict the stated constraints (the model follows the examples).
- Treating a response that parsed once as a format guarantee — variance will eventually break it.
- Leaving prompts inline in application code, unversioned and untested, where no one reviews them.
20 Summary & Key Takeaways
- A prompt is everything the model conditions on; every unstated decision becomes a per-run guess, which is why wording directly controls quality.
- Prompting differs from programming in kind: natural language steering a probabilistic system. Rigor relocates to precision going in and validation coming out.
- Draft with the four-part anatomy — instruction, context, input data, output constraints — and diagnose bad output by asking which part is missing.
- Precision means resolving guesses: audience, format, technique, scope, edge cases. Write for a literal-minded contractor who asks no questions.
- Iterate deliberately: define success first, run multiple times, change one thing, keep a regression set, version the result.
- Tokens are the budget: examples recur in cost every call, and overflow can silently truncate your instructions — guard sizes in code.
- Escalate zero-shot → few-shot → multi-shot only as needed; use roles for tone and focus in the system message, never as a substitute for precision.
- Package prompts as versioned templates with delimited data slots; validate every output in deterministic code with a designed failure path.
You now have the foundation of the prompting craft: a vocabulary for what prompts are made of, a method for improving them, and the engineering habits that make them safe to ship. The next tutorial builds on this base with the specific prompting patterns developers reach for daily.
21 Next Steps
Continue with the next tutorial in the path: Prompting Patterns Used by Developers — a catalog of reusable patterns (persona, output-format, recipe, refinement chains and more) that build directly on today's anatomy and iteration method.
- Practice: take three vague prompts you'd naturally type ('fix this', 'explain this', 'summarize this') and rewrite each with all four anatomy parts; compare outputs before and after.
- Practice: run section 12's refinement walkthrough yourself in any chat model, keeping notes on which single change fixed which failure.
- Practice: build the TicketPrompts template and TryParseSummary validator from section 11 in a console app, and feed the validator deliberately broken output.
- Reading: Microsoft Learn's prompt engineering modules and the Azure OpenAI documentation's prompt engineering techniques guide.
- Looking ahead: note which of your rewritten prompts feel like repeatable recipes — the next tutorial names and systematizes them.
15 Quiz
Pick an answer for each question, then press Check answer. (Notes are disabled in this tab.)
1. In the context of LLM applications, what is a prompt?
2. Why does prompt wording have such a large effect on output quality?
3. What is the fundamental behavioral difference between traditional code and a language model?
4. Which of these is NOT one of the four components of effective prompt anatomy?
5. The prompt 'Write a C# method to check email' keeps producing regex-based methods with the wrong signature. What is the best fix?
6. During prompt iteration, why should you run the same prompt several times rather than once?
7. Why is 'change one thing at a time' good practice when refining a prompt?
8. Your prompt template plus a large document exceeds the model's context window. What is a likely silent failure?
9. What is the main cost consideration of few-shot prompting in production?
10. What is zero-shot prompting?
11. When is few-shot prompting most clearly worth its cost over zero-shot?
12. What does a role-based prompt like 'You are a senior C# code reviewer' actually do?
13. Which is a key engineering benefit of reusable prompt templates?
14. Which prompt addition most directly reduces hallucinated answers on incomplete inputs?
15. Your app receives JSON from the model. What should happen before the application acts on it?
16 Exam Questions
Try answering each question yourself before expanding the model answer.
1. Define 'prompt' precisely, including where it lives in a chat-based API, and explain the mechanism by which prompt wording determines output quality.
2. Contrast prompt engineering with traditional programming across at least four dimensions, and state where engineering rigor relocates when working with prompts.
3. Explain 'deterministic code vs probabilistic models' and derive two concrete engineering consequences for building AI features.
4. Name and define the four components of effective prompt anatomy, and write a short example prompt for a developer task that labels each component.
5. Take the vague prompt 'Summarize these logs' and rewrite it as a precise prompt. Then identify which guesses your rewrite eliminated.
6. Describe a disciplined prompt iteration workflow (at least five steps) and explain why running a prompt multiple times per iteration matters.
7. Explain how tokens, tokenization, and the context window constrain prompt design, including one silent failure mode and its code-level guard.
8. Compare zero-shot, few-shot, and multi-shot prompting: define each, give selection criteria, and state the escalation order with its rationale.
9. Distinguish instruction-style from role-based prompting: what a role actually changes, what it cannot do, and where each belongs in a chat-based application.
10. Argue the case for reusable prompt templates in a production .NET application, covering at least four engineering benefits and one implementation precaution.
11. Why do hallucinations persist even under good prompts, and which three prompt-level defenses most reduce them?
12. Design the output-validation layer for a feature where the model returns JSON {summary, severity}. What is checked, and what happens on failure?
13. Few-shot examples 'teach everything, including errors.' Explain this failure mode with an example and the practice that prevents it.
14. Propose how a team should manage prompts as engineering artifacts across their lifecycle (authoring, review, testing, change management, model upgrades).
15. Scenario: extract {vendor, date, total} JSON from OCR'd invoice text in an ASP.NET service. Design the complete prompting approach using this tutorial's concepts.
17 Flashcards
Click a card to reveal the back.
Prompt
Prompt engineering
Deterministic vs probabilistic
Prompt anatomy (4 parts)
Vague → precise prompt
Prompt iteration loop
Why run a prompt multiple times?
Token / context window (prompt view)
Zero-shot prompting
Few-shot prompting
Multi-shot prompting
Role-based prompt
System vs user message
Prompt template
Anti-hallucination prompt rules
Output validation
18 Interview Questions & Answers
1. What is prompt engineering, and why does a development team need it?
2. How is writing a prompt different from writing code?
3. Walk me through the anatomy of a good prompt.
4. Give an example of turning a vague prompt into a precise one.
5. How do you iterate on a prompt that isn't working?
6. How do tokens and context windows influence how you write prompts?
7. When would you use few-shot prompting over zero-shot?
8. Do role-based prompts like 'You are an expert' actually work?
9. How would you manage prompts in a real codebase?
10. What causes hallucinations, and what do you do about them at the prompt level?
11. The model returned valid JSON in all your tests. Do you still need validation in production?
12. How do you test something that gives different answers each run?
13. What's your take on prompt length — are longer prompts better?
14. Your prompt worked well, then output quality dropped after a model upgrade. What happened and what's the process fix?
15. A junior developer asks how to get better results from the model. What are your top three rules?
19 Glossary
- Prompt
- The complete text sent to a model for a request — instructions, context, input data, and constraints — across system and user messages; the sole input generation is conditioned on.
- Prompt engineering
- The discipline of designing, testing, and refining prompts so a probabilistic model produces reliable, application-grade output.
- Deterministic code
- Ordinary program logic that maps the same input to the same output every time; deviations are bugs.
- Probabilistic model
- A system that generates output by sampling from a probability distribution, so identical inputs can produce different results across runs.
- Instruction (prompt component)
- The part of a prompt stating what the model should do — the explicit, verb-first command.
- Context (prompt component)
- Background the model cannot know: domain facts, terminology, audience, and situation that ground the response.
- Input data (prompt component)
- The specific content the model operates on — text to summarize, code to review — clearly delimited from the instructions.
- Output constraints (prompt component)
- Explicit rules for the response: format, structure, length, tone, and allowed values, ideally checkable by code.
- Vague prompt
- A prompt that leaves audience, format, scope, or edge-case decisions unstated, delegating them to the model's per-run guesses.
- Precise prompt
- A prompt that resolves the decisions the model would otherwise guess, collapsing output variance toward the intended result.
- Prompt iteration
- The refinement loop: define success, run multiple times, diagnose failures to an anatomy component, change one thing, regression-check, version the result.
- Regression set (for prompts)
- Saved test inputs (easy, hard, edge-case) with acceptance criteria, re-run after every prompt edit or model change.
- Token
- The subword unit models read, write, and bill by — roughly 4 English characters.
- Tokenization
- Splitting text into tokens from the model's vocabulary before processing.
- Context window
- The hard per-request token budget shared by all prompt parts and the generated response; overflow truncates or errors.
- Zero-shot prompting
- Prompting with instructions only — no worked examples; the cheapest style and the right first attempt for well-known tasks.
- Few-shot prompting
- Including 2–5 consistent input→output examples so the model imitates the demonstrated format or boundary; costs tokens on every request.
- Multi-shot prompting
- Few-shot with many examples for hard patterns; used only when smaller example counts measurably underperform.
- Instruction-style prompt
- A prompt built from direct commands without a persona; the default for application tasks.
- Role-based prompt
- A prompt assigning the model a persona to bias tone, depth, and focus; adds no knowledge and no correctness guarantee.
- System message
- The conversation-level message carrying standing role and rules; in applications, set by code, not visible to end users.
- Prompt template
- Fixed prompt wording with placeholders for runtime data, stored and versioned in source control for consistency, review, and testing.
- Hallucination
- Fluent, confident output that is factually wrong or invented — plausibility without truth.
- Grounding
- Supplying authoritative facts in the prompt and restricting the model to them ('use only the information provided').
- Output validation
- Deterministic post-processing — parse, schema, allowed values, business rules — that gates model output before the application acts on it.