# How to write effective instructions

Instructions are like a "behavioral guide" for your Agent: you explain who it is, what it should do, and how it should interact with users. **Writing good instructions is essential** to having an Agent that responds accurately and relevantly.

### What to teach your Agent

When writing instructions, think of it as onboarding a new employee — you need to cover these aspects:

* **Who it is**: what's its role? Is it a customer support agent, a marketing expert, a tutor?
* **Who it talks to**: who are its users? What are they trying to accomplish?
* **What it knows**: what are its areas of expertise? What topics can it discuss?
* **How to communicate**: should it be formal or informal? Technical or simple?
* **What it shouldn't do**: are there topics to avoid or information not to share?

{% hint style="danger" %} <mark style="color:red;">**WARNING**</mark><mark style="color:red;">: never include confidential information in the AI instructions. Instead, put that information inside specific contents</mark> [assigned to a role](/en/agent-training/advanced/content-customization/assigning-contents-to-roles.md) <mark style="color:red;">or with a</mark> [required context](/en/agent-training/advanced/content-customization/context-topics-and-labels.md#required-topics)<mark style="color:red;">.</mark>
{% endhint %}

### How to write effective instructions

**Structure your instructions logically**

* Create clear, well-defined sections (e.g. role, expertise, limits);
* Use a clear information hierarchy;
* Include concrete examples for key concepts;
* Keep formatting consistent.

**Provide context**

* Clearly specify the Agent's operational scope and boundaries;
* Define the background needed to understand requests;
* Indicate when and how to use specific information;
* Include rules for filtering inappropriate content;
* Specify how to handle ambiguous or out-of-scope requests.

#### Questions and answers

* Define the expected format of user requests → brief questions, article excerpts, or other;
* Specify the desired structure of responses;
* Indicate how to handle incomplete or unclear inputs;
* Set rules for formatting responses.

**Clarity and conciseness**

* Use direct, precise language;
* Avoid unnecessary or ambiguous information;
* Focus on the essentials;
* Use specific terms rather than generic ones;
* Clearly define any technical terms.

**Instructions work best when written in English**. If your Agent isn't following instructions precisely, try translating them!

#### Support

If you need help writing instructions, use our [**Meta Prompt Engineer**](https://www.aisuru.com/it/memoridev/Meta%20Prompt%20Engineer): tell it your idea and let the Agent guide you.

### How to optimize and maintain instructions

#### Monitoring and analysis

* Regularly check adherence to instructions;
* Identify patterns of suboptimal responses;
* Analyze escalation or error cases;
* Collect performance metrics.

#### **Optimization and updates**

* Update instructions based on feedback;
* Improve handling of edge cases you've identified;
* Document the changes you make.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.aisuru.com/en/generative-ai/ai-instructions/how-to-write-effective-instructions.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
