Skip to content
Module 3The Four Pillars & Advanced Prompt Engineering

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:

  1. The System Prompt — The static instructions that never change.
  2. The Retrieved Context — The dynamic chunks of data pulled from the Vector Store via RAG.
  3. 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:

PillarPurposeExample
1. Role & GoalDefines 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 & ConstraintsDefines how the agent operates and what it must never doNegative constraints, behavioral rules, scope boundaries
3. Tools & ResourcesDefines 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 FormatDefines how the agent communicatesTone, 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.

LevelNameExample Instruction
Level 1Informer"Only provide information. Never take any action on behalf of the user."
Level 2Collaborator"Propose a troubleshooting plan. Wait for the user to approve the plan before you execute any steps."
Level 3Executor"Execute standard troubleshooting steps automatically. Pause and ask for approval only for destructive actions."
Level 4Approver"You may issue refunds up to $50 automatically. For any amount higher, draft the refund request and ask the user for approval."
Level 5Autonomous"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:

  1. Thought: The agent reasons about the current state of the task.
  2. Action: The agent decides to use a tool or function to gather data or affect change.
  3. 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:

  1. Write initial instructions using the 6-section anatomy
Training navigation and instruction-version selector.
  1. Highlight 1: The Train tab.
  2. Highlight 2: Agent Instructions, Documents and Advanced Settings.
  3. Highlight 3: Instructions Version: which saved version you are looking at.
Instruction text and save controls.
  1. Highlight 1: Current Instructions: edit the text here.
  2. Highlight 2: Save
  3. Highlight 3: Save version keeps this text as a new version.
  1. Test in Copilot — try to break the agent, ask edge-case questions
Question entry, conversation list and filters.
  1. Highlight 1: Ask any question: type a test question.
  2. Highlight 2: Your test conversations, newest first.
  3. Highlight 3: Filters: All, Archived, Favorites, Unread, Assigned.
Conversation status and profile-menu controls.
  1. Highlight 1: Status: New, Escalated, Complete.
  2. Highlight 2: Admin Mode, in the profile menu.
  3. Highlight 3: Personalized Prompt and Copilot Settings.
  1. Observe — when the agent makes a mistake, check the reply's Sources
Sources lists the files a reply cited. It is not a list of every piece of text that was searched.
  1. Highlight 1: Click Sources under the reply.
  2. Highlight 2: The Files tab.
  3. Highlight 3: The cited file: northstar-support-guide.md.
  1. Refine — update instructions, save, and test again
Launch Pad → Train → Agent Instructions: fix the source here, then save.
  1. Highlight 1: Current Instructions: edit the text here.
  2. Highlight 2: Save
  3. 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.