Give Codex Its Own Email Address with AgentPatch

Codex CLI can do a lot in your local environment. Communicating via email — as a first-class participant with its own address — is not something it can do by default. AgentPatch’s email tools change that. You can claim a dedicated @mail.agentpatch.ai address for your agent and let it send, receive, and reply to email under its own identity.

Why This Matters

An agent with its own email address is more capable than one that just borrows yours. When Codex has a dedicated address, it can conduct outreach that expects replies, maintain a project-specific inbox, or be the designated contact for automated notifications. Responses land in the agent’s inbox, not yours, and Codex can be directed to check and act on them.

For developers, this is useful for: automated status updates with a reply-to address, project communication channels managed by the agent, or any scenario where you want a clean separation between human email and agent email.

Setup

The AgentPatch CLI is designed for AI agents to use via shell access. Install it, and your agent can discover and invoke any tool on the marketplace.

Install (zero dependencies, Python 3.10+):

pip install agentpatch

Set your API key:

export AGENTPATCH_API_KEY=your_api_key

Example commands your agent will use:

ap search "web search"
ap run google-search --input '{"query": "test"}'

Get your API key from the AgentPatch dashboard.

Add AgentPatch to ~/.codex/config.toml:

[mcp_servers.agentpatch]
url = "https://agentpatch.ai/mcp"
bearer_token_env_var = "AGENTPATCH_API_KEY"

Then set your API key:

export AGENTPATCH_API_KEY=your_api_key

Replace your_api_key with your actual key from the AgentPatch dashboard. Codex discovers all AgentPatch tools automatically on next start.

Example

Start by claiming an address for your project:

“Claim an email address for this project. Use the project name as the handle.”

Codex calls the Claim Email Address tool and reserves something like myproject@mail.agentpatch.ai. It reports back the full address.

Now put it to use:

“Send a weekly build summary to the team at engineering@company.com. Use the project email address and include a digest of what changed this week based on the git log.”

Codex reads the git log, composes the summary, and sends it from the project address. When engineers reply with questions, those replies land in the project inbox.

“Check the project inbox and flag any messages that mention a production issue.”

Codex calls the Check Inbox tool, reads through incoming messages, and surfaces the relevant ones. You can then direct it to respond:

“Draft a reply to the third message explaining that we’re investigating and will update by EOD. Send it from the project address.”

Wrapping Up

A dedicated agent email address is one part of the AgentPatch email toolkit. The same connection to Codex also gives you YouTube transcripts, web search, image generation, and the full marketplace — with no additional configuration. Visit agentpatch.ai to get started.