We respect your privacy

    MailGuard uses cookies and local storage to keep you signed in and remember your preferences. With your permission, we'd also like to use functional cookies (affiliate referrals) and analytics (anonymized error replays, and on the free domain check your time zone, screen size and a random visit identifier) to improve the product. Learn more

    Skip to main content

    Security

    Last updated: November 2026

    This page summarises the technical and organisational measures MailGuard takes to protect customer data. It is a working document that reflects the platform’s current state — every claim is grounded in code that has shipped, not aspirations. When something changes, this page changes; check the “Last updated” date above.

    For the legal framework under which we process data, see our Privacy Policy, Data Processing Agreement, and Subprocessors list. This Security page is the technical companion to those documents.

    1. How to read this page

    Three principles govern what we publish here:

    • No security theatre. We do not list controls we have not implemented. If something is on the roadmap, the “Certifications and roadmap” section says so and gives a trigger for when it lands.
    • Defence in depth, not a single perimeter. Most controls described below are layered. A single bypass does not unlock customer data — every sensitive surface is checked at multiple stages.
    • Honest about scale. MailGuard is a small team early in its commercial life. Several controls (formal SOC 2 audit, dedicated security engineer) scale with revenue. We are explicit about what we do today versus what arrives at the next scale milestone.

    2. Compliance frameworks

    MailGuard is operated by Valentina Proyectos SL (ValPro), a Spanish entity, which makes the EU General Data Protection Regulation (GDPR) applicable to all customer relationships regardless of the customer’s location.

    • GDPR (EU/EEA) — mandatory. Lawful basis for processing, data subject rights, subprocessor disclosure, breach notification.
    • UK GDPR — mandatory; substantively identical to GDPR post-Brexit.
    • LGPD (Brazil) — mandatory for our LatAm market entry. Closely aligned with GDPR.
    • CCPA / CPRA (California) — mandatory for US customers. Lighter than GDPR but mandates opt-out and data-access rights, which we honour through the same self-serve flows.
    • SOC 2 Type II — not yet certified. The control set we operate (audit logging, RLS, role-based access, encryption, vendor management, incident response) maps to SOC 2 Trust Services Criteria, but no external auditor has issued a report. We will pursue a Type I report when our enterprise pipeline justifies the audit cost.
    • ISO 27001 — not yet certified. Same posture as SOC 2.

    Customer-facing rights (access, rectification, erasure, portability, objection) are exercised through self-serve flows in /app/settings — no support ticket required.

    3. Encryption in transit and at rest

    In transit

    • All public traffic to themailguard.ai and api.themailguard.ai uses TLS 1.2 or higher. HTTPS is enforced; HTTP requests are redirected.
    • Outbound API calls to subprocessors (Supabase, Eden AI, Resend, HetrixTools, Stripe, DigitalOcean Spaces, Sentry) use TLS 1.2+ with certificate validation. Internal URL safety nets reject loopback / RFC 1918 / metadata addresses on every dispatch where MailGuard initiates the connection.
    • DNS-over-HTTPS (DoH) is used for every external DNS lookup performed by Edge Functions, including blacklist checks (blacklists: public spam lists that mail providers check before accepting email) and the lookup of DMARC (the rule that tells mail servers to reject email pretending to be you), SPF (the list of servers allowed to send email for your domain) and DKIM (a digital signature that proves an email really came from you) — preventing in-transit DNS tampering at the resolver layer.

    At rest

    • Supabase Postgres: AES-256 disk-level encryption managed by AWS RDS in us-east-1. Logical backups are also encrypted.
    • DigitalOcean Spaces (the XML of DMARC RUA reports, the daily reports mail providers send about who sent email as your domain): AES-256 server-side encryption.
    • Customer secrets that we receive from third parties (e.g. Stripe, Resend webhook secrets) are stored as Supabase function secrets and never written to a database column in plaintext.

    4. Multi-tenancy and access control

    MailGuard is a multi-tenant SaaS platform. Tenants (organisations) are isolated via PostgreSQL Row Level Security (RLS), which is the only mechanism that scopes queries to a tenant. There is no application-layer tenant filter that could be bypassed by skipping a middleware.

    • Every table that holds customer data has ENABLE ROW LEVEL SECURITY. The default deny applies if no policy matches.
    • SELECT policies derive the caller’s organisation id from a SECURITY DEFINER helper public.get_user_org_id() that reads from auth.uid(). The helper is stable; the join cost is negligible.
    • Mutating policies additionally check the user’s role on the org. Roles (owner, admin, analyst, viewer) are checked per operation. A viewer cannot mutate domain state, an analyst cannot configure billing, only owner can sign the DPA or schedule erasure.
    • The Supabase service-role key is used only by Edge Functions on the server side and never reaches the browser. Every Edge Function that needs the service role validates the caller’s JWT first and re-applies the org / role gate before bypassing RLS.
    • Cross-tenant probes return 404 not_found rather than 403 forbidden on ownership-checked surfaces (api keys, share tokens, webhooks, snooze, audit log) — anti-enumeration posture consistent across the platform.

    We have published Edge Functions whose only purpose is to exercise this isolation (/v1/audit-logs, the public REST API gateway, the MCP server) — they all go through the same RLS boundary and same role gates. A successful cross-tenant attack would require either a Postgres-level RLS bypass (which would affect every Supabase customer) or compromise of our service-role key.

    5. Authentication and bot protection

    Account authentication is delegated to Supabase Auth. Public sign-up via auth.signUp is disabled — every registration goes through the register-user Edge Function, which enforces a layered protection pipeline:

    1. Honeypot — hidden form field that legitimate browsers leave empty. Triggered submissions get a fake-200 response with plausible scores so bots cannot distinguish honeypot rejection from a successful pass.
    2. IP rate limit — per-IP limits on sign-up (5/h), login (10/15 min), password reset (5/h), magic link (shares login bucket) via the atomic check_rate_limit RPC.
    3. Cloudflare Turnstile, with a MailGuard-signed fallback — the free domain check (/check) verifies a Turnstile token server-side and fails closed: a missing or invalid token rejects the request. The account forms (sign-up, login, magic link, password reset and invitation acceptance) verify either a Turnstile token or — when Turnstile cannot run in the browser, for example during a Cloudflare incident or when its script is blocked — a MailGuard-signed, single-use proof of work bound to that form and valid for five minutes, under stricter per-IP, per-address and platform-wide limits. A request with neither is rejected, and a Turnstile token that Cloudflare rejects is never retried with the fallback.
    4. IP reputation scoring — repeat-offender IPs across the four auth Edge Functions carry a reputation score that throttles their effective rate-limit window.
    5. Anti-enumeration — password reset and magic link return HTTP 200 whether or not the email exists, so attackers cannot probe signups with leaked email lists.

    Passwords are hashed by Supabase Auth using bcrypt. We do not implement custom hashing. Password reset and magic link flows are time-limited and single-use.

    Two-step verification

    Every user can turn on two-step verification from Settings: a time-based one-time code (TOTP) from an authenticator app, through Supabase Auth MFA. Once it is on, a password or a magic link on its own is not enough. Until the code is entered, the session is refused by the database API (a check that runs before every request) and by every Edge Function that acts for a signed-in user, the Olivio assistant included — not only by the sign-in screen. Platform administration inside the MailGuard app always requires it, enforced in the database and in every administrative Edge Function. One internal channel works differently: the MailGuard team’s operations chat on Telegram, open only to allow-listed team accounts, identifies the Telegram account rather than a MailGuard session and does not ask for this code.

    Ten single-use recovery codes are shown once and stored only as SHA-256 hashes. Using one is rate-limited, removes the lost authenticator, signs out the account’s other sessions and emails the account’s own address; the account then sets up two-step verification again. Someone who has lost both the authenticator and the recovery codes contacts us: a person at MailGuard removes two-step verification only after confirming the account holder’s identity, and that removal is recorded in the audit log too. Turning it on or off, generating recovery codes and every recovery-code use are written to the audit log. An organisation cannot yet require two-step verification for its members.

    Single sign-on (SSO, SAML or OIDC) is not available.

    6. Secrets management

    Secrets that we issue or persist are never stored in plaintext after the moment they are first revealed:

    • Public API keys (mg_live_<hex>): the secret half is hashed with SHA-256 (Stripe-style) and only the prefix is stored visibly. Plaintext is shown to the user once at creation time and never again. Validation is constant-time against the stored hash.
    • Webhook signing secrets: same shape — SHA-256 hash stored, plaintext shown once. HMAC verification uses the stored hash; the customer pre-hashes their stored secret to verify.
    • Share-portal tokens (share_<hex>): 256 bits of entropy, SHA-256 hashed at rest, the URL itself IS the secret and is shown to the operator once. Tokens carry a TTL ({7d, 30d, 90d, no expiry}) and are revocable.
    • DKIM private keys that MailGuard generates for a managed domain are shown to you once, for installation in your own mail server, and never stored by MailGuard — not in the database, not in logs. MailGuard publishes only the public key.
    • Subprocessor API keys (Stripe, Eden AI, Resend, HetrixTools, Cloudflare Turnstile, DigitalOcean Spaces) live as Supabase function secrets and are injected into Edge Function runtime environments only.

    The audit log scrubs sensitive fields at write time (defence in depth alongside read-time scrubbing): keys matching /(api[_-]?key|secret|password|hash|private[_-]?key|token)/i in audit metadata are replaced with [redacted] before the row is inserted.

    Secret rotation is supported for every customer-facing credential: API keys can be revoked from /app/settings/api-keys; webhook signing secrets are rotated by minting a new endpoint and deleting the old one; share-portal tokens are revocable individually.

    7. Audit log

    Every security-relevant action writes an append-only row to public.audit_logs. The table is read-only from the application surface — no EF or RPC offers a delete or update path. RLS scopes reads to owner / admin within the org; platform admins can read across orgs for support purposes.

    Event types covered today (non-exhaustive):

    • Security: api_key.created, api_key.revoked, share_token.created, share_token.revoked, share_token.pdf_downloaded, org.branding.updated, mfa.factor.enrolled, mfa.factor.removed, mfa.recovery_codes.generated, mfa.recovery_code.used, mfa.recovery_code.rejected
    • Compliance: gdpr.export.generated, org.deletion.scheduled, org.deletion.canceled, org.deletion.executed
    • Lifecycle: invitation.sent, invitation.accepted, domain.bulk_rechecked, domain.bulk_deleted, dkim.selector.added, dkim.selector.retired, domain.alerts_snoozed
    • Billing: Stripe lifecycle events
    • Operations: AI remediation reports, DMARC report ingestion, PDF exports, VMC validation, typosquat content validation

    Owner / admin can review the audit log directly from /app/settings/audit-log (filterable by category, severity, event type, actor, time window, with CSV export) or stream it into a SIEM via GET /v1/audit-logs using an API key with the audit_logs:read scope. Rows are append-only (they cannot be edited) and are kept for 365 days, after which a daily retention job deletes them.

    The audit log is part of how we comply with GDPR Article 30 (records of processing). It is also the primary forensic surface during incident response.

    8. Data residency

    Our application database, Edge Functions and authentication run in the United States. Some processing happens elsewhere: where each service that handles personal data for us runs is listed below, generated from version 5 of our subprocessor list so the two cannot differ.

    • Supabase — United States (AWS us-east-1, North Virginia).
    • Digital Ocean — United States (NYC3: report storage; NYC1: primary DNS) and Germany (FRA1, Frankfurt: workflow server and secondary DNS).
    • Resend — United States.
    • Eden AI — France (Eden AI); model processing in the European Union (Microsoft Azure EU, Databricks EU).
    • HetrixTools — United States.
    • Cloudflare — United States and global edge network.
    • Stripe — Ireland (EU customers) and United States (US customers).
    • Automattic (Gravatar) — United States.
    • Telegram — Global (Telegram's own infrastructure; no region can be chosen).
    • Lovable — Global content-delivery network (Cloudflare, operated for Lovable).
    • Sentry — Germany (Sentry EU data region, Frankfurt).

    EU customer data is processed under the European Commission’s Standard Contractual Clauses (SCCs) for international transfers. The DPA documents this in detail.

    EU regional migration trigger: we will evaluate a Frankfurt Supabase region (or multi-region read replicas) once EU paying customers exceed 10 organisations or EU ARR exceeds 20% of total — whichever lands first.

    9. Backups and disaster recovery

    • Database backups: daily backups managed by Supabase. A restore brings the database back to the most recent daily backup, so up to 24 hours of changes can be lost.
    • Recovery time: we do not publish a recovery-time target yet. A full restore has not been rehearsed; we will state a target here once a restore drill has been run and measured. Application code redeploys from git; the database is restored from the most recent backup.
    • DMARC RUA reports carry their own 365-day retention via the cleanup-dmarc-reports cron, which deletes the parsed report rows once they are older than 365 days (RUA contains sender IPs, which GDPR treats as personal data). The original XML files kept in DO Spaces are not deleted automatically yet: they stay in storage (encrypted, never served directly) until that purge is built.
    • Right-to-erasure cascade: when an organisation is deleted, 19 ON DELETE CASCADE foreign keys remove all per-org rows in a single transaction. The original DMARC XML files in DO Spaces are not part of that cascade yet and are not removed by it. Backups taken before the deletion still contain the data and are retained for the standard backup window per Supabase’s policy; we have no ability to retroactively scrub backups, which is the industry norm.

    10. Operational observability

    Production incidents are detected through these surfaces:

    • Scheduled-job failures page the engineering team by email: every scheduled workflow reports a failed run to one shared error handler.
    • Infrastructure health — each server reports a heartbeat and the state of the services it must run; a missed heartbeat or a stopped service raises an alert to the engineering team.
    • Platform events for product-level anomalies. The platform_events table records user-impacting failures (auth failures, function timeouts, rate-limit triggers, validation errors) without message content, and our team reviews it in an internal console.
    • Audit log surfaces tampering attempts and unusual administrative activity. Customer-facing operators see their own org’s audit log in real time at /app/settings/audit-log.
    • Error monitoring — the web app and the Edge Functions report errors to Sentry, hosted in the EU region; password, token and key fields are scrubbed before an event is sent, and session replay runs only with analytics consent.

    Cron jobs (n8n workflows) write a structured log line on each invocation; failures emit an error-workflow notification. The Edge Function deploy GitHub Action produces a build artifact + log per deploy.

    11. Cost ceilings and abuse mitigation

    Several subprocessors charge per call (Eden AI for AI, Resend for email, HetrixTools for blacklist checks, DO Spaces for storage and egress). A single bad actor or a runaway cron could produce a surprise invoice in hours, which is also a security concern (financial denial-of-service).

    • Per-user rate limits on every AI surface (ai-chat, generate-remediation-report) tied to the org plan via public.ai_chat_rate_limits.
    • IP rate limits on every public surface (sign-up, login, password reset, magic link, free check, share portal).
    • Plan-based ceilings on features with non-trivial unit cost (PDF export, AI chat, MCP smart tools).
    • Kill switches: every paid integration can be short-circuited by unsetting its API key — the EF then returns a graceful error or skipped state instead of silently consuming budget.
    • Untrusted content (DMARC RUA XML on DO Spaces) is never served directly: every download is proxied through an authenticated Edge Function with a per-user rate limit.
    • Outbound webhook URLs are validated at create time and re-validated at every dispatch — loopback / RFC 1918 / cloud metadata addresses are rejected (defence against SSRF via webhook configuration).

    12. Vulnerability disclosure

    We welcome reports from independent security researchers. If you believe you have found a security issue affecting MailGuard, please email security@themailguard.ai with the details. PGP encryption is available on request.

    Our request:

    • Make a good-faith effort to avoid privacy violations, destruction of data, or interruption of service.
    • Use only your own accounts or test accounts you control. Never access another customer’s data.
    • Give us reasonable time to investigate before public disclosure (typically 90 days).

    Our commitment:

    • We will acknowledge receipt of your report within 3 business days.
    • We will keep you informed of our progress, with a remediation timeline that depends on severity.
    • We will credit you in the security advisory once the fix has shipped, unless you prefer to remain anonymous.
    • We do not currently operate a paid bug bounty program. We will introduce one when our enterprise pipeline justifies the operational overhead.

    Out of scope: rate-limit testing on production, DDoS, social engineering of MailGuard staff, physical attacks on our infrastructure providers, automated scanner output without manual validation.

    13. Subprocessors

    The complete list of third parties that process customer data on our behalf, including purpose, region, and data shared, is published at /legal/subprocessors. Customers with a signed DPA are emailed at least 30 days before a new subprocessor (or a new use of an existing one) takes effect, and can object in that window. A correction of the list about something already in use is emailed as a transparency correction, never as advance notice.

    14. Certifications and roadmap

    We are explicit about what we operate today and what arrives at the next scale milestone. Buying decisions deserve honesty.

    Operating today

    • WCAG 2.1 AA accessibility baseline across the entire product surface.
    • GDPR / UK GDPR / LGPD / CCPA compliance with self-serve data subject rights.
    • Audit logging for every security-relevant action, read-only access for org admins, SIEM streaming via the public API.
    • Encryption in transit (TLS 1.2+) and at rest (AES-256), via Supabase / DigitalOcean.
    • RLS-based multi-tenancy, role-based access control, layered bot protection.
    • Two-step verification (TOTP) for every user, with single-use recovery codes; mandatory for platform administration.
    • A public status page at status.themailguard.ai, linked from the footer. It is measured from outside our platform: whether the app and API can reach the database, sign-in, the website and managed DNS.

    On the roadmap

    • SOC 2 Type I / II: will engage an external auditor when our enterprise pipeline justifies the audit cost. The control set we operate maps to SOC 2 Trust Services Criteria; the audit is a documentation and observation exercise on top.
    • ISO 27001: same posture as SOC 2.
    • Organisation-wide two-step verification: two-step verification is available to every user and mandatory for MailGuard platform administration today. Letting an organisation require it for its owners and admins, and then for every member, is the next step.
    • Bug bounty programme: not active. Vulnerability disclosure is currently a responsible-disclosure-only programme via the email in section 12.

    15. Contact

    Valentina Proyectos SL (ValPro)

    Security: security@themailguard.ai

    Privacy: privacy@themailguard.ai

    General: hello@themailguard.ai