// context guardrails

Email

Score a raw RFC 822 email before an agent trusts the sender, body, attachments, or links.

Score a raw RFC 822 / .eml message before an agent reads it, summarizes it, or follows links inside it. Superagent checks the sender, the body and attachments, and outbound https links.

How scoring works

An email scan runs in three tiers:

  1. Identity — From domain RDAP/TLS/blocklists, SPF/DKIM/DMARC from Authentication-Results, display-name mismatch, and Reply-To divergence. A blocklisted sender short-circuits to score 0.
  2. Body and attachments — prompt injection, exfiltration, urgency, brand impersonation, hidden HTML, encoded payloads, and dangerous attachment types. Up to eight public https links are followed with the web-page scanner.
  3. LLM review — always runs unless the sender is blocklisted. Looks for phishing, brand impersonation, and hidden agent instructions.

The raw message is not stored on the artifact. Cache lookup uses the SHA-256 of the raw bytes. Invalid identifiers or RFC 822 bodies return 400 invalid_request. Unknown email identifiers return 404 not_found.

Threats

When details=true or the verdict is suspicious / dangerous, email scans may emit spf_fail, display_name_mismatch, brand_impersonation, malicious_attachment, phishing, and prompt-injection or exfiltration types shared with other origins.

Use it

  • Dashboard: open Agents → Context, paste a raw message, and open the result for identity, behavior, and content scores.
  • REST API: POST /api/v1/context/email to score a message and GET /api/v1/context/email/{identifier} to look up a previous result by SHA-256. See the Context Guardrails API.
  • MCP: scan_email.

Content-Type must be message/rfc822 or text/plain. Bodies larger than 1 MB are rejected.

curl "https://superagent.sh/api/v1/context/email?details=true" \
  -H "Authorization: Bearer sk_live_..." \
  -H "Content-Type: message/rfc822" \
  --data-binary @message.eml
curl "https://superagent.sh/api/v1/context/email/<sha256>?details=true" \
  -H "Authorization: Bearer sk_live_..."

To rescan an email, POST the raw body again. GET never starts a new scan.

Next steps