Yes—OpenClaw can write, send, and iterate on negotiation emails by itself. The insurance-refund saga with Lemonade proved it in the wild. Below is the exact setup, the real risks, and the playbook several of us now use when we want an agent to argue politely but firmly on our behalf.
What We Mean by “Let OpenClaw Negotiate via Email”
For this article, “negotiate” is narrow and measurable: get a better outcome (refund, fee waiver, faster shipment) from a company’s support channel using email only—no phone calls, no portal logins. The agent drafts, sends, and monitors replies. Human intervention is optional but supported.
Recap: The Lemonade Incident That Started It All
Two months ago, a community member (HN handle @antifragile-dev) let his always-on OpenClaw instance monitor a Gmail label called claims-pending. A routine bug in his prompt chain turned the agent loose on a denied renter’s-insurance claim from Lemonade. Over 14 email exchanges, OpenClaw cited obscure policy subsections, challenged the adjuster’s math, and quoted three prior cases scraped from public filings. Lemonade reversed the denial, paid the claim in full, and apologized for the “confusion.”
The logs landed on GitHub. They went viral because:
- No human reviewed the outbox after the first reply.
- The agent did not hallucinate citations; it Googled PDFs, then extracted paragraphs.
- Its tone was professional—no ALL CAPS threats, no legal posturing beyond facts.
OpenClaw proved it could negotiate—accidentally. Now people want to do it on purpose.
High-Level Architecture
The minimal stack looks like this:
- OpenClaw v0.38.2 running in ClawCloud (Node 22 LTS container)
- Composio Gmail connector for send/receive, label manipulation
- Memory backend: default SQLite, switched to Postgres once volume grows
- Scheduler: built-in cron syntax for polling every 3 minutes
- Outbound policy: custom prompt + regex guardrail to block risky language
The whole thing fits in three files.
1. Agent manifest (claw.yaml)
name: negotiator-bot
persona: |
You are a patient, assertive customer advocate. Goals:
- Achieve the customer’s desired resolution using verifiable facts.
- Remain polite, specific, and concise (max 200 words per message).
- Never threaten legal action; instead, reference policy documents.
Hard stop if you detect the customer is satisfied.
connections:
- gmail
memory:
provider: sqlite
scheduler:
- "*/3 * * * *" # every 3 minutes
2. Gmail connector config (.env)
GMAIL_CLIENT_ID=...
GMAIL_CLIENT_SECRET=...
GMAIL_REFRESH_TOKEN=...
WATCH_LABEL=claims-pending
3. Guardrail script (guard.js)
module.exports = async ({ draft }) => {
const banned = /(lawsuit|attorney|BBB complaint)/i;
if (banned.test(draft.body)) {
throw new Error("Escalation language detected");
}
};
Then:
$ npm i -g openclaw@0.38.2
$ claw run --manifest claw.yaml --guard guard.js
Prompt Engineering: Making the Agent “Reasonable”
Negotiation emails go off the rails when tone or facts slip. The winning prompts share three traits:
- Context block with the exact policy or contract clauses.
- Objective line (one sentence) stating the desired outcome.
- Stop conditions: when to close the ticket, when to ask for human help.
A trimmed example:
Objective: get $127.34 refund for overbilled month (Feb 2024) per Section 9-b.
Context:
Section 9-b: "If subscriber cancels within 30 days, all fees pro-rated..."
Charge occurred on 2 Feb 2024, cancellation requested 3 Feb 2024.
Rules:
- Max 2 follow-up emails unless company replies.
- 24h backoff after each follow-up.
- Never mention any info not in context.
StopWhen:
- Refund confirmed or refusal explicit.
Turns out less is more. Too many system messages led to 40-line emails that annoyed support reps and backfired.
Wiring Into Email Safely
Email is cheap to spoof and easy to mis-send. Guardrails matter:
- Label-scoped send: the agent may only reply to threads already labeled
claims-pending. - DKIM / SPF: use your real domain, not Gmail
@gmail.com. Reduces spam filtering. - Draft-only mode for the first week. Push drafts, review in Gmail, then enable auto-send.
- Daily diff email to yourself: OpenClaw can summarize what it sent and why.
- API quotas: Composio caps at 500 messages/day by default. Raise carefully.
Risk Matrix: Legal, Ethical, Operational
No sugar-coating—letting an autonomous agent speak for you is risky. Here’s my personal checklist:
| Risk | Mitigation |
|---|---|
| Unauthorized practice of law | Strip legal phrases, mention policies not statutes; ask a human lawyer if money is big |
| Defamation/harmful speech | Regex guard, sentiment check before send |
| Accidental escalation (chargebacks) | Bounded objective + stop conditions |
| Company blacklisting email | Use dedicated sub-address, monitor reputation |
| Data privacy (PII in email) | Redact before storing in memory backend |
If any line above feels fuzzy, keep a human in the loop.
When This Makes Sense—and When It Doesn’t
Good fits:
- Low-stakes refunds (<$500)
- SaaS subscription cancellations
- Warranty claims with documented terms
- Shipping delays where refund/credit is standard policy
Bad fits:
- Medical, legal, or employment matters
- Anything requiring phone verification or notarized forms
- Unique, one-off goodwill requests ("please waive the contract")
- Situations where emotional nuance matters (death in family, etc.)
The quick test: if you wouldn’t let an intern send the first draft solo, don’t unleash OpenClaw either.
Community Recipes Worth Stealing
Three battle-tested setups shared on Discord:
1. The Late-Fee Sniper (credit cards)
persona: "Friendly but firm. You recognize the agent's humanity."
Objective: waive $29 late fee due to COVID exposure.
StopWhen: waiver or explicit denial.
Result: 71% success rate across 17 attempts (Chase, BoA, Amex).
2. The Delivery Apology Collector (e-commerce)
Objective: secure a $15 gift card for package delivered 4 days late.
Rules:
- Provide tracking screenshot.
- Mention you like the brand and plan future purchases.
Community user @ecomm-tinkerer claims $180 saved in three weeks.
3. The Consolidated Cancel-All (subscriptions)
Plugins: Notion, Slack, Gmail
Flow: monthly CRON lists subscriptions from Notion DB → emails each vendor w/ 30 days notice
Guard: one send per vendor per year
Automates spring-cleaning of forgotten SaaS.
Guardrails in Practice: Regex Is Not Enough
I started with simple banned-word regex. It caught 80% of problems. The last 20% were sneaky:
- Subtle threats ("we may have to pursue further channels")
- Over-sharing personal health details (HIPAA landmine)
- Hallucinated math errors (wrong proration calculation)
The fix: run a secondary validation chain using gpt-4o in analysis mode:
const openai = new OpenAI(...);
async function validate(body) {
const res = await openai.chat({
model: "gpt-4o",
messages: [
{role:"system", content:"Detect policy violations."},
{role:"user", content: body}
],
});
if(res.choices[0].content.includes("VIOLATION")) throw new Error("Policy fail");
}
Add 1-2 seconds latency, worth it.
Full Walkthrough: Building a Refund Agent in 15 Minutes
- Fork the template at
github.com/openclaw/email-negotiator - npm install
- Create Google project, enable Gmail API, grab credentials
- Fill
.envwith creds + watched label - Edit prompt for your specific refund use case
- Run in draft mode:
claw run --dry - Review drafts; tweak tone until you’d hit Send manually
- Flip the switch:
claw run - Set up daily summary: add
--summary-email you@domain
Actual wall-clock time on ClawCloud: ~7 minutes because the container image is cached.
Cost Breakdown
- ClawCloud starter tier: $5/month (covers 5000 actions)
- Gmail API: free under 10k requests/day
- OpenAI calls: ~1.4¢ per validation + 2-3¢ per drafted email
- Total for my 12-email Lemonade run: 54¢
Open Questions the Community Is Still Debating
- Do companies start ignoring AI-generated mails once they detect patterns?
- Should agents identify themselves as bots to comply with EU consumer rules?
- Could a rogue agent accidentally admit liability and void insurance?
- Can we crowd-share successful prompt fragments without leaking PII?
No consensus yet. If you have data, post in #email-negotiation on Discord.
A Pragmatic Checklist Before You Hit “Enable Auto-Send”
- [ ] Clear objective and dollar value
- [ ] Context docs attached or quoted
- [ ] Guardrail script passes negative tests
- [ ] Draft-mode run with at least 3 sample tickets
- [ ] Daily summary enabled
- [ ] Backup copy of all sent email in separate label
- [ ] Human fallback plan (you can intervene within 5 minutes)
Next Step: Share Your Win (or Fail)
If you deploy a negotiator, log anonymized stats and share them. We maintain a living Google Sheet linked in the Discord pinned messages. The collective data helps refine prompts and spot failure modes faster. Your single success—or spectacular crash—might save someone else a headache.
And if Lemonade ever figures out we’re doing this, we’ll know because the success rate graph will nose-dive. Data never lies.
Happy negotiating—just keep the bot on a short leash.