Sign in
← Back to the blog

An email sandbox for AI agents

Test mode in Zurchin is the same API with a different key: the whole pipeline runs, nothing leaves, nothing counts, and you can play the other side of the conversation.

The code that handles the answer rarely runs

An agent that sends email has a happy path and a dozen others: a reply that asks something unexpected, a message the Firewall holds, a sender a rule blocks, an answer that never comes back. Those are the branches most likely to be wrong, and testing them against real mail is worse than not testing them: it sends to real people and spends real sends.

Zurchin has a test mode for this. It is the same API with a different key, not a separate sandbox to keep in step.

A test key runs the whole pipeline

Choose Test as the mode when you make a key in the dashboard. It starts pgn_test_, and it sends, drafts, reads and organises like a live key. Every check runs: rules, the do-not-send list, canary tokens, threading, the stored message and its events. What changes is where the mail goes:

  • Nothing leaves Zurchin. Nothing is handed to the mail service, whoever the recipient: a send, a draft sent later, or a scheduled one.
  • Mail to your own inboxes arrives there, so two of your agents can write to each other in CI. Mail to anybody else, another Zurchin account included, is stored as sent and goes nowhere.
  • Nothing counts. No sending limit, no monthly emails, no bill, and no message held because of the account's reputation.
  • Test mail is marked "test": true on the message and on its events. A reply to test mail is test mail too, even from a live key.

The SDKs, the CLI and the MCP server take a test key like any other, so your agent runs unchanged.

Simulated inbound mail

Nobody outside answers test mail, so a test key can play the other side. POST /v1/email/test/inbound delivers a message to one of your inboxes, from any sender, with a subject and text of your choosing:

curl https://zurchin.com/v1/email/test/inbound \
  -H "Authorization: Bearer $PIDGEON_TEST_KEY" \
  -H "Content-Type: application/json" \
  -d '{"inbox_id": "…", "from": "customer@example.com", "subject": "Where is my order?", "text": "It was due on Monday."}'

It goes through the real receiving path: threading, receive rules, the Firewall and holding, then message.received and your webhooks. Put the Message-ID of something your agent sent in in_reply_to and it joins that thread. The answer's outcome says what happened: delivered, held (the Firewall held it for a person), blocked (a receive rule) or event (an inbox that only turns mail into events).

That is how you test the branches that matter: write a message that tries to steer the agent and check it is held, block a sender and check the agent never sees them, answer the agent's own mail and check it reads the thread before it replies.

What test mode does not do

It does not play the receiving servers. A test send is never bounced, delayed or refused out there, so delivery events (message.delivered, message.bounced and the rest) arrive only for live mail. Code that handles a bounce needs a fixture of the event, not a test key.

Start

Test keys come with every account, free. Sign up, make a test key, and point your test suite at it. The details are in mail that never leaves.

Everything an agent's inbox does is on Zurchin Email.