Not every rule an agent follows carries the same weight. Soft rules live in instructions: tone guidelines, preferred phrasing, suggested escalation paths. The model reads them, but a determined user or an edge-case prompt can talk around them. Hard rules are enforced by the platform itself - validation logic, action filters, permissions, flows - and the model cannot bypass them no matter how the conversation goes.

The failure mode is treating everything as soft. When a refund limit, eligibility check, or compliance restriction exists only in the agent's instructions, enforcement depends on the model's compliance in every single turn. Mapping rules to their enforcement layer makes control explicit and auditable.

Prompt design recipe combining objective, context, constraints, and format

Separate instruction from enforcement

  • Soft rules shape behavior through instructions and are appropriate for style, tone, and preference-level guidance.
  • Hard rules constrain what is possible and belong in platform mechanisms the model cannot override.
  • Every hard rule names exactly one enforcement point, such as an action filter, variable guard, Apex validation, or permission check.
  • Anything with financial, legal, or safety impact defaults to hard enforcement, with instructions used only to explain the rule to the user.

Build the rule map

  1. List every business rule the agent is expected to follow and tag each one as soft or hard.
  2. For each hard rule, record the enforcing component: action filter on the agent action, conditional variable logic, flow decision, or org permission.
  3. Use action filters and input validation so ineligible requests fail deterministically before the action runs, regardless of what the model decided.
  4. Probe the mapping in testing by attempting prompt-level bypasses of each hard rule and confirming the platform still blocks the action.
Further reading

Resources

This article is based on the following Salesforce learning and product documentation.

Continue the architecture path
ControlIrreversible Action Gates

Enforce irreversible decisions in Flow, Apex, validation rules, or a deliberate human gate before the agent can execute them.

ControlPrompts Are Not Controls

Move every rule that must hold deterministically out of the prompt and into enforced platform mechanisms.

ControlMinimal Action Surface

Filter unavailable actions and restrict write permissions so the agent can only do what its use case requires.