An Inside Look at Top AI Agent System Prompts
Ever wondered what makes AI coding assistants like Devin, Cursor, Manus, or Lovable tick? It's not just the powerful AI model inside. A huge part of their capability comes from their system prompt – the detailed set of instructions that acts as their operational blueprint. Think of it as the ultimate instruction manual guiding the AI's every move.
By examining the recently revealed system prompts of top AI tools (like those found in this GitHub repo - Disclaimer: External link, content not affiliated with MindPal), we can learn a ton about how to build effective AI agents. These aren't just high-level descriptions; they contain specific commands, rules, and structures.
Let's dive deep into the key learnings, illustrated with real examples from the prompts, to give you an inside-out understanding – even if you're not a tech expert!
1. Define the Persona and Purpose (The AI's "Job Description")
First things first, the prompt tells the AI who it is and what it's supposed to do. This is crucial for setting expectations and focusing the AI's behavior.
- Cursor: "You are a powerful agentic AI coding assistant, powered by Claude 3.7 Sonnet. You operate exclusively in Cursor... You are pair programming with a USER to solve their coding task." (Clear identity, capability, environment, and core task).
- Devin: "You are Devin, a software engineer using a real computer operating system. You are a real code-wiz... your mission is to accomplish the task using the tools at your disposal..." (Strong persona, expertise, and mission).
- Lovable: "You are Lovable, an AI editor that creates and modifies web applications... You are friendly and helpful..." (Specific role, core function, and personality trait).
- Manus: "You are Manus, an AI agent created by the Manus team. You excel at the following tasks: 1. Information gathering... 2. Data processing... 3. Writing... 4. Creating websites..." (Clear creator, name, and a list of specific skills).
Detailed Insight: Notice how specific these are. They don't just say "You are an AI." They define the type of AI, its skills, and its goal. This is like telling an employee, "You're our Senior Marketing Manager, responsible for social media strategy and campaign execution."
In MindPal, the very beginning of your System Instructions serves this exact purpose. Defining a clear role (e.g., "You are a helpful customer support agent specializing in troubleshooting product X") immediately focuses the agent.
2. Structure for Iteration and Feedback (The "Work Cycle")
Complex tasks aren't done in one go. The prompts build in a cycle of action, observation, and reaction.
- Manus: Explicitly defines an
agent_loop
:- Analyze Events (User messages, tool results)
- Select Tools (Choose the next action)
- Wait for Execution (System runs the tool)
- Iterate (Repeat the process)
- Submit Results (Show the user)
- Enter Standby (Wait for next task)
- Cline/Roo: States clearly: "You use tools step-by-step to accomplish a given task, with each tool use informed by the result of the previous tool use... ALWAYS wait for user confirmation after each tool use before proceeding."
- Replit: Instructs the agent to use feedback tools: "After making changes, check the app's functionality using the feedback tool (e.g.,
web_application_feedback_tool
), which will prompt users to provide feedback..."
Detailed Insight: This iterative structure is like a conversation. The AI does something (calls a tool), waits to see what happened (gets the tool's output or user feedback), and then decides what to do next based on that result. It prevents the AI from just running off and doing the wrong thing for too long.
This is the core concept of MindPal Workflows. You visually connect different Agent Nodes, tool calls, and logic nodes (like the Router Node or Loop Node) on the Canvas. Each connection represents a step, and the flow depends on the output of the previous step, creating that essential iterative cycle.
3. Master Tool Definition and Usage (The AI's "Toolbox Instructions")
This is where the prompts get really specific. They don't just list tools; they provide detailed manuals for each one.
-
Cursor (using JSON format for tools):
<function>{ "description": "Read the contents of a file...", "name": "read_file", "parameters": { "properties": { "target_file": {"description": "The path of the file to read...", "type": "string"}, "start_line_one_indexed": {"description": "The one-indexed line number to start reading from...", "type": "integer"}, // ... other parameters }, "required": ["target_file", ...], // Tells the AI which parameters are mandatory "type": "object" } }</function>
Explanation: This tells Cursor exactly what the
read_file
tool does, its name, the information it needs (parameters
liketarget_file
), what type of information each parameter expects (type
), and which ones are absolutely required (required
). -
Devin (using custom XML-like tags):
<shell id="shellId" exec_dir="/absolute/path/to/dir"> Command(s) to execute. Use `&&` for multi-line commands. Ex: git add /path/to/repo/file && git commit -m "example commit" </shell>
Explanation: This defines a
shell
command. It needs a uniqueid
, the directoryexec_dir
where the command should run, and the actualCommand(s)
inside the tags. It even gives examples and specific rules like using&&
for multiple commands. -
Lovable (using custom tags):
<lov-write file_path="src/components/Button.tsx"> // Complete code for the Button.tsx file goes here... // ... </lov-write>
Explanation: Lovable uses
<lov-write>
to signal writing a file. It requires thefile_path
attribute and expects the entire file content within the tags. This is a strict format it must follow. -
Bolt (using custom tags):
<boltArtifact id="create-users-table" title="Create Users Table"> <boltAction type="supabase" operation="migration" filePath="/supabase/migrations/create_users.sql"> /* SQL migration content */ </boltAction> <boltAction type="supabase" operation="query" projectId="${projectId}"> /* Same SQL content as migration */ </boltAction> </boltArtifact>
Explanation: Bolt groups actions into
<boltArtifact>
. Each specific action uses<boltAction>
with attributes defining thetype
(e.g.,supabase
,file
,shell
), theoperation
, and necessary details likefilePath
orprojectId
.
The key here is precision. The prompts leave no room for ambiguity. They define the exact name, purpose, required inputs (parameters/arguments), expected format, and often provide rules or examples for each tool. This structured approach makes tool use reliable.
When you configure Tools in MindPal, you provide a name, description, and define the input parameters (arguments). The clearer your description and parameter definitions, the better the agent will understand when and how to use that tool correctly within a workflow.
4. Context is King (and Queen!) (Giving the AI "Background Info")
An AI agent needs background information to make smart decisions. The prompts specify what context is available and how to use it.
- Cursor: "Each time the USER sends a message, we may automatically attach some information about their current state, such as what files they have open, where their cursor is... This information may or may not be relevant to the coding task, it is up for you to decide." (Tells the AI what info it gets and that it needs to judge relevance).
- Devin: "When making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns... first look at the code's surrounding context (especially its imports)..." (Instructs the AI to actively seek and use context from the code itself).
- Cline/Roo: "At the end of each user message, you will automatically receive environment_details... Use it to inform your actions and decisions..." (Specifies a type of context and its purpose).
- Bolt: "IMPORTANT: When receiving file modifications, ALWAYS use the latest file modifications and make any edits to the latest content of a file." (Rule about using the most current context).
The prompts ensure the AI doesn't operate blind. They might get file contents, error messages, user history, or details about the environment they're running in. The prompt guides them on how to incorporate this information.
This is where Knowledge Sources in MindPal shine. You can upload documents, connect websites, or add text notes to give your agent the background information it needs. Furthermore, in workflows, you can pass data between steps using Variables, ensuring context flows through the process.
5. Plan Before Acting (The AI's "Strategy Session")
For anything non-trivial, just jumping into action is risky. Good prompts encourage or enforce planning.
-
Devin: Has a dedicated "planning" mode where it must "...gather all the information you need... search and understand the codebase... Once you have a plan that you are confident in, call the
<suggest_plan ... />
command." It also uses<think>...</think>
tags for internal reasoning:<think>The user wants to refactor the login function. I need to find where it's defined (`go_to_definition`), see where it's used (`go_to_references`), and then plan the edits using `str_replace`.</think>
Explanation: This shows the AI reasoning through the steps before executing any tools.
-
Manus: Relies on a separate "Planner module" that provides task steps in the event stream, which the agent must follow. It also uses
todo.md
as a detailed checklist derived from the plan. -
Bolt: Explicitly asks for a brief plan: "Before providing a solution, BRIEFLY outline your implementation steps... List concrete steps you'll take..."
-
Cline/Roo: Mandates thinking before acting: "Before calling a tool, do some analysis within
<thinking></thinking>
tags... think about which of the provided tools is the most relevant..."
Whether it's a formal planning phase, using internal "think" steps, or following an external plan, the goal is the same: break down the problem and strategize before executing. This leads to more coherent and successful outcomes.
Complex tasks in MindPal are best handled with multi-agent workflows. Nodes like the Orchestrator-Worker Node are specifically designed for breaking down a large task, assigning sub-tasks to worker agents, and managing the overall plan. You can also build simpler planning steps using conditional logic with the Router Node.
6. Guide Communication and Interaction (The AI's "Conversation Rules")
How should the AI talk to the user? When should it ask for help or confirmation? The prompts lay down the law.
- Manus: Has very specific rules using distinct tools:
message_notify_user
: For updates, non-blocking. Example:<message_notify_user><text>I have successfully read the file contents.</text></message_notify_user>
message_ask_user
: For questions, requires a reply. Example:<message_ask_user><text>Which version of the library should I install?</text></message_ask_user>
- Devin: Specifies when to talk to the user (e.g., environment issues, needing permissions) using
<message_user>
and how to report problems using<report_environment_issue>
. - Cline/Roo: Uses
<ask_followup_question>
when clarification is needed and<attempt_completion>
to present the final result, explicitly forbidding conversational filler.
Explanation: This tool forces the AI to ask a specific question and even suggest possible answers to make it easier for the user.<ask_followup_question> <question>Which file should I apply these changes to?</question> <follow_up> <suggest>./src/app.js</suggest> <suggest>./components/MainComponent.jsx</suggest> </follow_up> </ask_followup_question>
These rules manage the flow of conversation, ensuring the AI communicates effectively, doesn't annoy the user with unnecessary chatter, asks for help when stuck, and knows how to present its final work.
You can guide communication using the Human Input Node in workflows to explicitly ask the user for information or confirmation. Setting a clear Brand Voice also helps define the agent's overall communication style (e.g., formal, friendly, technical).
7. Know Your Environment (and Its Limits) (The AI's "Operating Manual")
Agents need to know the rules of the sandbox they're playing in.
- Bolt: Provides extremely detailed
<system_constraints>
about the WebContainer environment:- "LIMITED TO THE PYTHON STANDARD LIBRARY ONLY"
- "There is NO
pip
support!" - "WebContainer CANNOT run native binaries or compile C/C++ code!"
- "Git is NOT available."
- "Prefer writing Node.js scripts instead of shell scripts."
- Replit: "Prioritize Replit tools; avoid virtual environments, Docker, or containerization... Use Replit's workflows for long-running tasks..."
- Cursor: "You operate exclusively in Cursor..."
If the AI tries to use pip
in Bolt's environment, it will fail because the prompt explicitly forbids it and explains the limitation. Defining the environment prevents wasted effort and errors.
While MindPal provides a flexible environment, if you are building an agent designed to interact with a specific external system (like a particular CRM, a specific database type, or a constrained execution environment via an API), you should detail those constraints within the agent's System Instructions.
8. The Big Picture: Anatomy of a Master System Prompt
Okay, we've dissected the key ingredients: persona, tools, iteration, context, planning, communication, and environment. But how do these pieces assemble into the final, often lengthy, system prompt that guides an agent like Devin or Cursor?
Think of a master system prompt less like a short note and more like a comprehensive Employee Handbook + Project Brief + Technical Manual combined. While the exact order and formatting vary (some use XML-style tags, others JSON, others markdown sections), a typical structure often emerges:
-
Preamble & Persona:
- Who You Are: "You are [Agent Name], a [Role/Expertise]..." (e.g., Devin, Manus, Lovable).
- Core Mission: "Your goal is to [Primary Objective]..." (e.g., assist the user with coding, build web apps).
- Key Capabilities/Excel At: A brief list of strengths (e.g., Manus' list of tasks).
-
Operating Principles & Core Rules:
- High-level guidelines on how to work (e.g., prioritize Replit tools, follow coding best practices, maintain data integrity).
- Language settings, communication style preferences.
-
Environment Definition & Constraints:
- Details about the operating system, available software, limitations (e.g., Bolt's WebContainer constraints, no pip, no git).
-
Workflow & Iteration Process:
- How the agent should approach tasks (e.g., Manus' agent loop, Devin's planning/standard modes, Cline/Roo's step-by-step tool use).
- Instructions on handling feedback and errors.
-
Tool Library & Usage Protocols (Often the Largest Section):
- Detailed definitions for each available tool.
- Format: How to call the tool (e.g., JSON schema for Cursor, XML tags for Cline/Roo, custom tags for Devin/Lovable/Bolt).
- Parameters: Required and optional inputs, their types, and descriptions.
- Usage Rules: Specific instructions, constraints, and best practices for when and how to use (or not use) each tool. (e.g., Devin: "NEVER use the shell command to create... files but use your editor commands instead").
-
Context Handling:
- What information the agent will receive (e.g., file contents, user history, environment details).
- How to interpret and utilize this context.
-
Communication & Interaction Rules:
- When and how to communicate with the user (e.g., notify vs. ask, using specific message tools like Manus'
message_notify_user
). - How to ask for clarification or report issues.
- Rules about tone and language.
- When and how to communicate with the user (e.g., notify vs. ask, using specific message tools like Manus'
-
Specific Task Guidelines (If Applicable):
- Sometimes includes rules for specific types of tasks, like coding best practices (Devin), database migration rules (Bolt), or writing styles (Manus).
Simplified Structural Example (Conceptual):
# --- Agent Definition ---
You are Agent X, an expert data analyst. Your goal is to help users analyze data sets.
# --- Core Principles ---
- Prioritize accuracy.
- Communicate findings clearly.
- Use Python for analysis.
# --- Environment ---
- You operate in a sandbox with Python 3.10 and standard libraries.
- Pandas and NumPy are pre-installed.
- Internet access is available via the 'web_search' tool only.
- You cannot install new packages.
# --- Workflow ---
1. Understand the user's request.
2. Use <thinking> tags to plan your analysis steps.
3. Use available tools sequentially.
4. Present results using the 'present_analysis' tool.
5. Wait for feedback after each tool use.
# --- Tool Definitions ---
## Tool: read_csv
Description: Reads data from a CSV file.
Parameters:
- file_path (string, required): Path to the CSV file.
Usage Rules:
- Only use for files ending in .csv.
- Handle potential errors during reading.
Format: <read_csv><file_path>path/to/file.csv</file_path></read_csv>
## Tool: analyze_data
Description: Performs statistical analysis using Python/Pandas.
Parameters:
- python_code (string, required): Python code snippet for analysis.
- input_variable_name (string, required): Name of the Pandas DataFrame variable in the code.
Usage Rules:
- Code must use the variable name provided.
- Output should be a summary dictionary.
Format: <analyze_data><input_variable_name>df</input_variable_name><python_code>...</python_code></analyze_data>
## Tool: present_analysis
Description: Formats and presents the analysis results to the user.
Parameters:
- summary_dict (dict, required): The dictionary output from 'analyze_data'.
- explanation (string, required): A natural language explanation of the findings.
Format: <present_analysis><summary_dict>...</summary_dict><explanation>...</explanation></present_analysis>
# --- Communication Rules ---
- Use 'ask_clarification' tool if request is unclear.
- Do not use conversational filler.
# --- Error Handling ---
- If a tool fails, analyze the error message and try an alternative approach or ask for help using 'report_error'.
Key Takeaway: Building these prompts is an act of detailed specification. Every aspect of the agent's behavior, capabilities, and constraints needs to be explicitly defined. It's a complex task requiring careful thought about how all the pieces interact.
This is why platforms like MindPal are so valuable. Instead of managing one giant, potentially fragile text prompt, MindPal breaks these components down into manageable sections: System Instructions for the persona and core rules, a dedicated Tools interface, Knowledge Sources for context, and the Workflow Canvas for defining the iteration process and logic. This structured approach makes building and maintaining sophisticated agents much more feasible.
Conclusion: Building Better Blueprints, Step-by-Step
Peeking inside these system prompts demystifies much of the "magic" behind advanced AI agents. Success comes from highly detailed, structured instructions covering persona, iteration, tools, context, planning, communication, and environment constraints.
The good news? You don't need to write thousands of lines of prompt code yourself. Platforms like MindPal provide the building blocks to implement these same principles visually and intuitively.
- Define the Persona in System Instructions.
- Build Iteration and Planning with Workflows using nodes like Loops, Routers, and Orchestrators.
- Specify Tools with clear parameters.
- Provide Context via Knowledge Sources and Variables.
- Manage Communication with Human Input Nodes and Brand Voice.
- Define Environment constraints in System Instructions.
By understanding these core concepts, illustrated by the detailed structures used by the top AI tools, you can build significantly more capable and reliable AI agents.
Inspired to build your own intelligent agent? Dive into MindPal's platform and start applying these powerful prompting strategies today!