penWriting Instructions

How to write effective instructions for your AI agent

Instructions are the most important part of your agent's configuration. They tell your agent who it is, how to behave, and what to do in different situations. Think of instructions as the onboarding document you'd give a new team member.

Where to find instructions

Open your agent and click the Instructions tab in the main content area. Instructions are written in plain text (markdown supported).

What to include

Good instructions cover four areas:

1. Identity and role

Tell the agent who it is and what it does.

Good example:

You are a customer support agent for Acme Corp. You help customers
with product questions, troubleshooting, and account issues.

Bad example:

You are an AI.

2. Response style

Define how the agent should communicate.

Good example:

Bad example:

3. Handling specific situations

Give clear rules for common scenarios.

Good example:

4. Escalation rules

Define exactly when the agent should hand off to a human.

Good example:

Bad example:

Template by use case

Support agent

Triage agent

Knowledge agent

Tips for better instructions

Be specific. Vague instructions lead to inconsistent behavior. Instead of "be helpful," define exactly what helpful looks like.

Include examples. If you want responses formatted a certain way, show an example in the instructions.

Iterate based on testing. Test in the chat panel, see what the agent gets wrong, and refine instructions accordingly.

Don't overload. A focused set of clear rules works better than a long list of edge cases. Start simple and add rules as you discover gaps.

Use the chat assistant. The AI assistant in the right panel can help you write and refine instructions.

Last updated