31 tools· updated sep 2026

What is a prompt? The instruction you give an AI model

Marek.

  • glossary
  • prompt-engineering
  • llm

A prompt is the input you give an AI model to guide its response. It can contain a question, an instruction, background information, examples, data to process, and a required output format.

In practice, a good prompt tells the model what success looks like. It does not guarantee a correct answer. The model, available context, tools, and application controls still matter.

What does prompt mean in AI?

In everyday language, a prompt is a cue to act. In generative AI, it is the information sent to a model before the model generates its next output.

A prompt can be as short as:

Translate this sentence into Polish: The meeting starts at noon.

It can also be a structured request with rules and examples:

Task: classify a support ticket.

Allowed labels: billing, technical, cancellation, other.
Return: one JSON object with keys "label" and "reason".

Ticket:
"I was charged twice for the same month."

The second prompt reduces ambiguity. It defines the task, allowed answers, output contract, and input boundary. That makes the result easier to check in software.

Prompts consume part of the model's context window and are represented as tokens, not as an unlimited block of human-readable memory.

The five useful parts of a prompt

I do not force every prompt into a rigid template. I check whether it contains the parts needed for the job:

  1. Instruction: the action to perform.
  2. Context: facts and constraints the model needs.
  3. Input: the specific text, record, image, or request to process.
  4. Examples: demonstrations of acceptable behavior when the task is ambiguous.
  5. Output contract: the format and criteria for the answer.

For a simple question, the instruction and input may be enough. For an automated workflow, the output contract becomes critical because another system must parse the response.

OpenAI's prompt engineering guide, Anthropic's prompting overview, and Google's prompting strategies use different terminology in places, but they converge on a practical idea: provide clear instructions, relevant context, examples when useful, and a verifiable result format.

System, developer, and user prompts

Many chat APIs divide instructions into roles. A system or developer message can define application behavior. A user message carries the current request. Tool results and assistant messages may also become part of the conversation context.

The exact role names and priority rules differ by provider and API. I check the documentation for the model I am using instead of assuming every platform handles conflicts the same way.

A useful mental model is:

LayerTypical purpose
Application instructionPersistent behavior, boundaries, and output rules
User promptThe current goal and supplied input
Tool resultExternal data returned during the task
Assistant historyPrior outputs that may affect the next turn

This is also why prompt injection matters. Text retrieved from a web page or tool is still untrusted data, even if it appears inside the model's context. It should not silently override application policy.

A weak prompt and a stronger prompt

Weak:

Write about our numbers.

Stronger:

Write a weekly performance summary for the acquisition team.

Use only the metrics inside DATA. Compare this week with last week.
Report percentage change for spend, registrations, and cost per registration.
If a value is missing, write "data unavailable" instead of estimating it.
Use three short sections: Result, Drivers, Next check.

DATA
{weekly_metrics_json}
END DATA

The stronger version does not sound more clever. It removes decisions the model should not improvise. It also separates trusted instructions from supplied data and defines how missing information should be handled.

A prompt is not the whole AI system

A prompt is only one layer. It is not the model, a database, a tool permission, an evaluation suite, or a security control.

This distinction matters in agent systems. A prompt may tell an agent not to deploy without approval, but the deployment tool should also enforce that gate. A prompt may ask for factual answers, but retrieval and source checks determine whether the right evidence is available. A prompt may demand JSON, but the application should still validate the schema.

When a response fails, I look at the complete system:

  • Did the prompt define the task clearly?
  • Was the required information inside the available context?
  • Was the selected model capable of the task?
  • Did tools return correct and current data?
  • Was the output validated?
  • Was the failure a normal AI hallucination?

Rewriting the prompt is useful only when the prompt is the actual bottleneck.

What prompt engineering means

Prompt engineering is the process of designing and testing model inputs so they produce useful, repeatable outputs for a defined task. The important word is testing.

I start with representative examples, define success, run the prompt, inspect failures, and change one meaningful variable at a time. Anthropic recommends defining success criteria and empirical tests before optimizing a prompt. That keeps the work tied to outcomes rather than wording preferences.

A small evaluation set might include:

  • normal inputs;
  • missing or contradictory data;
  • long inputs near the context limit;
  • adversarial instructions inside retrieved content;
  • examples where the correct answer is refusal or escalation.

For repository-level instructions, I use the same principle in a CLAUDE.md audit: rules should be clear, placed where the agent can see them, and backed by checks when failure has consequences.

Common prompt mistakes

Asking for several incompatible outcomes

"Be exhaustive, extremely short, persuasive, neutral, and never omit detail" gives the model conflicting targets. Rank the priorities or create separate outputs.

Hiding the real criterion

If legal accuracy, source recency, or a strict schema matters, say so. The model cannot reliably infer a private acceptance test.

Supplying too much irrelevant context

More text is not always more useful. Irrelevant context consumes tokens and can make the relevant evidence harder to locate.

Trusting one successful run

A single good response is a demonstration, not an evaluation. Test varied cases and rerun them when the model, prompt, tools, or data source changes.

Using prose instead of enforcement

Do not rely on a prompt to protect credentials, authorize payments, restrict database roles, or stop production deployment. Those boundaries belong in code and infrastructure.

Frequently asked questions

What is a prompt in one sentence?

A prompt is the input that tells an AI model what to do and provides the information or constraints it should use.

Is a question the same as a prompt?

A question is one type of prompt. Prompts can also be commands, examples, documents, images, structured data, or a combination of these.

What makes a good AI prompt?

A good prompt is specific about the goal, includes only relevant context, separates instructions from input, and defines an answer that can be checked.

Do longer prompts work better?

Not automatically. A longer prompt helps only when the extra detail is relevant and clear. Unnecessary text can increase cost and distract from important evidence.

Can prompt engineering stop hallucinations?

It can reduce some failures, but it cannot guarantee truth. Reliable systems also need grounded data, suitable models, validation, evaluations, and human review where risk is high.