Agentic AI · Development Practice

The instructions are
the product.

A system prompt for an agent must withstand numerous LLM calls, adversarial user interactions, tool failures, and various provider platforms, distinguishing prompt engineering for chatbots from agents that must remain operational.

SLIDE 01 : AGENT DEVELOPMENT & PROMPT ENGINEERING Cover slide: Agent Development and Prompt Engineering
Quick answer

Agent prompt engineering Writing system instructions to reliably guide an autonomous agent through multi-step tasks, including tool use, decision-making, and error recovery, rather than a single bounded response is known as procedural prompting. This method differs from standard prompt engineering in three key ways. persistence (the same instruction applies to numerous LLM calls, not just one) tool-use logic (the tool should be called at a specific time and in a particular manner, rather than just being mentioned) error recovery Given the unpredictable inputs, the agent must adhere to a disciplined approach when a step fails, treating the system prompt like production code by versioning, testing against edge cases, and monitoring post-shipment, rather than writing it once and forgetting about it.

SLIDE 02 : THREE PROPERTIES THAT CHANGE EVERYTHING Three properties that separate agent prompting from chatbot prompting
Why "just write a good prompt" isn't enough

A chatbot prompt operates briefly, while an agent prompt can run continuously for days.

Traditional prompt engineering focuses on a linear exchange: one input, one output, and finished. However, agent prompting must adapt to a more complex interaction structure.

  • Persistence : multiple LLM calls are subject to the same instructions over varying amounts of time, spanning from minutes to days, rather than just one exchange
  • Tool-use decisions : the prompt must include instructions on when to use a tool, how to analyze its outcome, and what the completion entails
  • Error recovery : the prompt must outline the agent's response to a failed step, tool error, or incorrect assumption
The building blocks

What actually goes into a system prompt

A system prompt must be general, unambiguous, and resistant to adversarial phrasing since it is evaluated against multiple user inputs, unlike a single user message.

SLIDE 03 : ANATOMY OF A SYSTEM PROMPT Diagram: the parts of a system prompt :  persona, behavior, constraints, tools, output contract
Everything meant to stay constant

Persona, behavior, constraints, tools, contract

A system prompt is the set of instructions that the model receives prior to any user message, establishing the persona, behavior, constraints, available tools, and output contract that remain consistent throughout the entire conversation, rather than just the current turn.

In contrast, a user prompt is temporary and focused on a specific task - created for a single interaction and then discarded. Mixing up the two often leads to unreliable behavior from the agent: guidelines meant for the underlying system are repeatedly brought up and applied inconsistently in each interaction with the user.

One prompt, three very different models

Providers don't treat the system slot the same way

One of the most common failures in production agent development is sending the same system prompt to every provider without any modifications.

SLIDE 04 : SYSTEM PROMPT CONVENTIONS BY PROVIDER System prompt conventions across Claude, GPT, and Gemini
Same intent, different formatting rules

What each provider actually rewards

The formatting decision is not just for looks - it significantly impacts the level of adherence to instructions by each provider.

Anthropic
Claude

A system parameter with genuine privileges, resistant to user overrides. It adheres to XML-style tags consistently and encourages structured prompts. To support intricate models, keep the prompt brief and allow the model's reasoning to handle complexity.

OpenAI
GPT-5 / GPT-4o

The system role is present but with limited privileges - determined user input can override it. In this case, numbered lists and section headers are more effective than XML, as developer messages and response-format constraints are where strict agreements should be enforced.

Google
Gemini

Utilizes a specialized system instruction field and effectively manages lengthy contexts, but can be disrupted by conflicting user requests, leading to noticeable instability in its behavior.

SLIDE 05 : AS LONG AS NECESSARY, AS SHORT AS POSSIBLE Core prompt-writing principles: brevity, structure, and clear constraints
Every word should earn its place

Precision beats verbosity, almost every time

The most effective prompts are typically less than one hundred words, while the least effective ones exceed five hundred. The distinction is not solely based on length; rather, a well-crafted prompt includes constraints or context essential for the model. Any extraneous details are eliminated.

The organization is just as important as being concise: having distinct sections, specific limitations, and, in many cases, a few carefully selected examples instead of an exhaustive list of exceptions. Zero-shot performance is sufficient when a model already excels at following instructions; include examples only if zero-shot is proven to be inadequate.

SLIDE 06 : TOOL-USE RULES INSIDE THE PROMPT Rules governing when and how an agent uses tools, written into the system prompt
Where agent prompts diverge most from chatbot prompts

Telling the agent when to reach for a tool

A chatbot prompt simply instructs on what to say, while an agent prompt must also specify when to take action, including which tool to use, what arguments to provide, how to analyze results, and when to consider the task complete to prevent unnecessary tool usage.

Permission boundaries must be clearly defined, specifying which actions the agent can take independently and which require explicit approval before proceeding, instead of relying solely on the model's discretion.

Beyond manual chat testing

Golden prompts aren't enough at scale

Manual adjustments are suitable for initial testing and do not hinder progress once an agent integrates with actual tools, memory, and customer interactions.

SLIDE 07 : TESTING & EVALUATION Testing and evaluation workflow for agent prompts, including adversarial cases
Measure the change, don't just feel it

Test edge cases like you'd test code

As the agent's surface area increases with more tools, memory, customer-facing workflows, and opportunities for a prompt change to unintentionally cause issues, so do the potential failure points. It is crucial to include adversarial coverage from the beginning, such as jailbreak attempts and conflicts between the system and user prompt, rather than addressing them as an afterthought during the hardening process.

The key difference between successful teams and those facing backlash from users lies in their ability to link prompt modifications to actual results: a slight tweak can disrupt a tool's functionality without warning, and without thorough real-world testing, this issue may only become apparent once the product is already in use.

SLIDE 08 : HOW PROMPTS FAIL IN PRODUCTION Common ways prompts fail once an agent reaches production
The same handful of failures, repeatedly

What actually breaks, once real users show up

  • Prompt drift : a successful prompt during testing loses effectiveness as it encounters real-world scenarios different from those it was optimized for
  • System/user contradictions : the model inconsistently resolves a conflict between a user request and a system instruction, sometimes in favor of the user when it shouldn't
  • Jailbreak and adversarial framing : an adamant user revises an unauthorized plea until finding a loophole in a vaguely-worded restriction
  • Undetected regressions An unnoticed glitch caused by a prompt edit can unexpectedly disrupt tool selection or output formatting, only discovered when triggered by a user.
SLIDE 09 : TREAT PROMPTS LIKE PRODUCTION CODE Summary: version, test, and monitor prompts like production code
The discipline that survives contact with production

Version it. Test it. Watch it after it ships.

The difference between effective demo prompts and reliable production prompts is usually due to discipline rather than creativity: a system prompt that has undergone version control, extensive testing against various scenarios before release, and ongoing monitoring for consistency after deployment behaves vastly different from one that was simply written once and forgotten.

The current transition happening on the field involves a change in perspective - moving from 'prompt engineering' to requirement architecture: encoding domain knowledge and constraints accurately the first time to ensure consistent functionality in all future sessions.

Frequently asked

Agent development & prompt engineering FAQ

Standard prompt engineering focuses on optimizing a single constrained transaction - one input, one output. In contrast, agent prompt engineering must account for persistence (multiple LLM calls during a prolonged task), decision-making around tool usage (timing and method of calling a tool), and handling errors (response to step failures) - aspects that are not typically addressed in a standard chatbot prompt.

Unreliably so. Claude's system parameter holds a genuine advantage with XML-style structure, while GPT's system role excels with numbered lists and section headers. Gemini relies on a dedicated systemInstruction field and is prone to conflicts between system and user messages. Sending the same prompt to all three systems often results in inconsistent behavior.

Keep the prompts concise and focused: strong prompts are typically under a hundred words, each sentence containing a necessary constraint or context for the model. Adding unnecessary language or redundant instructions only weakens the effectiveness of the prompt.

The line should clearly outline the appropriate tool for each situation, the necessary arguments to provide, the correct interpretation of results, the criteria for task completion to trigger tool usage, and specify actions requiring human confirmation instead of autonomous execution.

Testing often depended on a limited number of ideal prompts rather than considering adversarial or edge cases. Requests from actual users can be unpredictable and sometimes contradict system instructions, leaving prompts designed only for clean test cases vulnerable.

This involves tracking every prompt modification, evaluating it with actual and adversarial data before launching, and monitoring its performance post-release, instead of making live changes and only uncovering issues when users provide feedback.

Get started

Ready to write a prompt that holds up in production?

Begin by examining the three distinctive characteristics of agent prompting - persistence, tool-use logic, and error recovery - and conduct rigorous testing against adversarial scenarios prior to deployment, rather than waiting until afterwards.