Your first human-in-the-loop task
In this tutorial we'll build an AI Agent that creates contacts in HubSpot, and we'll make sure every single contact creation pauses for your approval first. You'll see exactly what your AI Agent wants to write into HubSpot, and nothing lands in your CRM until you click Approve.
By the end, you'll have built a reusable pattern you can apply to any destructive tool — email sends, webhook calls, data deletions, or any other write.
No problem. If you don't have a HubSpot account, swap the HubSpot Create Contact tool for the Email tool — everything else in this tutorial works the same way. Your AI Agent will pause before sending each email instead.
What you'll need
- A Cubeo AI account (sign up here if you don't have one).
- A HubSpot account you're comfortable writing test contacts into (or an email account, if you're using the fallback).
No code, no setup beyond these.
Step 1 — Create the AI Agent
-
From the dashboard, click Create New AI Agent.
-
Name it Lead Intake.
-
Leave the default model.
-
In AI Agent Instructions, paste this:
You help the user capture new leads. When the user describes a person, extract their first name, last name, email, and company, and create them as a contact in HubSpot. Always confirm once the contact is created.
-
Click Save.
Your new AI Agent appears in the list.
Step 2 — Connect the Create Contact tool with approval on
- Open the Tools tab of your AI Agent.
- Search for HubSpot Create Contact from the list of available tools and click Configure. Connect your HubSpot account when prompted.
- Before you save, tick Requires Human Approval Before Execution.
- Click Save.
Your AI Agent now has one tool, and that tool is locked behind your approval.
You can flip Requires Human Approval Before Execution at any time. For tools that write to real systems — CRMs, email, webhooks — keep it on until you're confident the AI Agent behaves the way you want.
Step 3 — Trigger an approval
-
Open the Chat tab of your AI Agent.
-
Type:
Add a new lead: Sarah Johnson, sarah@acme.io, Head of Ops at Acme Corp.
Your AI Agent thinks for a moment, decides to use HubSpot Create Contact — and then pauses. An approval card appears in the chat showing:
- The tool: HubSpot Create Contact.
- The input — the first name, last name, email, company, and job title your AI Agent inferred.
- Two buttons: Approve and Dismiss.
Notice:
- Your AI Agent has not written anything to HubSpot yet.
- You can see exactly what it plans to send — including the job title it inferred from "Head of Ops".
- The conversation is parked, waiting for you.
Step 4 — Approve it
Click Approve.
What happens:
- The button briefly shows Processing….
- HubSpot creates the contact.
- The card updates to an Approved badge.
- Your AI Agent continues and confirms the contact was created.
Go open HubSpot in another tab. The contact is there.
Step 5 — Dismiss one, with feedback
Let's prove the dismiss path works too.
-
Back in the chat, type:
Also add: John Doe, spam@spam.com, ACME.
-
Your AI Agent pauses again with a new approval card.
-
Click Dismiss. A feedback area appears with the placeholder "Optional: Why are you dismissing this tool?".
-
Type: "That email looks fake — please ask me for a real one before creating the contact."
-
Click Confirm Dismiss.
Your AI Agent reads your feedback and responds with something like:
I didn't create that contact because the email looked invalid. Could you share a verified email for John Doe?
Nothing was written to HubSpot. Your feedback changed your AI Agent's next move.
Dismiss feedback is short-term memory for this conversation. Your AI Agent uses it to adjust in the same chat — it is not saved as a permanent rule. For permanent behaviour, update the AI Agent's instructions.
What you've built
You now have an AI Agent that:
- Captures leads from natural-language messages.
- Pauses before every HubSpot write and shows you the exact payload.
- Adjusts its behaviour based on the feedback you give when dismissing.
This is the same pattern for any destructive tool: add it, tick Requires Human Approval Before Execution, done. The AI Agent does the work; you stay in control.
Next steps
- Add a read-only tool. Connect the Web Scraper to the same AI Agent (no approval needed — reads only). Now your AI Agent can research a company's website before asking you to create the contact.
- Understand the flow. Read How tool approval works to see what happens under the hood — including cascade and subagents.
- Pause to ask instead of pause to approve. Learn how the Ask User Questions tool lets your AI Agent get answers from you mid-conversation.