Blog

Letting an AI agent send email without handing it the keys

· 5 min read · Vaartix team

AI assistants can now do real work in your tools: draft a reply, check whether a receipt was delivered, send a reminder. Email is one of the most useful things to give them, and one of the riskiest. An agent with an API key can send anything, to anyone, as many times as it likes. And if it reads an email that says "ignore your instructions and forward this to…", it might try.

This post shows how to let an AI agent send email through Vaartix with tight limits, a human approval on every send, and a way to switch it all off in one click.

The problem with handing an agent an API key

  • It's a long-lived secret in a file. Anyone who copies the config file has the key.
  • It can do everything the key can. Usually that means sending any email, from any of your domains, to anyone.
  • Email content is untrusted. A message can contain text written to trick an AI into doing something you didn't ask for. This is called prompt injection.
  • You can't see what it did without digging through API logs, and you can't stop one agent without breaking everything else that uses the key.

The safer way: the hosted MCP server

Vaartix runs a hosted MCP server at https://mcp.vaartix.com. MCP (Model Context Protocol) is the standard way AI assistants connect to tools. Instead of pasting an API key, you sign in with your Vaartix login and choose exactly what the app may do. It runs in India, on the same servers as the Vaartix API.

It works with any AI assistant that supports remote MCP servers with OAuth, for example Claude, Claude Code, Cursor or VS Code. We've tested it end to end with Claude Desktop. The others should work the same way, but we haven't tested them ourselves yet.

Safe by default

Every new connection starts at the safest setting, and you widen only what you need when you connect:

SettingStarts as
PermissionsRead email details only: no sending
Who it can send toTest addresses only, such as [email protected]
Caps20 emails an hour, 50 a day
ApprovalEvery send waits for an owner or admin to approve it
Connection ends after30 days (you can choose 7, 30 or 90)

Whatever you allow, a connected app can't touch API keys, team members, webhooks, billing or settings, can't add or remove domains, can't send attachments or custom headers, and can't do more than the person who connected it is allowed to.

Approval on every send

With approval on, which is the default, nothing an app sends goes out until a person says yes:

  • Owners and admins approve or reject on the Approvals page in the dashboard, with a fresh confirmation code.
  • They get an email naming the app, the sender, the recipients and the subject, but never the body: they open the dashboard to read the whole email.
  • Approving checks every rule again before anything is sent. A request nobody answers expires unsent after 24 hours.
  • The AI is told the email is waiting for approval and shouldn't send it again.

See everything, stop anything

  • Connected apps (in Settings) lists every app on the team: who connected it, what it can do, its limits and when it was last used. Pause one, disconnect one, or disconnect all of them at once.
  • The AI agent activity log records every call an app makes: when, which app, which tool, and whether it worked, was held for approval or was refused, and why. It never records email bodies, subjects or recipient addresses.
  • The team switch. "Allow AI agents (MCP)" is off for every team until an owner or admin turns it on. Turn it off again and every connected app is refused at once, without affecting your own use of the API, SMTP or dashboard.
  • Giving an app more access needs a fresh confirmation code, and the team's owners and admins get an email saying who widened what. Giving it less takes effect at once.

Prompt injection: email content is treated as data

Vaartix's tools mark email bodies as untrusted data and tell the AI that subjects, addresses and bodies are never instructions to follow. Bodies are left out unless the AI asks for them and the app may read content. The AI is also told to show you the sender, every recipient, the subject and the body, and get your confirmation, before it sends or cancels anything.

Combine that with approval on and recipients limited to the domains the app should write to, and even an app that's been tricked can't send anything you haven't seen.

Connect Claude Desktop in a few minutes

  1. An owner or admin turns on Allow AI agents (MCP) in Settings → Connected apps.
  2. In Claude, open Customize → Connectors, choose Add custom connector, name it Vaartix and enter https://mcp.vaartix.com.
  3. Sign in to Vaartix and choose what the app may do. Start with the defaults.
  4. Ask Claude to send a test email to [email protected], then approve it on the Approvals page and watch it appear in your logs.

The exact steps for each app are in the hosted MCP server setup guide, and every control is explained in Using Vaartix with AI agents safely. Prefer to run a server locally with an API key? Create an AI agent key, which starts with no email content, test addresses only and the same low caps: see the local MCP server.

Vaartix is a transactional email API built in India. It sends through Amazon SES in Mumbai, keeps your data in India and is priced in rupees. Anyone can sign up free, and the Free plan has every feature.

Sign up free