Skip to main content

Prompts, context and agents

What information does the system receive, and what can it do with it?

Give it the relevant material, define the task and check the permissions before it acts.

Scope
Language-model applications and agents · Supplement to M1
Reviewed
5 October 2026

In brief

  • The model, the application around it and an agent are different parts of a system.
  • A long visible conversation does not guarantee that every detail reaches the next answer.
  • A request in text cannot enforce the same boundary as a tool permission.

You ask an assistant about your lecture. It gives a clear explanation, but uses a different definition from your slide. Give it the permitted passage and name the definition you need. The useful starting point is the information available for this answer.

Model, application and agent​

Scroll horizontally to view all columns.

Three parts to distinguish when choosing a tool
PartWhat it doesWhat to check
ModelUses learned parameters and supplied context to produce output.Which model is running, and what can you verify about its output?
ApplicationAdds an interface, instructions, selected information and possibly tools.Which sources, settings and connected services does this interaction use?
AgentUses a model to choose steps and tool calls, inspect results and continue a task.What may it read or change, and when must it stop for your decision?

The same model can behave differently in two applications. Their instructions, available sources and tools can differ. An application that retrieves a passage or uses a calculator does not necessarily choose and execute a whole sequence of actions autonomously. The term "agent" varies across products; here it means model-directed steps in an action loop. Anthropic's agent guide describes this distinction between fixed workflows and agents.

What reaches the next answer​

The current context can include your message, selected conversation history, application instructions, permitted excerpts, retrieved passages and tool results. Some of these are visible to you; others are supplied by the application. A file appearing in an interface does not establish which part was supplied to this response.

Applications can shorten, summarize or remove earlier material as a conversation grows. Do not assume that the model receives every visible message unchanged. Anthropic's context documentation gives one concrete implementation of context accounting and management.

Before a follow-up, restate a definition, constraint or decision that the answer depends on. If the assistant uses a lecture passage, inspect it. How AI answers explains what grounding and source markers let you check.

Try a real tokenizer​

A token is a unit used by a model's tokenizer. It can represent a word, part of a word, punctuation or another piece of text. The official tiktoken repository explains how text becomes token IDs. A word count is therefore not an exact token count.

Count tokens with the real o200k_base tokenizer used by GPT-4o. Other models can use different tokenizers.

0 / 2,500 UTF-16 code units. Some emoji use several code units. This is an input limit, rather than a token estimate.

Enter text to inspect its token count and IDs.

The dictionary downloads only when you count tokens. Processing is local; your input is not sent to a server or saved. Reloading clears it. Tokenizer licence.

Compare a short English sentence with a German translation. Then try a German compound word, punctuation and a line of Python. Notice how the count and token IDs change. Similar meaning does not require the same number of tokens.

This lab illustrates the o200k_base encoding used for GPT-4o. It runs in your browser. Other models can use other tokenizers. The count covers your entered text, not an application's complete request, hidden instructions, images or generated output. It is not a price estimate.

A context limit you can calculate​

This is a constructed accounting example. Its numbers describe no particular product. Suppose an interaction has a total budget of 10,000 tokens for input and output:

PartIllustrative tokens
Document excerpts6,000
Selected conversation history2,000
Application instructions and tool definitions1,000
Space reserved for the response2,000
Total needed11,000

It does not fit. To stay within this example's budget, replace the large document selection with a 3,000-token relevant excerpt. The total becomes 8,000. You could also start a focused conversation or carry forward a short summary that you have checked. Products account for input and output differently, so use their current documentation for actual limits.

Fitting the budget still does not prove that the system will use every detail correctly. Liu and colleagues' long-context study found that the position of relevant information affected performance on two tasks in the tested models. That historical finding does not measure every current model. It gives a reason to separate capacity from reliable use and check the passage behind an answer.

Write a task brief you can check​

State the goal, relevant material, constraints and output you need. Include what you will verify. The following is a constructed study prompt:

I am studying recursion in my first programming course.
Use the permitted lecture excerpt below and its definition.
Explain the sentence I marked as unclear at first-year level.
Ask me one question before offering a hint.
Do not solve my assessed exercise.
If the excerpt does not establish a claim, say what is missing.

Excerpt: [paste a short passage you are allowed to share]
Unclear sentence: [identify it]
My current understanding: [write your attempt]

Afterward, compare the explanation with the excerpt and explain the concept without chat. Specific instructions reduce ambiguity; they do not guarantee correct output or compliance. Learning workflows gives complete routines and a comparison you can run yourself.

Separate a suggestion from an action​

These are constructed examples of different action scopes:

Scroll horizontally to view all columns.

Actions that need different access and decisions
TaskCapability neededCheck before proceeding
Draft a message in chatText generationDoes the draft say what you mean?
Save a draft fileWrite access to the selected locationIs this the intended file and content?
Send a messageAccess to a messaging serviceAre the recipient, attachments and final text correct?
Edit a shared documentWrite access to that documentDo you have authority to change it, and can you inspect the changes?

Inspect the scope of access when you enable a tool. Reading a calendar and sending invitations are separate capabilities. Anthropic's account of agent controls uses this distinction as one vendor example; other applications expose different controls. Confirm consequential actions after reviewing their concrete content and destination. Then check the service's result. A generated sentence saying "I sent it" is not independent evidence of delivery.

Sources and scope​

Source review: 5 October 2026. The linked primary documentation supports the token, context and agent explanations. The 2023 long-context paper supports a limited experimental finding, not a current product comparison. Capacities, interfaces and permission settings change; check the exact application you use. All prompts, action scenarios and token-budget numbers on this page are constructed teaching examples.

For input permissions and processing routes, continue with local models and data. For assessment rules, use verify and declare. The English/German glossary explains recurring terms.