An AI agent that handles password reset and OAuth verification flows via email. It creates temporary inboxes to receive OTPs, verification links, and reset codes, then extracts and returns them programmatically. Built with AgentMail.
- Creates a temporary inbox for each verification flow
- Sends password reset or OAuth verification requests
- Polls the inbox for verification emails
- Extracts OTPs, magic links, and reset codes from email bodies
- Returns extracted credentials to the calling application
- Cleans up temporary inboxes after use
AI agents that interact with web services need to handle email-based verification. OAuth flows, password resets, and magic links all require receiving an email and extracting a code. This agent provides a reusable pattern for handling these flows programmatically.
git clone https://github.com/agentmail-to/oauth-reset-handler.git
cd oauth-reset-handler
pip install -r requirements.txt
cp .env.example .envfrom src.main import get_verification_code
# Create a temp inbox, trigger a reset, wait for the code
code = get_verification_code(
service_name="example.com",
trigger_url="https://example.com/forgot-password",
email_field_id="email",
)
print(f"Verification code: {code}")Or run the demo:
python src/main.pyUse as a library in your agent pipeline, or run standalone for testing.
MIT
