Skip to main content
An agent has two prompt surfaces, and keeping them distinct matters. instructions are the rules that hold on every turn; input is the specific thing to do this turn. When retrieval tools are enabled, input is also what the model uses to decide whether and what to search. This page draws the line between the two and shows how to ground the run on retrieved evidence.

instructions vs input

FieldWhat goes here
instructionsRole, tone, output language, citation and formatting rules, and hard do/don’ts. Applied on every turn of the loop, independent of the question.
inputThe question or task for this turn. Guides tool selection, and when retrieval is enabled it is what the model searches on, so a more specific input produces more targeted retrieval.
A useful test: if a rule should still apply when the user asks something completely different, it belongs in instructions. If it is about this request, it belongs in input.
from perplexity import Perplexity

client = Perplexity()

response = client.responses.create(
    model="openai/gpt-5.5",
    instructions=(
        "You are a market analyst. Always cite sources by domain, "
        "and never speculate beyond retrieved evidence."
    ),
    input="What drove NVIDIA's data-center revenue growth in the latest fiscal quarter?",
    tools=[{"type": "web_search"}],
)

print(response.output_text)
With a preset, instructions replaces the preset’s tuned system prompt instead of appending to it. Omit instructions to keep the preset prompt. See Define the run.

Ground the run

Grounding keeps the agent answering from retrieved evidence rather than from the model’s own priors. Two levers do most of the work:
  • Specific input. When retrieval tools are enabled, the model searches based on input. “Q3 FY2026 data-center segment revenue” retrieves more targeted results than “how is NVIDIA doing.” Name entities, time ranges, and the unit of the answer.
  • Retrieval tools. Enable web_search and related tools so the agent pulls live evidence. See Give it tools.
For hard constraints — allowed domains, date ranges, region — prefer request parameters over prose. They are enforced rather than merely requested:
tools=[{
    "type": "web_search",
    "filters": {
        "search_domain_filter": ["sec.gov", "-reddit.com"],
        "search_after_date_filter": "01/01/2026",
    },
}]
Built-in tools like web_search and fetch_url generally work without much prompt-side coaching. Reach for web_search filters and response_format before adding more instruction prose — parameters are enforced directly and don’t re-process on every loop step the way instruction tokens do.

Read the sources back

A grounded answer comes with its evidence. Retrieval tools attach their results to the response output array (for example search_results items alongside the message), so you can surface citations or verify claims. See the per-tool reference pages — starting with Web Search — for exact response shapes.

Go deeper

This page is the working split. For prompt patterns, anti-patterns, and worked examples, see the full Prompt Guide.

Next steps

Give it tools

Enable built-in and function tools, then read their results.

Prompt Guide

Full prompting patterns and best practices.