Skip to content
Elements.cloud Colour LogoElements.cloud Colour Logo
  • Why Elements?
  • Capabilities
        • Metadata analysis

          Org model, analytics, reports, field population

          Impact assessment

          Dependency trees & grid, impact assessment from story

          Change tracking

          Change governance; change log alerts, reporting, stories

          Access and compliance

          Permission explorer, metafields

          Agent designer

          One smart place to design, deploy and iterate AI Agents. Completely free.

          Salesforce Configuration Mining

          Generate process.maps with insights in context & Data models on demand from your current Org metadata

          Process-led design

          Capture requirements, visually map business processes and generate user stories

          Lifecycle governance

          Regulatory compliance, audit trail and version control

          Change Intelligence Platform Overview

          Enables organizations to know where they are today and realize where they want to be tomorrow. Elements.cloud gives you back control.

          Find out more
  • Solutions
        • By project

          Agentforce

          Tech debt removal

          Navigating complexity

          Salesforce documentation

          Org merge / split

          Compliance & auditing

          Salesforce Implementation

          Org healthcheck

          By cloud

          Agentforce

          Revenue Cloud / CPQ

          Data Cloud

          Sales Cloud

          Service Cloud

          Education Cloud

          Manufacturing Cloud

          Automotive Cloud

          Energy and Utilities Cloud

          Consumer Goods Cloud

          Financial Services Cloud

          Gov Cloud

          Health Cloud

          By role

          Executive

          Management

          Architecture

          Operational/Product Owner

          Consultants

  • Pricing
        • Change Intelligence Platform

          Understand and trust your metadata, your processes, your changes in Salesforce

          • Turn your blackbox of Org complexity into blueprint clarity
          • Leverage deep metadata insights to build the right things at pace
          • Visualize and mitigate the impacts of change
          See pricing

          Free Agent Designer

          The best Salesforce diagramming tool on the market, designed to provide real value and show you the power of a process-led approach.

            • Agent, process & architecture diagrams
            • Instruction & test utterance generation
            • Audit trail & change logs
          Get started

          Consultants & ISVs

          Elements are focused on providing the approach and access to robust, elegant, affordable software, delivered in the cloud at scale.

          Purchase now
  • Resources
        • Resources from elements

          Success stories

          Whitepapers & eBooks

          Blog

          Resource hubs

          Center of Excellence Data cloud

          Events

          Webinars & Videos

          Academy

          Featured content

          New

          eBook

          Ultimate guide to creating Agents

          New

          Webinar

          The #1 Way to Build Complex Agentforce Agents with Confidence

          6 minute read

          News

          Metadata Explorer: Untangle Org Complexity

  • Company
        • Elements.cloud team

          We are Elements

          We’re a dedicated team at Elements.cloud, driven by a passion for innovation and a commitment to excellence in the Salesforce ecosystem.

          Read more about us

          Meet the team

          See the people that make up Elements and talk to us to shape your dream career.

          Meet the team

          Contact us

          It is easy to schedule a call with one of our experts.

          Contact us
  • Login
        • Login

        • Login to Elements
        • Support
        • Managed Package (Prod)
        • Managed Package (Sandbox)
        • Chrome extension
        • Elements.cloud status
Talk to us
Get started free

    Document

    The 10 Agent Instruction Design Patterns (And Their Antipatterns)

    Home » Whitepapers & eBooks » The 10 Agent Instruction Design Patterns (And Their Antipatterns)
    The 10 Agent Instruction Design Patterns (And Their Antipatterns)
1. Unique, Verifiable Conditions
Pattern: When you instruct an AI Agent to do something, you have to ensure the conditions are unique within the scope of the entire instruction set. In the context of Agent Designer, that means that every flowline into an activity box should represent a distinct, verifiable condition.

Antipattern: Repeating semantically similar lines many times, like “If data is missing, then…” and “If data is incomplete, then….” will confuse your AI Agent. Because the conditions are semantically the same, the AI Agent is told it should perform either of the specified instructions under the same circumstances, meaning it will sometimes choose wrongly.

Example: AI has a tendency to try to complete a task at any cost. If it does not have all the required inputs, it will hallucinate (i.e., make things up). Notice how in the example below, we have two conditions that sound almost exactly the same. AI Agents may get confused from time to time about when to do which action.

Unique and specific.


2. Use Business Meaning, Not Code References
Pattern: Describe what you want done, not how it’s technically implemented. If your AI Agents should use an action to create a case, just tell it to create a case.

Antipattern: Instructing your AI Agent to use and invoke specific Flow, Apex, or Action using its API name or ID. Agents don’t reason by metadata, they reason by meaning. If you want to ensure that your AI Agent chooses the right action at the right time, you need to explain what needs to be done and ensure the instructions semantically match the scope and description of the action available for the topic.

Think like an intern, not a developer.

3. Use The Right Tool For The Job
Pattern: AI Agents use a combination of tools. They can reason on their own, based on Instructions, can invoke deterministic Actions, and apply generative / probabilistic Prompt Templates. Each one of those tools serves a specific purpose, and they are not interchangeable. Therefore, your Agent Instruction Diagrams have a resource on the activity box: “AI Agent” for reasoning, “Action” for system logic, “Prompt Template” for interpretation.

Antipattern: Assigning deterministic tasks (like sending an email or calculating discounts) to the AI Agent instead of a system Action. Or requesting complex interpretation and content generation without using a prompt template. 

Be specific about what to use.

4. Phrase Instructions Affirmatively
Pattern: Tell the Agent what to do, not what not to do. While the guardrails are important to specify what an Agent must never do, you want to have only a few of those. You need to guide an AI Agent to understand what you need done. For instance, instead of saying “Do not send email if…”,  rephrase it into actionable guidance, e.g. “Send email only if…”

Antipattern: A lot of instructions phrased as negative statements will ultimately confuse your AI Agent. 

Say yes, not no.

5. Avoid Contradictory Instructions in One Step
Pattern: Each instruction should be logically consistent. For instance, “If a user submits a support ticket marked “Urgent” and includes the keyword “outage,” then immediately escalate the ticket to Tier 2 support and notify the incident response team via Slack.”

Antipattern: Embedding both “if yes, do this” and “if no, do that” inside the same instruction. For instance, “If an invoice is marked as “paid in full”, then send a confirmation email to the user, but also flag the invoice for overdue follow-up.”

Split the logic. One thought, one step.

6. Add Examples to Complex Instructions
Pattern: To help guide your AI Agent, and to provide it with semantic understanding of your business and use-cases, enrich your instructions with examples. That way, the AI Agent will be able to more accurately match user interactions to expected behaviours. This is also important if your AI Agent needs to provide or capture unstructured data and then pass it in a structured format to the deterministic action for further processing.

Antipattern: Leaving it up to the AI Agent to interpret and reason every interaction with the user or business language.

This helps humans and the Agent understand intent better.


 7.  Language Consistency
Pattern: Use consistent terminology across your diagram. If your Agent deals with cases, always refer to them as cases, and not ‘issue’, ‘user problem’, ‘ticket’ etc. Semantic consistency makes it easier for an AI Agent to reason properly.

Antipattern: Calling the same object a “case,” “ticket,” and “issue” may be confusing to an AI Agent. The longer the instructions, the longer the conversation, the more the AI Agent will struggle with maintaining logical consistency. 

Pick a term. Stick with it.

8. Separate Business Rules into Actions
Pattern: AI Agents do not replace your Flows or Apex, they use them. LLMs that underpin AI Agents, are usually not great at calculations and maths (or at least, they cannot produce perfect results consistently). Any deterministic rules, calculations, and database operations should be handled by a deterministic action.

Antipattern: Loading Instructions with pseudo-code or deterministic actions. AI Agents are not the most reliable when counting. Logical checks must be done accurately, and should be implemented as designed actions invoked by an AI Agent.

Rules belong in the system, not in the Agent’s decision-making.

9. Split Complex Tasks Into Smaller Steps
Pattern: Keep each instruction focused and simple.

Antipattern: “Look up users, verify subscriptions, apply discounts, send email.” Even if that invokes the same, single action, the way instructions are phrased as multi-step may confuse the AI Agent.

Break it down. Quicker to design, build, test, debug, and deploy.

 10. Include Confidence Thresholds for Probabilistic Logic
Pattern: This is one of the most important rules to solve hallucinations and improve the quality of output. Define how confident an AI Agent should be, given all the instructions, knowledge, and data input, to act or provide a response. And build in handling steps for what the AI Agent should do or what to ask for if the level of confidence is below that threshold. For instance, ‘“…only proceed if at least 90% confident, otherwise ask for clarification”.

Antipattern: Leaving it to the Agent to guess when it’s “sure enough.”

Use: “Only proceed if 90%+ confident in intent.”
It’s not micromanagement, it’s clarity.

    Unleash Your Potential

    Build your Centre of Excellence with Elements.cloud

    Talk to us

    Post navigation

    PreviousOvercoming Common Challenges in Owning and Implementing CPQ
    NextInsiders Guide to Dreamforce 2025
    Back to Whitepapers & eBooks
    Share

    Join Our Newsletter for the Latest News, Updates & More

    Using Elements is like having a Swiss Army knife for Salesforce. It’s become an integral part of our Salesforce-focused methodologies.
    Daniel Keith - Tenger Ways

    Accelerate your future with Elements, a change intelligence platform that helps you continuously innovate your business

    Talk to us
    Footer logo

    Elements Headquarters

    San Francisco, USA

    Elements Offices

    USA, UK, Canada, Switzerland, The Netherlands & Ukraine

    Contact us
    • Change Intelligence Platform
      • Salesforce Metadata analysis
      • Metadata impact assessment
      • Change tracking
      • Access and compliance
      • Agent Designer
      • Salesforce Configuration Mining
      • Process-led design
      • Lifecycle governance
    • Resources
      • Success stories
      • Integrations
      • Blog
      • Events
      • Webinars
      • Academy
      • Whitepapers & eBooks
      • Support
      • Elements.cloud status
      • Brand Resources
    • Company
      • Team
      • Contact us
      • Pricing
    Salesforce logo

    Available on
    AppExchange

    © 2025  Elements.cloud
    • Trust Center
    • Data Privacy & GDPR
    • Terms of Service (Website)
    • Terms of Service (App)
    • Open Facebook in a new tab
    • Open X in a new tab
    • Open LinkedIn in a new tab
    • Open YouTube in a new tab
    Tech web agency

    Watching videos on Elements.cloud site requires the use of Performance and Advertising cookies. These cookies are associated with video playback via services such as Youtube and Vimeo. In order to watch this video, it will require the acceptance of these additional cookies

    Reject Accept