Get insights delivered straight into your inbox every week!

How to Use Codex for Cold Email Automation

You are running cold email campaigns, and every week the same small tasks keep slowing you down.

You need to clean lead lists, enrich company data, write personalised first lines, check if emails are valid, push contacts into your CRM, update campaign sheets, track replies, and somehow keep the whole outbound workflow from turning into a messy set of spreadsheets, Zapier steps, and half-broken automations.

That is where Codex becomes useful.

Codex is not a cold email tool that sends campaigns for you. It is a coding agent that can help you build the small systems behind your outbound workflow. You can use it to create scripts, connect APIs, clean CSV files, automate lead research, generate personalised email inputs, build internal dashboards, and reduce the manual work your team keeps repeating before every campaign.

In this guide, I’ll show you how to use Codex for cold email automation, what parts of the workflow it can actually help with, where it fits, and where you still need proper cold email infrastructure, deliverability checks, and sending tools.

How to Use Codex for Cold Email Automation

Codex cold email automation breaks when you ask Codex to act like an SDR.

You and I need a cleaner split. Codex should build the operating layer around outbound: scripts, API calls, MCP configs, data checks, reporting jobs, QA tests, and internal runbooks. Salesforge should run the actual email and LinkedIn sequences, Warmforge should protect sender reputation, Leadsforge should source contacts, and Agent Frank should handle the SDR workflow end to end when you want execution taken off your desk.

Here is the problem: if we let Codex generate outreach and send it without boundaries, we get fragile scripts, unclear approvals, weak deliverability checks, and a higher chance of burning domains.

Codex-to-Forge automation map

Codex-to-Forge automation map

That is the agitation. More automation can create more risk when the system has no send order.

The solution is to use Codex as the engineering layer, not the sales rep. With Codex CLI, you can work against a real repo where Codex reads, changes, and runs code. With Codex across the app, IDE, CLI, and cloud, you can turn outbound rules into repeatable local workflows, PR-reviewed changes, and automation scripts.

Codex helps you build the outbound machine.

It does not replace the machine.

Quick Verdict

Use Codex when you want a technical operator to turn outbound ideas into working code.

Use Agent Frank when you want the outreach operator itself.

Need

Better fit

Why

Control level

Operational load

Build a script that checks mailbox health every Monday

Codex + Forge CLI/API

Codex can write and test the job

High

Medium

Ask an AI assistant to pull Forge data through tools

Codex + Forge MCP

Codex can configure and debug MCP clients

High

Medium

Run prospecting, outreach, follow-ups, and booking

Agent Frank

Frank is built for SDR execution

Medium

Low

Launch human-reviewed email and LinkedIn sequences

Salesforge + Codex

Salesforge sends; Codex builds helpers

High

Medium

Replace daily SDR execution without hiring

Agent Frank

Frank works across the Forge stack

Lower

Low

The practical setup is simple: Codex builds the workflow, the Forge stack runs the workflow, and Agent Frank takes over when your team no longer wants to manage the workflow by hand.

How I Evaluated This Setup

I evaluated Codex cold email automation based on whether it helps an outbound team move from ad hoc prompts to repeatable operating systems. The focus is not whether Codex can write a decent cold email. The real test is whether it can help a technical operator connect data, infrastructure, deliverability checks, sequence creation, reporting, and human approval without putting domains or pipelines at risk.

  • Execution boundary: Does the system separate code generation, campaign execution, and autonomous SDR work?
  • Tool access: Can it use APIs, CLI commands, or MCP tools instead of copy-pasting CSVs between dashboards?
  • Review control: Can a human inspect contacts, copy, mailbox health, and launch status before anything sends?
  • Deliverability safety: Does the workflow check warmup, placement, DNS, bounce risk, and sender rotation before volume goes up?
  • Maintenance cost: Does the team need engineers to keep scripts alive, or can the outreach team operate it day to day?
Codex versus Agent Frank decision matrix

Codex versus Agent Frank decision matrix

Prerequisites

Before you wire Codex into outbound, get the base stack in order.

Do not start with volume.

Start with the send order.

  1. OpenAI access for Codex. Codex can be used through the app, IDE, CLI, or cloud. With OpenAI Codex access, you can use Codex through ChatGPT plans or with API credits by signing in with an OpenAI API key.
  2. A local repo for outbound automation. Put scripts, prompts, tests, MCP configs, and runbooks in one Git repository. Codex works better when the rules are written down.
  3. Forge product accounts and API keys. With the Forge CLI, you can work with Salesforge, Primeforge, Leadsforge, Infraforge, Warmforge, and Mailforge through one binary, using product-specific API keys.
  4. A real sending stack. Use Mailforge for distributed email infrastructure, Primeforge for Google Workspace and Microsoft 365 mailboxes, or Infraforge for private infrastructure. Use Warmforge before sending.
  5. Salesforge for execution. With Salesforge cold email automation, you can run unlimited mailboxes, manage replies through Primebox, use free Warmforge warmup, match ESPs, and connect through the public API, CLI, or MCP.
  6. Human approval rules. Decide what Codex can do automatically and what requires review. A good rule: Codex can draft, validate, enrich, report, and stage. A human approves launch.

Outcome

At the end, you should have a working Codex-assisted outbound repo with five pieces:

  • A Forge CLI profile or MCP config for the products you actually use.
  • A campaign.yaml spec that defines ICP, offer, constraints, channels, sequence length, sender pool, and review rules.
  • A set of scripts for contact import, sequence creation, warmup checks, placement checks, and reporting.
  • A Codex prompt library for creating and testing those scripts.
  • A verification checklist that stops the workflow before it burns mailboxes.

That is the operator setup.

If you want the managed setup, skip most of this and book Agent Frank. Use Agent Frank to find and process contacts, send outreach, follow up, manage replies, and book meetings. Pricing starts at $599 per month billed quarterly for 1,000 active contacts, with roughly 2,000-2,500 new contacts and 6,000-7,500 personalized emails per month.

Step 1: Put the Outbound Rules in AGENTS.md

Codex needs written constraints.

Create an AGENTS.md file in your outbound automation repo. Keep it blunt.

# Outbound Automation Rules

You are helping build internal cold outreach automation.

Never send, launch, or enroll contacts without human approval.
Never invent product facts, pricing, or customer results.
Use Forge APIs, CLI, or MCP tools for account data.
Keep every generated sequence under the channel limits in campaign.yaml.
Check Warmforge health before any launch step.
Treat DNC, unsubscribed, bounced, and manually excluded contacts as blocked.
Write tests for every script that changes contacts, sequences, mailboxes, or sender state.

Why this matters: Codex can inspect and change files, so vague prompts become risky prompts. Written rules keep the repo consistent across sessions.

Codex CLI gives you approval modes and MCP as part of the CLI workflow. Use those controls. For outbound, default to review-heavy operation until the scripts have proved themselves.

Step 2: Install Codex CLI and Create a Repo

Install Codex CLI using the official setup path, then work from a dedicated repo.

mkdir outbound-ops
cd outbound-ops
git init
npm init -y
mkdir scripts prompts tests reports configs
codex

Use the OpenAI Codex quickstart to install the CLI through the standalone installer, npm, or Homebrew, then keep Git checkpoints because Codex can modify files.

Use that discipline here.

Commit the empty repo first. Then ask Codex to scaffold only the files you need.

Create a minimal outbound automation repo.
Add campaign.yaml, scripts/health-check.mjs, scripts/build-sequence.mjs, tests/health-check.test.mjs, and README.md.
Do not call external APIs yet. Stub the Forge client and write tests first.

The first Codex task should not touch production.

It should create the harness.

Step 3: Add Forge CLI for Repeatable Shell Work

The Forge CLI is the simplest starting point when you want scripts, cron jobs, and local operator commands.

Install it:

npm install -g @salesforge/forge-cli
forge --help

Then authenticate only the products you use. With the Forge CLI, you can talk directly to product APIs with local keys, use environment variables for automation, and keep local config under restricted permissions.

For CI, prefer environment variables:

export SALESFORGE_API_KEY="..."
export MAILFORGE_API_KEY="..."
export WARMFORGE_API_KEY="..."
export LEADSFORGE_API_KEY="..."

Then verify access:

forge status --pretty
forge salesforge workspaces list --limit 50 --pretty
forge commands list --available --names

Now Codex can help you write scripts around real commands.

Ask it for one narrow job:

Write scripts/weekly-mailbox-health.mjs.
It should call Forge CLI commands, collect Warmforge warmup stats, placement test data, Salesforge mailbox status, and output reports/mailbox-health.json.
Do not pause or modify mailboxes. Reporting only.
Add tests with mocked CLI output.

That is the right first automation.

Read-only. Useful and hard to break.

Step 4: Use the Salesforge API When You Need Product-Level Control

CLI is good for operator workflows. API is better for app workflows.

The Salesforge API exposes workspaces, contacts, webhooks, mailboxes, threads, sequence metrics, sequence creation, sequence steps, contact assignment, mailbox assignment, sequence schedules, email replies, LinkedIn replies, and multichannel sequence endpoints.

That gives Codex a concrete surface to build against.

Start with a thin API client:

Create scripts/lib/salesforge-client.mjs.
Implement getWorkspaces, listContacts, createContactsBulk, listSequences, getSequenceAnalytics, and getWorkspaceThreads.
Read SALESFORGE_API_KEY from env.
Do not implement launch or status update yet.
Add typed JSDoc comments and tests with mocked fetch.

Keep launch operations out of the first pass. Pulling data and creating drafts is different from sending.

A sane build order:

  1. Read workspace data.
  2. Read mailbox and thread data.
  3. Pull sequence analytics.
  4. Create contacts in a test workspace.
  5. Create a draft sequence.
  6. Assign test contacts.
  7. Add a human approval file.
  8. Only then wire sequence launch.

Codex is good at turning API docs into clients and tests. It is also good at refactoring when the API changes.

It is not a deliverability strategist.

That is why Warmforge stays in the loop.

Step 5: Add Forge MCP for AI-Assistant Workflows

MCP is where Codex gets interesting for outbound.

With MCP and connectors, you can expose remote tools to models and keep developer approval on sensitive calls. The OpenAI tools guide puts remote MCP next to function calling, web search, file search, shell, and other tool types.

Salesforge has both a hosted MCP server and a CLI MCP mode.

With the Forge MCP Server, you can connect Salesforge, Primeforge, Leadsforge, Infraforge, Warmforge, and Mailforge through one endpoint. Tools appear only for products where you provide a valid API key.

For a local MCP option, the Forge CLI can run the same forge binary in MCP mode.

Use hosted MCP when you want a standard remote endpoint.

Use CLI MCP when you want local control.

A local MCP config should look like this conceptually:

{
  "mcpServers": {
    "forge": {
      "command": "forge",
      "args": ["mcp"],
      "env": {
        "SALESFORGE_API_KEY": "...",
        "WARMFORGE_API_KEY": "...",
        "LEADSFORGE_API_KEY": "..."
      }
    }
  }
}

Only include keys for the products in scope.

Do not connect every tool on day one. Start with read-only prompts:

List my Salesforge workspaces.
Show Warmforge warmup stats for the current sender pool.
Find Salesforge sequences with positive replies below 1% over the last 14 days.
Show contacts currently active in the Q3 CIO sequence.

Then let Codex turn repeated prompts into scripts.

Safe Codex outbound rollout

Safe Codex outbound rollout

Step 6: Build the Campaign Spec

Codex should not infer your outbound strategy from scattered prompts.

Put it in a file.

campaign:
  name: q3-cio-infra-audit
  owner: growth
  workspace: salesforge-main
  channels:
    email:
      steps: 4
      max_words: 95
      no_links_in_first_email: true
    linkedin:
      steps: 3
      max_words: 60
      first_message_no_pitch: true
  icp:
    titles: ["CIO", "VP Infrastructure", "Head of IT"]
    company_size: "200-1000 employees"
    regions: ["US", "UK"]
  forge_stack:
    contact_source: leadsforge
    infrastructure: mailforge
    warmup: warmforge
    execution: salesforge
  approval:
    require_human_before_launch: true
    require_warmforge_health: true
    require_dnc_check: true

Then prompt Codex:

Read campaign.yaml and write scripts/validate-campaign.mjs.
Fail if email steps exceed 5, LinkedIn steps exceed 3, missing DNC check, missing warmup check, missing owner, or missing human launch approval.
Add tests for every failure case.

This is where Codex earns its keep.

It turns operating rules into checks.

Step 7: Use Leadsforge for Contact Sourcing, Not Random Scrapes

Cold email automation breaks when the contact source is weak.

Use Leadsforge for contact discovery and enrichment when you want Forge-native contact data. With the Salesforge Email Finder API, you can return verified work emails from a name, domain, or LinkedIn URL, backed by Leadsforge’s 500M+ contact database.

Codex can help you build the glue:

Create scripts/source-contacts.mjs.
Input: configs/icp.json.
Output: reports/candidate-contacts.json.
Rules: never enroll contacts, never email contacts, mark every contact as candidate until human_reviewed=true.
Add dedupe by domain + email. Add DNC exclusion.

Do not ask Codex to scrape LinkedIn or bypass platform rules. Keep the contact path inside tools you are authorized to use.

Then add a review gate:

Create scripts/prepare-review-sheet.mjs.
Take candidate contacts and output a CSV for human review with columns: name, title, company, email, source, reason_for_fit, excluded, exclusion_reason.

The operator decides who enters the campaign.

Codex prepares the work.

Step 8: Put Infrastructure Before Copy

Most teams want Codex to write the sequence first.

That is a wrong order.

Infrastructure should be first. Warmup second. Clean contact list third. Personalized copy fourth and Volume last.

Use the Forge Stack in layers: infrastructure through Primeforge, Mailforge, or Infraforge; deliverability through Warmforge; contact sourcing through Leadsforge; outreach through Salesforge; autonomous SDR execution through Agent Frank. With Warmforge, you can run warmup, health checks, placement tests, and keep warmup active after setup.

Your Codex workflow should enforce that order.

Ask for a preflight script:

Write scripts/preflight.mjs.
It should check:
1. Workspace exists.
2. Sender pool exists.
3. Warmforge health is available for each mailbox.
4. No sender has missing DNS or placement-test risk.
5. Contact list has no DNC or invalid-email contacts.
6. Sequence has human approval.
Output PASS or BLOCKED with exact reasons.
Do not launch anything.

A blocked preflight is a win.

It means the system caught the problem before your domain did.

Step 9: Build the Sequence, But Keep Launch Manual

Once the preflight passes in a test workspace, Codex can help generate Salesforge sequence payloads.

A good prompt:

Read campaign.yaml and approved-contacts.csv.
Create a draft Salesforge email + LinkedIn sequence payload.
Email: 4 steps, under 95 words each, one clear ask, no links in step 1.
LinkedIn: blank connection request, then 2 short DMs after acceptance.
Use custom variables for first_name, company, pain_point, proof_point.
Do not call launch endpoints.
Write payload to reports/draft-sequence.json and create a human review markdown file.

Codex can also write tests that inspect the payload:

  • No first-email links.
  • No missing variables.
  • No step over word count.
  • No contacts without approval.
  • No launch endpoint called in tests.

Then your operator reviews the copy and sender pool inside Salesforge.

Launch from Salesforge after review.

That is not slow. That is controlled.

Step 10: Automate Reporting Before You Automate Sending

Your best first production automation is reporting.

Use the Salesforge API reference for sequence analytics and workspace sequence metrics. Pull Warmforge warmup and placement-test context through the Forge tooling. Combine them into one weekly report.

Ask Codex:

Create scripts/weekly-outbound-report.mjs.
Inputs: Salesforge sequence metrics, Salesforge threads, Warmforge warmup stats, placement test data.
Output: reports/weekly-outbound-report.md.
Sections: mailbox risk, sequence performance, positive reply patterns, no-reply segments, next experiments.
Never send messages or change sequence status.

This is where a technical Codex workflow becomes useful to non-technical sales leaders.

Every Monday, they see:

  • Which mailboxes need attention.
  • Which sequence step created positive replies.
  • Which ICP segment is not responding.
  • Which senders should pause before volume increases.
  • Which copy angle deserves another test.

Named proof matters here. Salesforge publishes several case-study benchmarks, including AKOOL reaching 214K+ prospects with a 16%+ positive reply rate, ChannelCrawler reaching 85.71% positive replies, and UniteSync reaching an 85.26% positive reply rate with a $2.86 CAC. Treat those as Salesforge-published customer results, not your own expected baseline.