The System Prompt as Agent DNA
An agent's system prompt guides its identity, behavior, and boundaries alongside code, tools, permissions, knowledge, and the model. It is not the sole determinant of behavior or a substitute for enforced access controls.
A common mistake is treating the system prompt like a search query. It is not. It is a configuration file for a digital employee.
Understanding the Context Window
To engineer effective prompts, you must understand the context window — the total amount of information the AI can retain in its working memory during a single interaction. The context window is filled by three things:
- The System Prompt — The static instructions that never change.
- The Retrieved Context — The dynamic chunks of data pulled from the Vector Store via RAG.
- The Conversation History — The ongoing back-and-forth with the user.
Critical implication: If your system prompt is too long or poorly structured, it consumes too much of the context window, leaving less room for retrieved knowledge and causing the agent to "forget" earlier parts of the conversation.
The Four Pillars of a High-Quality Prompt
The following four pillars are a suggested framework for organizing a prompt, not a required structure:
| Pillar | Purpose | Example |
|---|---|---|
| 1. Role & Goal | Defines who the agent is and its primary objective | "You are a Level 2 Technical Support Agent. Your goal is to resolve API integration issues." |
| 2. Instructions & Constraints | Defines how the agent operates and what it must never do | Negative constraints, behavioral rules, scope boundaries |
| 3. Tools & Resources | Defines what the agent can do — external functions, webhooks, data sources | "When the user asks about order status, use the get_order_status function." |
| 4. Output Format | Defines how the agent communicates | Tone, JSON structure, Markdown tables, response length |
Calibrating Autonomy
Autonomy is not a binary switch; it is a spectrum. Instructions guide the intended level of independence, while code, available tools, permissions, knowledge, and the model also shape what the agent can actually do. Configure access controls and test the resulting behavior.
| Level | Name | Example Instruction |
|---|---|---|
| Level 1 | Informer | "Only provide information. Never take any action on behalf of the user." |
| Level 2 | Collaborator | "Propose a troubleshooting plan. Wait for the user to approve the plan before you execute any steps." |
| Level 3 | Executor | "Execute standard troubleshooting steps automatically. Pause and ask for approval only for destructive actions." |
| Level 4 | Approver | "You may issue refunds up to $50 automatically. For any amount higher, draft the refund request and ask the user for approval." |
| Level 5 | Autonomous | "Handle the entire workflow end-to-end. Only escalate if you encounter an error you cannot resolve." |
The ReAct Loop (Reason and Act)
To act autonomously, an agent needs a framework for making decisions. The most effective pattern is ReAct — a cycle of Thought, Action, and Observation:
- Thought: The agent reasons about the current state of the task.
- Action: The agent decides to use a tool or function to gather data or affect change.
- Observation: The agent looks at the result of that tool call and decides next steps.
Example instruction: "Before answering the user, you must first THINK about what data you need. Then, use the search_knowledge_base tool to ACT. Finally, OBSERVE the results and formulate your final response."
Spelling out this pattern in your instructions can help with multi-step questions. It does not guarantee correct tool use, so test it in Copilot with realistic questions.
The Iteration Loop
You will rarely write perfect instructions on the first try. Building a great agent requires continuous refinement:
- Write initial instructions using the 6-section anatomy
- Highlight 1: The Train tab.
- Highlight 2: Agent Instructions, Documents and Advanced Settings.
- Highlight 3: Instructions Version: which saved version you are looking at.
- Highlight 1: Current Instructions: edit the text here.
- Highlight 2: Save
- Highlight 3: Save version keeps this text as a new version.
- Test in Copilot — try to break the agent, ask edge-case questions
- Highlight 1: Ask any question: type a test question.
- Highlight 2: Your test conversations, newest first.
- Highlight 3: Filters: All, Archived, Favorites, Unread, Assigned.
- Highlight 1: Status: New, Escalated, Complete.
- Highlight 2: Admin Mode, in the profile menu.
- Highlight 3: Personalized Prompt and Copilot Settings.
- Observe — when the agent makes a mistake, check the reply's Sources
- Highlight 1: Click Sources under the reply.
- Highlight 2: The Files tab.
- Highlight 3: The cited file: northstar-support-guide.md.
- Refine — update instructions, save, and test again
- Highlight 1: Current Instructions: edit the text here.
- Highlight 2: Save
- Highlight 3: Save version keeps this text as a new version.
Key Question: What happens if the system prompt conflicts with a document in the Vector Store? Don't rely on either one winning. Instructions usually guide how retrieved documents are used, but the result depends on the model and the wording. Fix the conflict at its source, then test again in Copilot.