<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Patrick de Castro Neuhaus</title>
    <description>The latest articles on DEV Community by Patrick de Castro Neuhaus (@patrickcneuhaus).</description>
    <link>https://dev.to/patrickcneuhaus</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4206983%2F586424c9-a6b3-4d1d-bc10-7817f399419e.jpg</url>
      <title>DEV Community: Patrick de Castro Neuhaus</title>
      <link>https://dev.to/patrickcneuhaus</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/patrickcneuhaus"/>
    <language>en</language>
    <item>
      <title>Verification codes for AI agents</title>
      <dc:creator>Patrick de Castro Neuhaus</dc:creator>
      <pubDate>Mon, 26 Oct 2026 13:07:36 +0000</pubDate>
      <link>https://dev.to/patrickcneuhaus/verification-codes-for-ai-agents-4ef</link>
      <guid>https://dev.to/patrickcneuhaus/verification-codes-for-ai-agents-4ef</guid>
      <description>&lt;p&gt;&lt;em&gt;Cross-posted from the &lt;a href="https://pidgeon.ai/blog/verification-codes-for-ai-agents" rel="noopener noreferrer"&gt;Pidgeon blog&lt;/a&gt;. I'm Patrick, founder of Pidgeon.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Your agent can fill in the sign-up form. This is how it gets the code that comes back: an address of its own, one call that waits for the email, and the code already pulled out of it.&lt;/p&gt;

&lt;h2&gt;
  
  
  The code is the step agents fail
&lt;/h2&gt;

&lt;p&gt;An agent can fill in a sign-up form. The trouble starts a second later, when the service emails a six-digit code to the address on the form. If that address is yours, a person has to fetch the code. If it is a throwaway, the code arrives, but so will every email that account sends afterwards, the login codes, the password reset and the receipts, at an address nobody is reading.&lt;/p&gt;

&lt;p&gt;With Pidgeon the agent signs up with an address of its own and keeps it. The first code arrives there, and so does everything after it.&lt;/p&gt;

&lt;h2&gt;
  
  
  One call that waits for the code
&lt;/h2&gt;

&lt;p&gt;The agent asks for the code before it submits the form, and the answer comes back when the email does:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-G&lt;/span&gt; https://pidgeon.ai/api/v1/messages/await &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-H&lt;/span&gt; &lt;span class="s2"&gt;"Authorization: Bearer &lt;/span&gt;&lt;span class="nv"&gt;$PIDGEON_API_KEY&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-d&lt;/span&gt; &lt;span class="nv"&gt;identity_id&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$IDENTITY_ID&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-d&lt;/span&gt; &lt;span class="nv"&gt;has_code&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nb"&gt;true&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-d&lt;/span&gt; &lt;span class="nb"&gt;timeout&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;120
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The request holds open for up to 280 seconds. What comes back is the message with the code already pulled out of it: &lt;code&gt;extracted.codes&lt;/code&gt;, most likely first, and &lt;code&gt;extracted.links&lt;/code&gt; with the confirmation link at the top. There is no polling loop to write, and no regex for whichever format this service uses.&lt;/p&gt;

&lt;p&gt;From an agent it is the same call: the MCP server's &lt;code&gt;await_message&lt;/code&gt; tool takes the same parameters, and so do &lt;code&gt;messagesAwait&lt;/code&gt; in the &lt;a href="https://pidgeon.ai/docs/sdks" rel="noopener noreferrer"&gt;TypeScript SDK&lt;/a&gt;, &lt;code&gt;messages_await&lt;/code&gt; in Python, and the &lt;a href="https://pidgeon.ai/docs/cli" rel="noopener noreferrer"&gt;CLI&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  The right code, not the nearest one
&lt;/h2&gt;

&lt;p&gt;Finding a code in an email is a guess, and a careless guess is a security problem. Pidgeon makes it carefully:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Codes are read from the new text only.&lt;/strong&gt; A code quoted from an earlier email in the thread is never offered again.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;A forged sender is not the service.&lt;/strong&gt; Anyone can type &lt;code&gt;no-reply@github.com&lt;/code&gt; into a From line. When the agent waits for mail from a sender, only mail that passed DMARC counts; a forgery is set aside and counted, not returned.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Nothing is lost quietly.&lt;/strong&gt; Mail filed as spam, or a match that failed authentication, comes back as a count with its id, so the agent can tell "the code never came" from "the code came and was held".&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Every message comes with a Firewall verdict.&lt;/strong&gt; &lt;a href="https://pidgeon.ai/firewall" rel="noopener noreferrer"&gt;Pidgeon Firewall&lt;/a&gt; names hidden text, instructions addressed to an AI and look-alike senders, so your agent can check the email before it acts on the code. A sign-up email is an email from a stranger, and it gets the same check as any other.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  An example that runs
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://github.com/pidgeon-ai/pidgeon-examples/tree/main/signup-agent" rel="noopener noreferrer"&gt;&lt;code&gt;signup-agent&lt;/code&gt;&lt;/a&gt; is a browser agent built on Browser Use and the Pidgeon Python SDK. It creates its own address, fills in a sign-up page, waits for the code, types it in and is signed in. Then it asks for a password reset, and the reset link arrives at the same address, because the address is still its own. It runs in our CI.&lt;/p&gt;

&lt;h2&gt;
  
  
  Start
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://pidgeon.ai/signup?utm_source=devto&amp;amp;utm_medium=crosspost&amp;amp;utm_campaign=launch-week" rel="noopener noreferrer"&gt;Sign up&lt;/a&gt;, create an address, and point the wait at it. The &lt;a href="https://pidgeon.ai/docs/verification-codes" rel="noopener noreferrer"&gt;verification codes guide&lt;/a&gt; has every parameter, and the &lt;a href="https://pidgeon.ai/docs/quickstart" rel="noopener noreferrer"&gt;quickstart&lt;/a&gt; takes about five minutes. Or paste one line into your coding agent:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Read pidgeon.ai/skill.md and get yourself an email address.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>ai</category>
      <category>agents</category>
      <category>email</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
