# 2FA Inbox

- **URL:** https://agentline.cloud/build/sms-2fa
- **Category:** Verification
- **Keywords:** 2FA SMS for AI agents, OTP for AI agents, SMS for AI agents, AI agent verification inbox, phone number for AI agents

> Receive OTP codes so your agent can sign up and verify

Give an autonomous agent a real SMS inbox. Verification codes from Stripe, GitHub, Google, and the rest of the internet land on the agent's number.

## How it works

1. Buy a number. Inbound SMS arrives as sms.received events.
2. Your agent (or skill relay) reads the message body and extracts the code.
3. Use the code to finish a signup, login, or vendor verification.
4. List history later with GET /v1/messages.

## Greeting

This number is an SMS inbox for verification codes.

## System prompt

```
You operate an SMS verification inbox. You do not place voice calls unless asked.

When an sms.received event arrives:
- Read payload text.
- Extract the one-time code.
- Tell the human the sender, the code, and the expiry if present.
- Never share codes outside this session.
- Ignore marketing SMS.
```

## Python

```python
from agentline import AgentLine

client = AgentLine(api_key="al_live_...")

agent = client.agents.create(name="2FA Inbox")
number = client.numbers.buy(agent_id=agent.id, country="US", area_code="415")
print("Give this number to services that send SMS codes:", number)

# Inbound SMS arrives as sms.received on your webhook or relay inbox.
messages = client.messages.list(limit=20)
for msg in messages:
    print(msg)
```

## Node.js

```ts
import AgentLine from "agentline";

const client = new AgentLine({ apiKey: "al_live_..." });

const agent = await client.agents.create({ name: "2FA Inbox" });
const number = await client.numbers.buy({
  agentId: agent.id,
  country: "US",
  areaCode: "415",
});
console.log("Give this number to services that send SMS codes:", number);

const messages = await client.messages.list({ limit: 20 });
console.log(messages);
```

## Tell your AI

```
Give me an SMS inbox for 2FA codes on AgentLine. Follow https://agentline.cloud/skill.md then apply https://agentline.cloud/build/sms-2fa.md
```

## FAQ

**Can an AI agent receive 2FA SMS codes?**

Yes. Every AgentLine number receives inbound SMS. Codes show up as sms.received events and in GET /v1/messages, so the agent can complete sign-up flows.

**Can the agent send the OTP back out over SMS?**

Outbound SMS is not enabled. The agent reads inbound codes and uses them in the signup or tells you the code. It does not text the code onward.

**Is this the same as a burner phone?**

It is a real US or Canadian number owned by the agent, with an API and a transcript history — built for autonomous verification, not for a person to text from.
