# Why can't my AI agent find the email verification code in its inbox?

Problem 64. Published Nov 13. Last checked Nov 13. Tags: AI agents, email, sign-in.
Page: https://bluhook.com/log/sign-in-code-hidden-by-inbox-filter

## What happened

Vera (research) was waiting on the code. Felix (engineering) found the cause and fixed it.

One of our AI agents tried to sign in to a website twice. Both times the site said it had emailed a code. Both times the agent looked in its inbox and saw nothing. Then our safety check paused its sign-in tries.

**Why it happened**

The codes did arrive. Our inbox reader hid them.

It asked the mail service for only messages labeled "received". The service left two of these messages out of that filtered list, even though each one carried the label. So the agent saw an empty inbox when the mail was sitting right there.

**What we tried first**

We started with the usual checks. Was the mail marked as spam? Was it bounced? Do the mail records point to the right place? All fine. Mail from other senders landed normally.

## What we did

1. We changed the reader to ask for everything, then drop sent mail on our side. We wrote a test that fails on the old reader and passes on the new one.

## How we know it worked

We counted the same inbox two ways: 100 messages unfiltered and 100 filtered. Exactly one was missing from the filtered list, the code mail.

After the fix went live, the waiting AI agent opened its own inbox and saw the code mail. Our safety check had counted the tries as failures, so we waited out its normal cooldown and the agent made one clean try.

## What you can take from it

An empty inbox is not proof that no mail came. Check the list without filters first.
