For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
contact@agentmail.ccDiscord
DocumentationAPI ReferenceKnowledge BaseChangelog
DocumentationAPI ReferenceKnowledge BaseChangelog
  • Get Started
    • Welcome
    • Introduction
    • Quickstart
  • Core Concepts
    • Inboxes
    • Messages
    • Threads
    • Drafts
    • Labels
    • Lists
    • Attachments
    • Pods
    • Permissions
  • Integrations
    • Agent Onboarding
    • Skills
    • MCP
    • CLI
    • Google ADK
    • OpenClaw
    • Replit
    • x402
    • MPP
    • LiveKit
    • Sim.ai
  • Guides
    • Sending & Receiving Email
    • IMAP & SMTP
    • Multi-Tenancy
  • Webhooks
    • Overview
    • Events
    • Setup Guide
    • Verifying Webhooks
  • WebSockets
    • Overview
    • Quickstart
  • Best Practices
    • Email Deliverability
    • Idempotency
  • Examples
    • Github Repo Agent
    • Auto Reply Agent
    • Smart Labeling Agent
    • Sales Agent (WebSocket)
    • Live AgentMail Examples
  • Resources
    • FAQ
    • Talon Reply Extraction
    • Community
    • Support
      • SPF, DKIM, DMARC
      • SOC 2 Compliance
      • Spam & Virus Detection
LogoLogo
contact@agentmail.ccDiscord
On this page
  • Virus Detection
  • Spam Detection
  • Accessing Spam Threads
ResourcesSecurity & Privacy

Spam & Virus Detection

Was this page helpful?
Edit this page
Previous
Built with

AgentMail automatically scans every inbound message for spam and viruses before it reaches your inbox. This happens transparently — there is nothing you need to configure.

Virus Detection

Emails that contain viruses or malware are rejected at the gateway and are never stored. Your inboxes will never contain a message flagged as infected. This protects your agents from processing potentially dangerous content.

Spam Detection

Emails identified as spam are still stored in your inbox so you never lose a message that might be a false positive. However, they are excluded from API results by default to keep your agent’s workflow clean.

When you call the List Threads or List Messages endpoint, spam messages are filtered out unless you explicitly request them.

Accessing Spam Threads

To include spam in your results, pass the include_spam (includeSpam in TypeScript) parameter when listing threads.

1const threads = await client.threads.list({
2 includeSpam: true,
3});

Each thread object includes a spam label indicating whether it was flagged as spam, so you can handle flagged threads differently in your application logic.

Example spam thread
1{
2 "thread_id": "thread_abc123",
3 "subject": "You have won a prize!",
4 "labels": ["spam"],
5 "from": "suspicious@example.com",
6 "to": ["your-agent@your-domain.com"]
7}