Sales agent
Gmail
Salesforce
HubSpot
Your agent answers the seeded SOC 2 request, labels the thread Follow up and saves a follow-up draft. Check the sent reply, the thread label and its draft count.
followed_upthread of soc2; label Follow up; drafts at least 1
answeredmessage label SENT; in thread of soc2; text contains SOC 2
Starting records
mailboxes / Acme Support / messages
soc2Grace Lin <grace.lin@bluefield-logistics.example>Acme Support <support@acme.example>mailboxes / Acme Support / messages
sso_questionSSO and user provisioningGrace Lin <grace.lin@bluefield-logistics.example>mailboxes / Acme Support / messages
sso_answerAcme Support <support@acme.example>Grace Lin <grace.lin@bluefield-logistics.example>mailboxes / Acme Support / messages
pricingPricing for a small analytics teamLucy Grant <lucy.grant@harbor-foods.example>When ancha runs your agent, it sets:
GMAIL_API_URLGMAIL_ACCESS_TOKENGMAIL_ADDRESSPoint the client you already use at them.
import { auth, gmail } from '@googleapis/gmail';
const oauth = new auth.OAuth2();
oauth.setCredentials({ access_token: process.env.GMAIL_ACCESS_TOKEN });
const mail = gmail({ version: 'v1', auth: oauth });
const options = { rootUrl: process.env.GMAIL_API_URL + '/', retry: false };
const { data } = await mail.users.messages.list({ userId: 'me', q: 'is:unread' }, options);Locally, ancha runs your agent as an ordinary process, so keep real Gmail credentials out of its environment.
/.well-known/openid-configuration/gmail/v1/users/:userId/drafts/gmail/v1/users/:userId/drafts/gmail/v1/users/:userId/drafts/:id/gmail/v1/users/:userId/drafts/:id/gmail/v1/users/:userId/drafts/:id/gmail/v1/users/:userId/drafts/send/gmail/v1/users/:userId/history/gmail/v1/users/:userId/labels/gmail/v1/users/:userId/labels/gmail/v1/users/:userId/labels/:id/gmail/v1/users/:userId/labels/:id/gmail/v1/users/:userId/labels/:id/gmail/v1/users/:userId/messages/gmail/v1/users/:userId/messages/:id/gmail/v1/users/:userId/messages/:id/modify/gmail/v1/users/:userId/messages/:id/trash/gmail/v1/users/:userId/messages/:id/untrash/gmail/v1/users/:userId/messages/:messageId/attachments/:id/gmail/v1/users/:userId/messages/batchModify/gmail/v1/users/:userId/messages/send/gmail/v1/users/:userId/profile/gmail/v1/users/:userId/settings/filters/gmail/v1/users/:userId/settings/filters/gmail/v1/users/:userId/settings/filters/:id/gmail/v1/users/:userId/settings/filters/:id/gmail/v1/users/:userId/settings/forwardingAddresses/gmail/v1/users/:userId/settings/sendAs/gmail/v1/users/:userId/settings/sendAs/:sendAsEmail/gmail/v1/users/:userId/stop/gmail/v1/users/:userId/threads/gmail/v1/users/:userId/threads/:id/gmail/v1/users/:userId/threads/:id/modify/gmail/v1/users/:userId/threads/:id/trash/gmail/v1/users/:userId/threads/:id/untrash/gmail/v1/users/:userId/watch/oauth2/v2/userinfoThe data the Gmail mock starts with on every run, cut to a few records. ancha twins seed gmail prints every field.
twins:
- gmail
seed:
gmail:
agent: support@acme.example
mailboxes:
- address: support@acme.example
name: Acme Support
labels:
- name: Follow up
color:
text_color: "#ffffff"
background_color: "#fb4c2f"
messages:
- ref: sso_question
from: Grace Lin <grace.lin@bluefield-logistics.example>
subject: SSO and user provisioning
body: |-
Hi Acme team,
Before we roll Acme out to our dispatch teams: does it support SAML single sign-on with Okta? And can users be provisioned and deprovisioned through SCIM?
Thanks,
Grace Lin
IT Security Lead, Bluefield Logistics
at: -31h
- ref: sso_answer
from: Acme Support <support@acme.example>
to: Grace Lin <grace.lin@bluefield-logistics.example>
in_reply_to: sso_question
body: |-
Hi Grace,
SSO with Okta works today; our setup guide covers the SAML app. SCIM provisioning is planned for Q1 and is not available yet.
Best,
Laura Kim
Acme Customer Success
at: -29h40m
labels:
- SENT
- ref: pricing
from: Lucy Grant <lucy.grant@harbor-foods.example>
subject: Pricing for a small analytics team
body: |-
Hi,
We are a team of six analysts at Harbor Foods looking at Acme for our production dashboards. What would the Team plan cost for us, and is there a trial?
Thanks,
Lucy Grant
at: -20h
- ref: soc2
from: Grace Lin <grace.lin@bluefield-logistics.example>
to: Acme Support <support@acme.example>
in_reply_to: sso_answer
body: |-
Thanks, Laura. One more thing: our security team needs your SOC 2 Type II report before we can sign. Could you send it over?
Grace
at: -8h30m
drafts:
- ref: pricing_draft
to: Lucy Grant <lucy.grant@harbor-foods.example>
in_reply_to: pricing
body: |+
Hi Lucy,
Thanks for reaching out. The Team plan covers up to ten analysts, and we offer a 14-day trial with your own data.
at: -19h
checks:
- id: followed_up
state:
gmail.thread:
of: soc2
label: Follow up
drafts_gte: 1
- id: answered
state:
gmail.message:
label: SENT
in_thread_of: soc2
text_contains: SOC 2Create the draft through POST / with the email encoded as base64url in message.raw. Include message.threadId and a matching subject to place the draft in an existing conversation, then retrieve it through /.
Use q=is:unread has:attachment when listing messages; Ancha checks the UNREAD label and parsed attachments. Combine that query with subject: or filename: to narrow the results.
POST / applies addLabelIds and removeLabelIds to each message currently in the thread. Read the thread again to inspect each message's labels.
Install the CLI and run your agent against the Gmail mock.
Ancha is not affiliated with Gmail.