artifactEngineering & architecture

Prompt

A prompt is the input context supplied to a generative model to communicate a task, evidence, constraints, examples, or desired output.

Download Markdown (.md)

01What it means

A prompt is the collection of instructions and contextual material presented to a generative model for a particular interaction. It can include system and user messages, examples, retrieved passages, tool definitions, images, or other modalities. A prompt influences output but is not a deterministic program, a security boundary, or a substitute for application logic.[1][2]

Task context assembled into one model input Instructions, evidence, examples, conversation, and user input jointly shape generation
  1. Application instructionsIntended behavior, constraints, and tool boundaries
  2. Task evidenceRetrieved data, documents, state, and provenance
  3. DemonstrationsOptional examples that clarify desired behavior
  4. Conversation contextRelevant prior turns and tool results
  5. Current user inputImmediate request, content, and supplied constraints

Prompt layers may have different authority in a product, but no prompt guarantees truth, safety, or compliance; deterministic controls must enforce critical rules.

02Why it matters

Prompts are part of an AI product's behavior and should be designed, versioned, tested, and reviewed like other product artifacts. Clear task framing and relevant context can improve results, while ambiguous or conflicting content can produce silent and variable failures.

03When to use it

Use prompts to express tasks and context the model is suited to interpret. Put authorization, validation, calculations, state transitions, and irreversible business rules in deterministic code rather than relying on natural-language compliance.

04How it works

  1. State the task, intended audience, relevant context, and definition of a successful output.
  2. Separate instructions from untrusted content and include only evidence needed for the task.
  3. Specify constraints and an output structure the application can validate.
  4. Add representative examples only when they improve measured behavior.
  5. Version the prompt and test it with normal, edge, multilingual, and adversarial inputs.

05A practical example

Example

A support tool asks a model to draft a reply using approved policy excerpts. Its prompt identifies the task, marks customer text as untrusted, requires cited policy IDs and a structured response, and tells the model to return an escalation state when evidence is insufficient.

06Where it breaks

Prompt changes can have nonlocal and model-specific effects. Natural language remains ambiguous, long prompts consume context and cost, and instructions cannot reliably prevent prompt injection or guarantee truth. Provider updates can alter behavior without a prompt change.

Common mistakes

  • Embedding secrets, permissions, or critical business rules only in the prompt.
  • Adding instructions repeatedly without measuring whether they improve target cases.
  • Mixing trusted instructions and untrusted content without clear boundaries or downstream controls.
  • Changing a production prompt without versioned regression evaluation.

07Sources

  1. Prompt EngineeringOpenAI · Official documentationPrompt Engineering
  2. Introduction to PromptingGoogle Cloud · Official documentationIntroduction to Prompting
View saved topics

Start typing to search titles, definitions, categories, and frameworks.