0%
1
Curious builder0 XP earned · 300 to level 2
0 daysFinish a lesson to begin
Badge collection0 of 6 unlocked
27 small wins to finish your pathNext lesson →

Agent: name, instructions and tools

An Agent is a configuration object that pairs a model with a name, a set of instructions, and a list of tools the model may call.

Last updated: 28 Sep, 2026 · openai-agents 0.22.3

An Agent holds no logic of its own. It records what the agent is called, how it should behave, and what it is allowed to do. The Runner from lesson 4 is what turns that configuration into a run; here you build the configuration and read its fields.

The Agent constructor

You create an Agent by passing keyword arguments. Only name is required; instructions and tools default to nothing.

python
from agents import Agent

agent = Agent(
    name="Shop",                       # a label for this agent
    instructions="Help with orders.",  # the system prompt
    tools=[],                           # functions it may call (none yet)
)

Naming the agent

name is a short label. It shows up when you inspect a run and when one agent hands off to another, so give each agent a distinct name.

python
agent = Agent(name="Shop")  # name is the only required field

Writing the instructions

instructions is the system prompt: the standing message that tells the model how to behave. It is not the customer's question; that arrives when you run the agent.

python
agent = Agent(
    name="Shop",
    instructions="Help the customer with their order.",  # system prompt
)

Listing tools

tools is the list of functions the model may call. It is empty here; lesson 5 adds a real tool to it.

python
agent = Agent(name="Shop", instructions="Help.", tools=[])  # no tools yet

Reading an agent's fields

Creating an Agent needs no model call, so this runs on its own. It prints the three fields you set.

Example
from agents import Agent

shop_agent = Agent(name="Shop", instructions="Help the customer with their order.")
print("name:", shop_agent.name)
print("instructions:", shop_agent.instructions)
print("tools:", shop_agent.tools)

What the three fields held

  • name came back as the string you passed, Shop.
  • instructions is stored as given; the model reads it as the system prompt at run time.
  • tools is an empty list, because none were passed; the model can call nothing yet.

instructions vs a run message

instructionsrun message
Set whereOn the Agent, oncePassed to the Runner, per run
RoleSystem prompt (how to behave)User turn (what to answer)
Changes per questionNoYes

Where you configure agents

  • Giving each agent in a multi-agent flow a clear name and job.
  • Putting rules the agent must always follow into instructions.
  • Collecting the tools an agent is allowed to use in one place.
Watch out. Instructions is the system prompt, not the customer's message. Putting the question a customer asks into instructions makes it a standing rule for every run instead of a one-off request.
Try it yourself
  • Change name to "Refunds" and print it.
  • Add a second sentence to instructions and print the field.
  • Print len(agent.tools) and confirm it is 0.

You understood something today that you didn't yesterday.