Prompting and evals · L2 · 15 min
Messages
Learn in five minutes
- Hosted APIs usually separate system, user, and tool messages. Confirm the current API.
- The system message is not a secret from a determined user. Do not put a key there.
- Tool results should be marked as tool results.
- Order matters because the model reads the sequence.
- Record which role said each line in the trace.
A trace that flattens every role into one paragraph hides whether the tool or the model spoke. Keep the roles.
Visual
Three lines, three roles
- Write a system line that sets the job.
- Write a user line that asks one question.
- Write a tool line that returns a number you computed outside the model.
- The reply may quote the tool line and must not invent a second number.
Quiz
Ecosystem
- Role
- The label that says whether a line is an instruction, a person, or a tool.
Sisters: JSON schema, Rubrics, Regression tests.
The same job-shape-test card works for chat, voice, and a tool result.
The capstone reuses this card.
Config
- Write the goal in one sentence.
- Name the input and the allowed output.
- Save the trace next to the result.
Troubleshooting
- The answer looks fluent and is wrong. Check whether a source passage actually contains the claim.
- The loop never stops. Set a step cap and stop when the tool result repeats.
Sources and go deeper
- Anthropic, Building effective agents vendor last checked 2026-10
- Amazon Bedrock overview vendor last checked 2026-10
- Prompt engineering — Wikipedia wikipedia last checked 2026-10