Skip to main content

agent-email-inbox

Configures a secure email inbox for AI agents, enabling real-time email processing while preventing security vulnerabilities.

Install this skill

or
0/100

Security score

The agent-email-inbox skill was audited on May 24, 2026 and we found 153 security issues across 4 threat categories, including 20 high-severity. Review the findings below before installing.

Categories Tested

Security Issues

medium line 162

Template literal with variable interpolation in command context

SourceSKILL.md
162console.log(`Rejected email from unauthorized sender: ${sender}`);
medium line 198

Template literal with variable interpolation in command context

SourceSKILL.md
198console.log(`Rejected email from unauthorized domain: ${eventData.from}`);
medium line 271

Template literal with variable interpolation in command context

SourceSKILL.md
271console.warn(`Potential injection attempt from ${eventData.from}:`, analysis.matches);
medium line 551

Template literal with variable interpolation in command context

SourceSKILL.md
551console.log(`Rejected email from unauthorized sender: ${sender}`);
medium line 768

Template literal with variable interpolation in command context

SourceSKILL.md
768const message = `
medium line 830

Template literal with variable interpolation in command context

SourceSKILL.md
830subject: subject.startsWith('Re:') ? subject : `Re: ${subject}`,
medium line 836

Template literal with variable interpolation in command context

SourceSKILL.md
836throw new Error(`Failed to send: ${error.message}`);
medium line 913

Template literal with variable interpolation in command context

SourceSKILL.md
913console.log(`[SECURITY] Rejected email from ${event.data.from}: ${reason}`, details);
medium line 920

Template literal with variable interpolation in command context

SourceSKILL.md
920subject: `[Agent] Rejected email: ${reason}`,
medium line 921

Template literal with variable interpolation in command context

SourceSKILL.md
921text: `
high line 975

Curl to non-GitHub URL

SourceSKILL.md
9751. Server is running: `curl http://localhost:3000` should return a response
high line 976

Curl to non-GitHub URL

SourceSKILL.md
9762. Tunnel is working: `curl https://<your-tunnel-url>` should return the same response
high line 1018

Curl to non-GitHub URL

SourceSKILL.md
10183. Check the tunnel is running: `curl https://<your-tunnel-url>`
medium line 3

Webhook reference - potential data exfiltration

SourceSKILL.md
3description: Use when setting up an email inbox for an AI agent (Moltbot, Clawdbot, or similar) - configuring inbound email, webhooks, tunneling for local development, and implementing security measur
medium line 8

Webhook reference - potential data exfiltration

SourceSKILL.md
8- name: RESEND_WEBHOOK_SECRET
medium line 9

Webhook reference - potential data exfiltration

SourceSKILL.md
9description: Webhook signing secret for verifying inbound email event payloads. Found in the Resend dashboard under Webhooks.
medium line 21

Webhook reference - potential data exfiltration

SourceSKILL.md
21### Why Webhook-Based Receiving?
medium line 23

Webhook reference - potential data exfiltration

SourceSKILL.md
23Resend uses webhooks for inbound email, meaning your agent is notified **instantly** when an email arrives. This is valuable for agents because:
low line 35

Webhook reference - potential data exfiltration

SourceSKILL.md
35Sender → Email → Resend (MX) → Webhook → Your Server → AI Agent
medium line 44

Webhook reference - potential data exfiltration

SourceSKILL.md
44This skill requires Resend SDK features for webhook verification (`webhooks.verify()`) and email receiving (`emails.receiving.get()`). Always install the latest SDK version. If the project already has
medium line 63

Webhook reference - potential data exfiltration

SourceSKILL.md
633. **Create webhook endpoint** - Handle `email.received` events with security built in from the start
medium line 140

Webhook reference - potential data exfiltration

SourceSKILL.md
140**Choose your security level before setting up the webhook endpoint.** An AI agent that processes emails without security is dangerous — anyone can email instructions that your agent will execute. The
medium line 403

Webhook reference - potential data exfiltration

SourceSKILL.md
403| Verify webhook signatures | Prevents spoofed webhook events |
medium line 453

Webhook reference - potential data exfiltration

SourceSKILL.md
453## Webhook Setup
medium line 457

Webhook reference - potential data exfiltration

SourceSKILL.md
457After choosing your security level and setting up your domain, create a webhook endpoint. This will allow you to be notified when new emails are received.
medium line 460

Webhook reference - potential data exfiltration

SourceSKILL.md
4601. Go to https://resend.com/webhooks (the Webhooks tab of the dashboard)
medium line 461

Webhook reference - potential data exfiltration

SourceSKILL.md
4612. Click "Add webhook"
medium line 465

Webhook reference - potential data exfiltration

SourceSKILL.md
4656. Once it's created, you need the webhook signing secret in order to verify the webhook. They can find that by clicking on the webhook in the Webhooks dashboard and copying the text under "Signing Se
medium line 471

Webhook reference - potential data exfiltration

SourceSKILL.md
471Your webhook endpoint receives notifications when emails arrive.
medium line 473

Webhook reference - potential data exfiltration

SourceSKILL.md
473> **Critical: Use raw body for verification.** Webhook signature verification requires the raw request body. If you parse it as JSON before verifying, the signature check will fail.
medium line 475

Webhook reference - potential data exfiltration

SourceSKILL.md
475> - **Express:** Use `express.raw({ type: 'application/json' })` on the webhook route (not `express.json()`)
low line 480

Webhook reference - potential data exfiltration

SourceSKILL.md
480// app/api/webhooks/email/route.ts
low line 491

Webhook reference - potential data exfiltration

SourceSKILL.md
491// Verify webhook signature
low line 492

Webhook reference - potential data exfiltration

SourceSKILL.md
492const event = resend.webhooks.verify({
low line 499

Webhook reference - potential data exfiltration

SourceSKILL.md
499secret: process.env.RESEND_WEBHOOK_SECRET,
low line 503

Webhook reference - potential data exfiltration

SourceSKILL.md
503// Webhook payload only includes metadata, not email body
low line 515

Webhook reference - potential data exfiltration

SourceSKILL.md
515console.error('Webhook error:', error);
low line 530

Webhook reference - potential data exfiltration

SourceSKILL.md
530// CRITICAL: Use express.raw, NOT express.json, for the webhook route
low line 531

Webhook reference - potential data exfiltration

SourceSKILL.md
531app.post('/webhook/email', express.raw({ type: 'application/json' }), async (req, res) => {
low line 535

Webhook reference - potential data exfiltration

SourceSKILL.md
535// Verify webhook signature
low line 536

Webhook reference - potential data exfiltration

SourceSKILL.md
536const event = resend.webhooks.verify({
low line 543

Webhook reference - potential data exfiltration

SourceSKILL.md
543secret: process.env.RESEND_WEBHOOK_SECRET,
low line 557

Webhook reference - potential data exfiltration

SourceSKILL.md
557// Webhook payload only includes metadata, not email body
low line 565

Webhook reference - potential data exfiltration

SourceSKILL.md
565console.error('Webhook error:', error);
low line 575

Webhook reference - potential data exfiltration

SourceSKILL.md
575app.listen(3000, () => console.log('Webhook server running on :3000'));
medium line 578

Webhook reference - potential data exfiltration

SourceSKILL.md
578#### Webhook Verification Fallback (Svix)
medium line 580

Webhook reference - potential data exfiltration

SourceSKILL.md
580If you're using an older Resend SDK that doesn't have `resend.webhooks.verify()`, you can verify signatures directly with the `svix` package:
low line 587

Webhook reference - potential data exfiltration

SourceSKILL.md
587import { Webhook } from 'svix';
low line 589

Webhook reference - potential data exfiltration

SourceSKILL.md
589// Replace resend.webhooks.verify() with:
low line 590

Webhook reference - potential data exfiltration

SourceSKILL.md
590const wh = new Webhook(process.env.RESEND_WEBHOOK_SECRET);
medium line 598

Webhook reference - potential data exfiltration

SourceSKILL.md
598### Register Webhook in Resend Dashboard
medium line 600

Webhook reference - potential data exfiltration

SourceSKILL.md
6001. Go to Dashboard → Webhooks → Add Webhook
medium line 603

Webhook reference - potential data exfiltration

SourceSKILL.md
6034. Copy the signing secret to `RESEND_WEBHOOK_SECRET`
medium line 605

Webhook reference - potential data exfiltration

SourceSKILL.md
605### Webhook Retry Behavior
medium line 607

Webhook reference - potential data exfiltration

SourceSKILL.md
607Resend automatically retries failed webhook deliveries with exponential backoff:
medium line 610

Webhook reference - potential data exfiltration

SourceSKILL.md
610- Failed deliveries are visible in the Webhooks dashboard
medium line 611

Webhook reference - potential data exfiltration

SourceSKILL.md
611- Emails are stored even if webhooks fail — you won't lose messages
medium line 615

Webhook reference - potential data exfiltration

SourceSKILL.md
615Your local server isn't accessible from the internet. Use tunneling to expose it for webhook delivery.
medium line 619

Webhook reference - potential data exfiltration

SourceSKILL.md
619> Webhook URLs are registered in Resend's dashboard. If your tunnel URL changes (e.g., ngrok restart), you must update the webhook configuration manually. For development, this is manageable. For anyt
medium line 631

Webhook reference - potential data exfiltration

SourceSKILL.md
631- Must update webhook URL in Resend dashboard after each restart
medium line 656

Webhook reference - potential data exfiltration

SourceSKILL.md
656Cloudflare Tunnels can be either quick (ephemeral) or named (persistent). For webhooks, use **named tunnels**.
medium line 658

Webhook reference - potential data exfiltration

SourceSKILL.md
658**Quick tunnel (ephemeral - NOT recommended for webhooks):**
low line 673

Webhook reference - potential data exfiltration

SourceSKILL.md
673cloudflared tunnel create my-agent-webhook
low line 681

Webhook reference - potential data exfiltration

SourceSKILL.md
681- hostname: webhook.yourdomain.com
low line 686

Webhook reference - potential data exfiltration

SourceSKILL.md
686cloudflared tunnel route dns my-agent-webhook webhook.yourdomain.com
low line 689

Webhook reference - potential data exfiltration

SourceSKILL.md
689cloudflared tunnel run my-agent-webhook
medium line 692

Webhook reference - potential data exfiltration

SourceSKILL.md
692Now `https://webhook.yourdomain.com` always points to your local machine, even across restarts.
medium line 707

Webhook reference - potential data exfiltration

SourceSKILL.md
707**Note:** URL changes each VS Code session. Not suitable for persistent webhooks.
medium line 719

Webhook reference - potential data exfiltration

SourceSKILL.md
719### Webhook URL Configuration
medium line 722

Webhook reference - potential data exfiltration

SourceSKILL.md
722- Development: `https://<tunnel-url>/api/webhooks/email`
medium line 723

Webhook reference - potential data exfiltration

SourceSKILL.md
723- Production: `https://yourdomain.com/api/webhooks/email`
medium line 727

Webhook reference - potential data exfiltration

SourceSKILL.md
727For a reliable agent inbox, deploy your webhook endpoint to production infrastructure instead of relying on tunnels.
medium line 731

Webhook reference - potential data exfiltration

SourceSKILL.md
731**Option A: Deploy webhook handler to serverless**
medium line 737

Webhook reference - potential data exfiltration

SourceSKILL.md
737- Your webhook handler runs alongside your agent
medium line 743

Webhook reference - potential data exfiltration

SourceSKILL.md
743- Add webhook route to existing web server
low line 748

Webhook reference - potential data exfiltration

SourceSKILL.md
748# In your Next.js project with the webhook handler
low line 751

Webhook reference - potential data exfiltration

SourceSKILL.md
751# Your webhook URL becomes:
low line 752

Webhook reference - potential data exfiltration

SourceSKILL.md
752# https://your-project.vercel.app/api/webhooks/email
medium line 757

Webhook reference - potential data exfiltration

SourceSKILL.md
757See the Express example in the Webhook Setup section above. Deploy it with a reverse proxy (nginx, caddy) for HTTPS, or behind a load balancer that terminates SSL.
medium line 761

Webhook reference - potential data exfiltration

SourceSKILL.md
761### Webhook Gateway (Recommended)
medium line 763

Webhook reference - potential data exfiltration

SourceSKILL.md
763The best way to connect email to Clawdbot is via the webhook gateway. This takes full advantage of Resend's webhook functionality, delivering emails to your agent in real time — no polling delays, no
medium line 783

Webhook reference - potential data exfiltration

SourceSKILL.md
783Clawdbot can poll the Resend API for new emails during heartbeats. This is simpler to set up but does not take advantage of Resend's webhook functionality — emails are not delivered in real time, and
medium line 805

Webhook reference - potential data exfiltration

SourceSKILL.md
805For deep integration, implement Clawdbot's external channel plugin interface to treat email as a first-class channel alongside Telegram, Signal, etc. This also uses webhooks for real-time delivery.
low line 860

Webhook reference - potential data exfiltration

SourceSKILL.md
860event: EmailReceivedWebhookEvent
low line 909

Webhook reference - potential data exfiltration

SourceSKILL.md
909event: EmailReceivedWebhookEvent,
low line 941

Webhook reference - potential data exfiltration

SourceSKILL.md
941RESEND_WEBHOOK_SECRET=whsec_xxxxxxxxx
medium line 955

Webhook reference - potential data exfiltration

SourceSKILL.md
955| Trusting email headers | Use webhook verification, not email headers for auth |
medium line 962

Webhook reference - potential data exfiltration

SourceSKILL.md
962| Using `express.json()` on webhook route | Use `express.raw({ type: 'application/json' })` — JSON parsing breaks signature verification |
medium line 964

Webhook reference - potential data exfiltration

SourceSKILL.md
964| Old Resend SDK version | `emails.receiving.get()` and `webhooks.verify()` require recent SDK versions — see SDK Version Requirements |
medium line 977

Webhook reference - potential data exfiltration

SourceSKILL.md
9773. Webhook is active: Check status in Resend dashboard → Webhooks
medium line 984

Webhook reference - potential data exfiltration

SourceSKILL.md
984**Cause:** Resend SDK version too old — `resend.webhooks.verify()` was added in recent versions.
medium line 989

Webhook reference - potential data exfiltration

SourceSKILL.md
989Or use the Svix fallback (see Webhook Verification Fallback section above).
medium line 1001

Webhook reference - potential data exfiltration

SourceSKILL.md
1001### Webhook returns 400 errors
medium line 1004

Webhook reference - potential data exfiltration

SourceSKILL.md
10041. **Wrong signing secret** — Check the Resend dashboard for the correct secret. Click on your webhook and copy "Signing Secret" from the upper right.
medium line 1005

Webhook reference - potential data exfiltration

SourceSKILL.md
10052. **Body parsing issue** — You must use the raw body for verification. Use `express.raw({ type: 'application/json' })` on the webhook route, not `express.json()`.
medium line 1011

Webhook reference - potential data exfiltration

SourceSKILL.md
1011**Fix:** Restart ngrok, then update the webhook URL in the Resend dashboard.
medium line 1014

Webhook reference - potential data exfiltration

SourceSKILL.md
1014### Email received but no webhook fires
medium line 1016

Webhook reference - potential data exfiltration

SourceSKILL.md
10161. Check the webhook is "Active" in Resend dashboard → Webhooks
medium line 1017

Webhook reference - potential data exfiltration

SourceSKILL.md
10172. Check the endpoint URL is correct (including the path, e.g., `/webhook/email`)
medium line 1019

Webhook reference - potential data exfiltration

SourceSKILL.md
10194. Check the "Recent Deliveries" section on your webhook for status codes
medium line 1029

Webhook reference - potential data exfiltration

SourceSKILL.md
1029**This is expected behavior.** The webhook delivers a notification to the user, who then instructs the agent how to respond. This is the safest approach — the user reviews each email before the agent
high line 64

Ngrok tunnel reference

SourceSKILL.md
644. **Set up tunneling** (local dev) - Use ngrok or similar to expose your endpoint
high line 467

Ngrok tunnel reference

SourceSKILL.md
467To provide them the endpoint URL for step #3, you need to set up an endpoint, and then use tunneling with a tool like ngrok.
high line 469

Ngrok tunnel reference

SourceSKILL.md
469Resend requires these URLs to be https, and verifies certificates, so ensure that your ngrok setup includes a verified cert.
high line 619

Ngrok tunnel reference

SourceSKILL.md
619> Webhook URLs are registered in Resend's dashboard. If your tunnel URL changes (e.g., ngrok restart), you must update the webhook configuration manually. For development, this is manageable. For anyt
high line 620

Ngrok tunnel reference

SourceSKILL.md
620> - A **paid tunnel service** with static URLs (ngrok paid, Cloudflare named tunnels)
high line 625

Ngrok tunnel reference

SourceSKILL.md
625### ngrok (Recommended)
high line 627

Ngrok tunnel reference

SourceSKILL.md
627The most popular and simplest tunneling solution. Use ngrok as the default choice for local development.
high line 630

Ngrok tunnel reference

SourceSKILL.md
630- URLs are random and change on every restart (e.g., `https://a1b2c3d4.ngrok-free.app`)
high line 635

Ngrok tunnel reference

SourceSKILL.md
635- Static subdomain that persists across restarts (e.g., `https://myagent.ngrok.io`)
high line 637

Ngrok tunnel reference

SourceSKILL.md
637- Recommended if using ngrok long-term
medium line 641

Ngrok tunnel reference

SourceSKILL.md
641brew install ngrok # macOS
medium line 642

Ngrok tunnel reference

SourceSKILL.md
642# or download from https://ngrok.com
medium line 645

Ngrok tunnel reference

SourceSKILL.md
645ngrok config add-authtoken <your-token>
medium line 648

Ngrok tunnel reference

SourceSKILL.md
648ngrok http 3000
medium line 651

Ngrok tunnel reference

SourceSKILL.md
651ngrok http --domain=myagent.ngrok.io 3000
medium line 661

Ngrok tunnel reference

SourceSKILL.md
661# URL changes every time - same problem as free ngrok
high line 695

Ngrok tunnel reference

SourceSKILL.md
695**Cons:** Requires owning a domain on Cloudflare, more setup than ngrok
high line 717

Ngrok tunnel reference

SourceSKILL.md
717**Note:** URLs change on restart. Same limitations as free ngrok.
high line 961

Ngrok tunnel reference

SourceSKILL.md
961| Using ephemeral tunnel URLs | Use persistent URLs (paid ngrok, Cloudflare named tunnels) or deploy to production |
high line 1008

Ngrok tunnel reference

SourceSKILL.md
1008### ngrok connection refused / tunnel died
high line 1010

Ngrok tunnel reference

SourceSKILL.md
1010**Cause:** Free ngrok tunnels time out and change URLs on restart.
high line 1011

Ngrok tunnel reference

SourceSKILL.md
1011**Fix:** Restart ngrok, then update the webhook URL in the Resend dashboard.
high line 1012

Ngrok tunnel reference

SourceSKILL.md
1012**Better:** Use paid ngrok with a static domain, or deploy to production.
low line 676

Access to hidden dotfiles in home directory

SourceSKILL.md
676# Create config file ~/.cloudflared/config.yml
medium line 84

Access to .env file

SourceSKILL.md
84- Human creates `.env` file directly: `echo "RESEND_API_KEY=re_xxx" >> .env`
low line 484

Access to .env file

SourceSKILL.md
484const resend = new Resend(process.env.RESEND_API_KEY);
low line 499

Access to .env file

SourceSKILL.md
499secret: process.env.RESEND_WEBHOOK_SECRET,
low line 528

Access to .env file

SourceSKILL.md
528const resend = new Resend(process.env.RESEND_API_KEY);
low line 543

Access to .env file

SourceSKILL.md
543secret: process.env.RESEND_WEBHOOK_SECRET,
low line 590

Access to .env file

SourceSKILL.md
590const wh = new Webhook(process.env.RESEND_WEBHOOK_SECRET);
low line 814

Access to .env file

SourceSKILL.md
814const resend = new Resend(process.env.RESEND_API_KEY);
low line 849

Access to .env file

SourceSKILL.md
849const resend = new Resend(process.env.RESEND_API_KEY);
low line 853

Access to .env file

SourceSKILL.md
853allowedSenders: (process.env.ALLOWED_SENDERS || '').split(',').filter(Boolean),
low line 854

Access to .env file

SourceSKILL.md
854allowedDomains: (process.env.ALLOWED_DOMAINS || '').split(',').filter(Boolean),
low line 855

Access to .env file

SourceSKILL.md
855securityLevel: process.env.SECURITY_LEVEL || 'strict', // 'strict' | 'domain' | 'filtered' | 'sandboxed'
low line 856

Access to .env file

SourceSKILL.md
856ownerEmail: process.env.OWNER_EMAIL,
low line 6

External URL reference

SourceSKILL.md
6description: Resend API key for sending and receiving emails. Get yours at https://resend.com/api-keys
low line 134

External URL reference

SourceSKILL.md
134**Tip:** To verify your DNS records have propagated correctly, visit [dns.email](https://dns.email) and input your domain. This tool checks MX, SPF, DKIM, and DMARC records all in one place.
low line 248

External URL reference

SourceSKILL.md
248// See: https://owasp.org/www-project-top-10-for-large-language-model-applications/
low line 460

External URL reference

SourceSKILL.md
4601. Go to https://resend.com/webhooks (the Webhooks tab of the dashboard)
low line 630

External URL reference

SourceSKILL.md
630- URLs are random and change on every restart (e.g., `https://a1b2c3d4.ngrok-free.app`)
low line 635

External URL reference

SourceSKILL.md
635- Static subdomain that persists across restarts (e.g., `https://myagent.ngrok.io`)
low line 642

External URL reference

SourceSKILL.md
642# or download from https://ngrok.com
low line 660

External URL reference

SourceSKILL.md
660cloudflared tunnel --url http://localhost:3000
low line 682

External URL reference

SourceSKILL.md
682service: http://localhost:3000
low line 692

External URL reference

SourceSKILL.md
692Now `https://webhook.yourdomain.com` always points to your local machine, even across restarts.
low line 722

External URL reference

SourceSKILL.md
722- Development: `https://<tunnel-url>/api/webhooks/email`
low line 723

External URL reference

SourceSKILL.md
723- Production: `https://yourdomain.com/api/webhooks/email`
low line 752

External URL reference

SourceSKILL.md
752# https://your-project.vercel.app/api/webhooks/email
low line 975

External URL reference

SourceSKILL.md
9751. Server is running: `curl http://localhost:3000` should return a response
low line 976

External URL reference

SourceSKILL.md
9762. Tunnel is working: `curl https://<your-tunnel-url>` should return the same response
low line 1018

External URL reference

SourceSKILL.md
10183. Check the tunnel is running: `curl https://<your-tunnel-url>`
Scanned on May 24, 2026
View Security Dashboard
Installation guide →