Security

An API tool needs a secret key to call an external service.

Where should that key live?

  1. AIn the system prompt, so the model can pass it to the tool.
  2. BIn the tool’s server-side config, which the tool reads directly; the model never sees it.
  3. CIn the conversation, sent once at the start of each session.
  4. DIn the tool’s description, encrypted with a key the model is told in the system prompt, so it can decrypt it only when it calls the tool.

Answer: B

In the tool’s server-side config, which the tool reads directly; the model never sees it.

Why

Secrets belong in server-side config the tool reads directly. Anything placed in the prompt, description, or conversation can leak into logs, traces, or the model’s own output.

More on this topic

More on Way of the Agent

Real situations from building agents - with the answer and why.

Solve a new one every day on the Path