- Call the API from a trusted backend, not public browser code.
- Never log API keys, authorization headers, message bodies, HTML, raw MIME, or attachment bytes.
- Escape all mail metadata before inserting it into HTML, SQL, shell commands, logs, or templates.
- Render sanitized email HTML in an isolated, sandboxed context with a restrictive Content Security Policy.
- Scan downloaded files when your risk model requires it; a safe filename and content type do not make an attachment trustworthy.
- Use separate keys per workload, least-privilege scopes, and immediate revocation on suspected exposure.
- Bound your own polling interval and deadline; uncontrolled loops waste allowance and can trigger abuse controls.
Requests and reliability
Security Best Practices
Protect credentials and handle untrusted mail content.
Last modified on August 2, 2026