Definition · AI basics
Prompt
A prompt is the complete input a caller sends to a language model in one turn. The model receives it as a single sequence of tokens. Structure within it — role labels, instructions, history, retrieved documents — is marked in that sequence, and the model was trained to respect those marks. Nothing forces it to obey them.
Last reviewed
Key points
- A prompt is the complete input a language model receives in one turn. Everything in it — system instructions, conversation history, retrieved documents, tool results — arrives in one sequence of tokens.
- The roles in a prompt (system, user, assistant, tool) are marked in that sequence, and in structured formats user text cannot forge the markers. What nothing enforces is that the model obeys them.
- Because the markers say where text came from but cannot make the model obey it, text from any source can act as an instruction. That is the root condition prompt injection exploits.
- Prompting as a practice means writing inputs that reliably produce the output you want. It is a design skill, not a configuration setting.
A language model receives everything a caller wants it to
know — its role, the conversation, documents, tool results — in a single
context window. That input is the prompt. Some
vendor docs use the word more narrowly: OpenAI’s text generation guide calls
the input parameter the prompt, as distinct from instructions.
How a prompt works
OpenAI’s 2023 ChatML preview showed the structure plainly. A conversation is
one token sequence; each message opens with a special delimiter token,
followed by the role name (“system”, “user”, “assistant”) as ordinary text.
In the structured form, user text cannot forge those delimiters. The document
warns that a raw-string form would allow injections “similar to SQL
injections”. Anthropic’s Messages API marks the line at the API instead: the
system prompt goes in a top-level system parameter, not in the message list.
The marks tell the model where each piece of text came from. Whether it acts on that is down to training, and the same ChatML preview admits its models had seen few system messages and paid “much more attention to user examples”. The delimiters are protected; the authority is not.
The researchers who introduced the instruction hierarchy argue that models often treat a system prompt as the same priority as text from untrusted users. Their remedy is more training, not a runtime check.
Why it matters
Because the marks in a prompt record where text came from but cannot make the model obey it, any piece of text — a retrieved document, a tool result, a user’s message — can act as an instruction. That is a consequence of the design, and it is the condition that makes prompt injection possible.
Model settings shape the output, but the text you write is the main lever. Writing prompts that consistently produce the desired output is a craft skill, and the field studying it is called prompt engineering.
Questions and answers
What is a prompt in AI?
A prompt is the complete input sent to a language model in one turn. It can contain instructions, conversation history, documents, and tool results, all arriving as one sequence of tokens the model reads from start to finish.
What is the difference between a prompt and a system prompt?
A system prompt is one section within a prompt — the part written by the application developer and placed before the conversation begins. The full prompt also includes the user's message, any prior conversation, and tool results. The system section is marked as such, but the model decides how much weight to give it.
Why does prompting matter as a skill?
Because a language model has no way to deduce intent from an ambiguous input, the words chosen and the order they appear in significantly affect what comes back. Prompting is the practice of writing inputs that consistently produce useful, accurate outputs.
Sources
- Chat Markup Language (ChatML v0)OpenAI, 1 Mar 2023
- Messages API referenceAnthropic
- Text generation guideOpenAI
- The Instruction Hierarchy: Training LLMs to Prioritize Privileged InstructionsarXiv, 19 Apr 2024
Guides that use this term
Related topics
In the news
- Vercel adds audits that test if AI providers keep no data
- Meta staff say Muse sent private messages that no one told it to send
- OpenRouter removes 3 AI providers after months of prompt theft
- A coding agent exposed a credential and Together AI prompts leaked
- OpenAI tells developers to change prompts for GPT-6.2 Astra and Sol
- Image editors refuse unsafe text far more than unsafe images
- Google opens its Genie 4 world model to developers through its API
- Lightchain AI sets a plan for AI agents and payments by January
- Google puts AI model, token and tool rules into Envoy
- Suno adds Visuals, AI video clips of 15 seconds for songs
- Context methods can increase coding agent cost by a maximum of 116%
- Microsoft adds MAI models and a 44-model router to Foundry
- A new test shows image safety checks do not find risk in some cultures
- AI models give good results in cancer diagnosis but not in staging
- AI models favor the bonus of their boss in advice, a paper says
- A new attack makes AI agents send 93.88 times more calls
- AI agents used the results of other agents from storage
- Failure labels for AI reasoning change with the sequence of the tests
- Test of 17 AI moderators finds no model strong on all five trust axes
- A monitor external to the model cut AI agent attack success to 1.3%
- GitHub Copilot adds Claude Fable 5.2 with data kept by default
- IBM adds an open-source policy engine to the Praxis AI gateway
- ChatGPT makes animated GIFs with the new Images 2.6 model
- A change of only the payoff scale changes cooperation in 5 AI models
- Axion 1.0 is an open AI agent model with a 3 step recipe
- A free Codex jailbreak bundle makes agents show ads for a gateway
- 6 robot models started to move when they got an empty instruction
- A new test finds more anti-Muslim bias when AI models reason or act
- Emotional prompts gave 80% of chatbot sessions a high anxiety score
- AI agents leaked user data, but no proof shows leaks from training
- Changed variable names made AI agents write code that is not safe
- Web agents send user data to scam sites in 54 to 93% of tests
- A new method makes hidden bad behavior in AI models show in tests
- Fortinet adds AI prompt checks to the firewalls its customers have
- A science agent harness makes GPT models less safe in tests
- A 2015 network beat two top AI models on skin lesions, 62% to 42%
- A rerun of an AI judge changed the verdict on 21.2% of prompts
- Common Sense Media gives ChatGPT for Teens a Unacceptable Risk grade
- Attacker web pages are in 31% of answers from AI search tools
- Chat refusals did not stop dangerous tool calls in 10% to 52% of tests
- CrowdStrike finds four hacker groups that attack with AI and Claude
- 27 AI models agree too much with an incorrect self-diagnosis
- Negation and antonyms get around safety guards in 10 AI models
- A small Qwen3 model cuts AI writing tics from a score of 121 to 12.5
- RedDarwin attack tool gets 100% success on GPT-5.6-Sol
- Bank AI agents cut a report task from six hours to five minutes
- The best AI agent setup plans 78% of tasks offline and 40% online
- GPT-5.5 left out a bad result in 198 of 200 abstracts
- Prompt-injection gates sent more than 91.8% of inputs to a reviewer
- Jev selects its server and not 20 persons in 16 of 48 prompts
- Researchers test a guard that stops a reply only if it turns dangerous
- Participants in a public challenge wrote 208,095 attack prompts
- One prompt could get access to all AgentCore agents in one AWS account
- A new attack agent goes around the guardrails of 4 AI models