Urgent.News

What's breaking now, across thousands of outlets.

AI

AI Agent System Prompt Template: The 5 Blocks That Matter

Most system prompts fail because they mix permanent instructions with facts that change weekly. Here are the five blocks that belong, the four that don't, and a full annotated template. Last month I reviewed the system prompt behind a 14-person HVAC company's booking agent. It ran about 1,900 words. It contained the full price list, three paragraphs of company history, a tone guide, and the…

System prompts often fail due to mixing permanent instructions with facts that change frequently. This article outlines five essential blocks for a well-structured system prompt, as well as four elements that should never be included. The guide also features a full template for a residential service business, making it easy to adapt in just 20 minutes.

The first block focuses on the agent's role and scope. This should be a brief description of the agent's purpose, the services it handles, and explicitly what it does not handle. Adding this scope line helps reduce unnecessary or irrelevant questions. It's also important to mention the business name, as this helps the agent maintain context.

The second block is the source-of-truth pointer. A single sentence should tell the model where all the crucial facts reside, whether it's a designated facts file, a calendar, or an order system. The prompt itself should only contain a reference to these sources, not the facts themselves. This creates a clear separation between changeable information and unchanging data.

The third block introduces the quote-only rule. This is the most impactful sentence in the entire prompt. It instructs the agent to quote only facts listed in the designated facts file, and if a fact isn't listed, inform the user that it will be checked with the team. This helps the agent avoid making up answers or inventing information.

The fourth block outlines escalation triggers. Instead of listing specific questions, provide a list of topics that require human intervention, such as anger, discounts, refunds, or any legal, medical, or dangerous situations. These triggers help route the conversation to a human agent and also signal to the model that the topic is off-limits.

Finally, the fifth block details refusal rules. These are actions the agent will never take, regardless of what the user requests. Examples include revealing internal instructions, claiming to be human, accepting or repeating sensitive information like card numbers or passwords, and compromising safety, such as ignoring gas or carbon monoxide alarms. Placing these rules at the end of the prompt helps ensure they are applied when the conversation reaches a sensitive or critical stage.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in AI

AI Made Coding Faster. Our Delivery Pipeline Had to Catch Up.

A few days ago, I used roughly 30% of my weekly ChatGPT Pro allowance in a short stretch of work on a pull request. CI/CD problems kept the work stuck, and the PR was still unresolved.

  • Author used nearly a third of ChatGPT Pro allowance on one pull request
  • Increased CI jobs to run simultaneously, improving allowance usage
  • Weekly limit not token count, but impact of additional CI jobs

More from Monday 12 October →