AgentsInstructions
AGENTS

Instructions

Give an agent a clear job, explicit boundaries, and a response you can evaluate.

Instructions guide the model during execution. They are separate from the user's message and work alongside configured tools and retrieved context.

Start with a focused instruction

For the Support Agent, define a responsibility that can be tested:

YAML
instructions: """
    Help users understand the application.
    Ask for the relevant feature and error message when details are missing.
    Give short, actionable steps.
    Do not claim you changed application data.
    State uncertainty when the available information is insufficient.
    """

This starts without assuming a tool or document index is already attached.

Make vague guidance observable

Vague instructionMore specific instruction
Be helpful.Give the next action and explain what result the user should expect.
Solve any problem.Answer application usage questions; ask for missing details.
Use the documents.Base product-specific claims on retrieved passages and state when they do not answer the question.
Keep it short.Start with the answer and use up to three steps when a procedure is needed.

Describe tool usage

When a tool is attached, say when it should be requested and how its result should affect the response. Use the actual tool name from its definition.

Instructions do not register a tool or enforce authorization. Attach the tool in C# and enforce permissions, validation, and business rules in application code.

Avoid promising an action succeeded until the tool result confirms it. Handle failed or incomplete results explicitly.

Describe source usage

For an agent configured with RAG, a useful instruction is:

Snippet
Use retrieved passages for product-specific claims.
Do not invent details that are absent from the sources.
If the sources do not answer the question, explain what information is missing.

Pair this with the agent's RAG execution mode and no-context policy. Prompt wording alone does not enforce source-only answering. See Retrieval.

Check the behavior in Studio

Try a small set of requests:

  • A clear question within the agent's responsibility.
  • A question missing an important detail.
  • A request outside its responsibility.
  • A request that needs an attached tool.
  • A source-dependent question for which the index has no relevant passage.

Inspect both the answer and run details. Change one rule at a time so you can identify its effect.

Next: Test the agent in Studio →

On this page