A CRM agent should get extend_trial, not update record

An agent with a generic update tool has to re-derive your business rules on every call. A short catalog of intent-level actions carries the rules for it.

Agent Action catalog Preconditions Preview Confirm Commit CRM records Audit log intent-level dry run by a person as the requesting user one row per commit
The agent picks an action; the action checks, previews, waits for a yes, and commits as the user.
On this page
  1. Before: one tool that can do anything
  2. After: the verbs the desk already uses
  3. The definition template, filled in for three actions
  4. Preview, then commit as the person who asked
  5. Fifty old requests against both designs
  6. A 21-day request gets a no

On a renewals desk, extending a trial is four steps. Check the account hasn’t already had an extension. Push the trial end date. Move the opportunity’s close date by the same number of days. Leave a note saying why.

Hand an agent a tool called update_record and “give Corbel two more weeks on their trial” turns into a field to change. Which field, by how much, and what else has to move with it are all left for the model to work out. It will work them out slightly differently on Tuesday than it did on Monday.

I think generic create, read, update and delete tools are the wrong thing to hand a CRM agent for writes. To show why, I’ll redesign one tool for a company I’ve invented for this post, Osprey Cloud, and its equally invented renewals desk.

Before: one tool that can do anything

The first version at Osprey Cloud is the one almost everybody builds first, because it takes an afternoon. The agent gets query(soql) and update(object, id, fields), and the system prompt gets a paragraph of rules:

  • Trials can be extended once per account, by 14 days at most.
  • The close date moves with the trial end date.
  • Only opportunities in the Trial stage qualify.

That paragraph is now the only place the extension policy lives, as far as the agent is concerned. On every call the model has to remember the rules, run the right queries to check them, do date arithmetic, and assemble a field map with the right API names. That’s four chances to be wrong per request, and the tool will accept whatever it’s given, because update has no idea what a trial is.

The failures are quiet, too. The call succeeds. The record saves. A forecast is off by two weeks and nobody connects it to a chat from last Thursday.

After: the verbs the desk already uses

The redesign starts with a list, written by the people on the desk, of the things they get asked to do. It’s short. For Osprey Cloud’s renewals desk it’s three write actions: extend a trial, apply a renewal discount, flag a churn risk.

Each becomes its own tool with a narrow input. extend_trial(account, days) can’t set a close date to an arbitrary value because it doesn’t take a close date. It takes a number from 1 to 14, and the code behind it does the arithmetic. It refuses when the account has already had an extension, and it says so in a sentence the agent can relay.

The rules moved out of the prompt and into the action. The model’s job shrinks to picking the right verb and filling in two or three arguments, which is the part language models are good at.

On Salesforce the mapping is direct. An Agentforce agent action wraps a flow or an invocable Apex method, so the precondition checks sit in Flow Builder or Apex where your admins can read them. If your agent lives outside the CRM, the same actions go behind OpenAI function calling or Claude tool use. Model Context Protocol, a few months old as I write this, is an early option for publishing one catalog to more than one client.

The definition template, filled in for three actions

This is the form I’d write each action down in before anyone builds it. The fields worth arguing over are preconditions and reversible, and having that argument early is the reason to write it down.

- name: extend_trial
  intent: Give an account more time on its current trial.
  inputs:
    account_id: { type: string }
    days: { type: integer, min: 1, max: 14 }
    reason: { type: enum, values: [security_review, procurement_delay, champion_change, technical_blocker] }
  preconditions:
    - Account has exactly one open opportunity in stage Trial.
    - Account has no earlier trial extension.
    - Trial end date is today or later.
  side_effects:
    - Trial end date moves forward by the requested days.
    - Opportunity close date moves forward by the same number of days.
    - Extension record created with reason and requester.
  reversible: true
  required_permission: Extend_Trial

- name: apply_renewal_discount
  intent: Put an approved discount tier on an open renewal.
  inputs:
    opportunity_id: { type: string }
    tier: { type: enum, values: [5_percent, 10_percent, 15_percent] }
    justification: { type: string, max_length: 500 }
  preconditions:
    - Opportunity type is Renewal and it is open.
    - No discount approval is already pending.
    - Requester's discount limit covers the tier.
  side_effects:
    - Discount set on every renewal line.
    - Quote regenerated and the old quote voided.
    - Account owner notified.
  reversible: false
  required_permission: Apply_Renewal_Discount

- name: flag_churn_risk
  intent: Mark an account as at risk so the owner follows up.
  inputs:
    account_id: { type: string }
    level: { type: enum, values: [watch, at_risk, critical] }
    signal: { type: enum, values: [usage_drop, champion_left, support_escalation, budget_cut] }
  preconditions:
    - Account has an active subscription.
  side_effects:
    - Risk level and signal set on the account.
    - Follow-up task created for the account owner.
  reversible: true
  required_permission: Flag_Churn_Risk

And the tool schema the agent sees for the first one, in Claude tool use format. OpenAI function calling takes the same JSON Schema under parameters. mode and preview_id aren’t in the template because every write action in the catalog gets them.

{
  "name": "extend_trial",
  "description": "Extend an account's current trial by 1 to 14 days. Allowed once per account. Call with mode 'preview' first and show the result to the user. Call with mode 'commit' only after the user confirms, passing the preview_id you were given.",
  "input_schema": {
    "type": "object",
    "properties": {
      "account_id": {
        "type": "string",
        "description": "Salesforce Account Id of the account on trial."
      },
      "days": {
        "type": "integer",
        "minimum": 1,
        "maximum": 14,
        "description": "Number of days to add to the current trial end date."
      },
      "reason": {
        "type": "string",
        "enum": ["security_review", "procurement_delay", "champion_change", "technical_blocker"]
      },
      "mode": {
        "type": "string",
        "enum": ["preview", "commit"]
      },
      "preview_id": {
        "type": "string",
        "description": "Returned by a preview call. Required when mode is 'commit'."
      }
    },
    "required": ["account_id", "days", "reason", "mode"]
  }
}

Preview, then commit as the person who asked

Two details in that schema do most of the protecting.

The preview is a dry run. It runs every precondition and returns what would change: old trial end, new trial end, old close date, new close date. The agent shows that to the person, and the commit call needs the preview_id back, so the model can’t skip the step by being confident. The server should also reject a commit whose preview is stale, because records change while people read.

The commit runs as the requesting user. If the commit service uses one integration account with broad rights, the agent becomes a way around your permission model: anyone who can chat can extend a trial. Run it under the caller’s identity and required_permission means something, and the audit log names a human. On Salesforce, check the Apex too. Apex ignores field-level security unless it’s written to run in user mode, whoever the running user is.

Fifty old requests against both designs

Osprey Cloud’s test is one I’d run on any real version of this. Take 50 past extension requests where the right outcome is already known, and replay them against both designs in a sandbox.

In my invented results, the raw-update version set a wrong close date 7 times out of 50. A few moved the trial end date and left the close date alone; the rest counted 14 days from today instead of from the existing end date. The action version got it wrong 0 times, and it refused the requests for accounts that had already been extended, which the raw version had happily granted.

Those numbers are as invented as the company. The asymmetry holds anyway. The first design can only be as right as the model’s recall of a paragraph. The second gives the model no way to write a wrong close date, because no input reaches that field.

A 21-day request gets a no

A catalog is slower to grow than a prompt. Someone asks for a 21-day extension for a strategic account and the agent says no, correctly, and now a human handles it the old way. I’m fine with that. An agent that declines the unusual case is behaving the way a new hire should.

The other cost is ownership. Every action is a small product with a policy inside it, and policies change. Keep the catalog short enough that one team can name every action in it from memory, and leave reads generic. Reading the wrong field is an annoyance. Writing it is a cleanup project.