The agent instructions in the sample are one sentence: call `whoami`, and never invent a subject. The token stays in `Caller`. The model sees the tool result.

## What the model is told

```python
return Agent(
    name="authdog-caller",
    instructions="Call whoami. Never invent a subject.",
    tools=[whoami],
)
```

The tool docstring says the same thing: "Return the Authdog subject for this caller. Do not invent one."

That is the enrichment. The subject is not written into the prompt in advance, because the prompt does not know it yet. `whoami` asks the API, and the API's answer is what the model may repeat. If you add a sentence about who the caller is, take it from that result. Do not take it from the user message.

## What stays out of the instructions

- `Caller.token` and `AUTHDOG_ACCESS_TOKEN`
- `AUTHDOG_CLIENT_SECRET`
- `PK_AUTHDOG`
- `OPENAI_API_KEY`

`Runner.run` needs `OPENAI_API_KEY` in the agent process environment. It does not need that key inside the instructions string. The same goes for the Authdog token: `context=Caller(token=os.environ["AUTHDOG_ACCESS_TOKEN"])` passes it to the tool, not to the prompt.

If the API returns `401`, the instructions should leave that as a refusal. A follow-up sentence that says "if whoami fails, ask the user for their id and continue" teaches the model to skip the gate.

When the token is a [delegation token](/guides/agent-delegation), the subject string is the user. Say so in the instructions if the model must distinguish the user from the agent. The sample does not. It prints the subject the API returned.

## Related

| Read | To learn how to |
| --- | --- |
| [Authorizing tool calls for the OpenAI Agents SDK](/docs/ai/openai-agents/authorize-tool-calls) | Let the API be the one that refuses |
| [API keys and M2M for the OpenAI Agents SDK](/docs/ai/openai-agents/api-keys-and-m2m) | Keep the secret out of `Caller` |
| [OpenAI Agents SDK](/docs/agent-frameworks/openai-agents) | See the tool and the route together |
| [Custom channel auth for the OpenAI Agents SDK](/docs/ai/openai-agents/channel-auth) | Pass `Caller` into `Runner.run` |
