Skip to content

Start building

Putting agents to work

How to connect an AI agent to your CRM

To connect an AI agent to your CRM, you connect the CRM to the platform once, with an OAuth sign-in or an API token, give the agent only the CRM actions it needs, and decide which of those actions must wait for a person’s approval. The agent can then look up, create and update records as part of its work.

Updated · 4 min read

What can an AI agent do in a CRM?

  • Look up a contact or a company before it answers a customer.
  • Create or update a contact from a form, an email or a chat.
  • Open a deal or an opportunity when a lead qualifies.
  • Find records that match a question, such as open deals for one company.
  • Tell the sales team what it did, for example in a Slack channel.

The agent works like a careful assistant with a login to the CRM: it decides what to look up and what to change, and the platform checks and records each step.

How does an agent connect to a CRM?

The agent never sees a password or a token. You connect the CRM to the platform once. The platform stores the credential encrypted, and when the agent calls a CRM action, the platform makes the API request on its behalf and hands back only the result.

In MyDeepAgents, HubSpot connects with a private app access token, and Salesforce with an OAuth sign-in (authorization code with PKCE), to a production org or a sandbox. Other CRMs include Pipedrive, Zoho CRM, Dynamics 365 Sales, Attio, Close, Copper, Freshsales and Zendesk Sell; the CRM category has more than 40 connectors in all. Browse them in integrations.

Credentials are opened only by the worker that makes the call, and each connector can reach only its own vendor’s hosts.

Which CRM actions can an agent use?

Each connector offers a fixed set of actions, and each action says whether it reads or writes. For the two most common CRMs:

  • HubSpot

    Action
    Search contacts
    Reads or writes
    Reads
  • HubSpot

    Action
    Create or update a contact
    Reads or writes
    Writes
  • HubSpot

    Action
    Update a contact’s properties
    Reads or writes
    Writes
  • HubSpot

    Action
    Create a deal
    Reads or writes
    Writes
  • HubSpot

    Action
    Create a company
    Reads or writes
    Writes
  • Salesforce

    Action
    Find records with SOQL
    Reads or writes
    Reads
  • Salesforce

    Action
    Get a record
    Reads or writes
    Reads
  • Salesforce

    Action
    Create a lead
    Reads or writes
    Writes
  • Salesforce

    Action
    Create or update a contact
    Reads or writes
    Writes
  • Salesforce

    Action
    Create an opportunity
    Reads or writes
    Writes

Neither connector has an action that deletes records, so an agent using them cannot delete anything in your CRM.

How do you connect an agent to your CRM, step by step?

In MyDeepAgents:

  1. Add a connection for your CRM in the console. For HubSpot, paste a private app access token; for Salesforce, choose production or sandbox and sign in.
  2. Open the agent and add only the CRM actions it needs as tools.
  3. Keep “ask first” on for actions that write. The console sets it for every new tool that writes, and you can switch it off for writes you are happy to let run on their own.
  4. Write the instructions: search before creating, which fields to fill in, and what the agent must never change.
  5. Try it in the test chat, against a sandbox where you can, and read each tool call’s input and output.
  6. Publish it, and start it from where the work begins: a website chat, a workflow, or another agent.

How do you keep CRM data safe?

  • On the CRM’s side, give the token or the signed-in user only the access the agent needs.
  • On the agent’s side, add only the actions it needs. An agent that only answers questions needs only the read actions.
  • Fixed values: a tool can carry preset arguments, such as a pipeline or an owner, that always win over the model’s choice and are hidden from it.
  • Fewer fields back: a tool can return only the fields you name, so the model never sees the rest of the record.
  • Approvals on writes, so a person checks each change before it happens. See human-in-the-loop approvals.
  • Data class: CRM actions are marked as handling personal data, so the agent’s compliance profile and policies apply to them.

Can the agent react to changes in the CRM?

Not directly yet. MyDeepAgents does not copy or sync your CRM data: every action reads or writes the CRM at the moment it runs, so the agent always works on current records. Workflows cannot yet start from CRM events by themselves.

Two patterns work today. A workflow on a schedule can run an agent that searches for new or changed records and deals with what it finds. Or any system that can call a web address can start a workflow through its webhook, signed with HMAC or carrying a token. See AI agents vs workflows.

Key points

  • Connect the CRM to the platform once; the agent never sees the credential.
  • Give each agent only the CRM actions it needs, and keep approvals on writes.
  • In MyDeepAgents HubSpot connects with a private app token and Salesforce with OAuth, production or sandbox.
  • Preset arguments and returned-field filters limit what the model can change and see.
  • Actions work on live CRM records; nothing is copied or synced.

Questions people also ask

Does the AI agent see all of my CRM data?

Only what its actions return. Each tool can be set to return just the fields you name, and the agent can only use the actions you gave it.

Which CRMs can a MyDeepAgents agent connect to?

HubSpot, Salesforce, Pipedrive, Zoho CRM, Dynamics 365 Sales, Attio, Close, Copper, Freshsales, Zendesk Sell and more: the CRM category has more than 40 connectors.

Can the agent delete records in my CRM?

Not with the HubSpot or Salesforce connectors: neither offers a delete action. Their write actions create and update records, and the console sets those to ask a person first.

Can I test the agent against a Salesforce sandbox?

Yes. When you connect Salesforce you choose production or sandbox, and a sandbox connection signs in at test.salesforce.com.

Early access

Put an agent to work

Build an agent, connect it to your tools, and decide what it may do on its own. Or tell us what you want it to do.