Skip to content

fix(inbox): require an authenticated sender before an allow-listed address is admitted - #10319

Merged
waleedlatif1 merged 1 commit into
stagingfrom
fix/agentmail-allowlist-auth
Nov 22, 2026
Merged

waleedlatif1 merged 1 commit into
stagingfrom
fix/agentmail-allowlist-auth

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

  • The inbox webhook required an SPF/DKIM/DMARC-authenticated sender before matching a workspace member, but matched the allowed-senders list on the raw From header. Anyone who knew one allowed address could forge it and start an agent turn in the workspace (owner-attributed, read-capped, billed to the workspace)
  • isSenderAllowed is now a plain member/allowlist lookup, and the webhook only runs it when the sender is authenticated, so an unauthenticated message is rejected as sender_not_allowed whichever address it names
  • The executor's own verdict check stays as defense in depth; its comment now says so
  • Mailer docs note that a member or allowed address is only recognized when the message passes SPF, DKIM, or DMARC for its domain

Type of Change

  • Bug fix

Testing

  • sender-authentication.integration.ts against real Postgres through the signed webhook and the real executor:
    • an unauthenticated allow-listed external address is rejected. It fails on the pre-fix route
    • an authenticated allow-listed external address is admitted and runs as owner read with no secret actor
    • an unauthenticated task already in the queue never runs as the member its From names. It fails with the executor check removed
    • the multi-mailbox case now carries a passing verdict, so it still proves the parser rule rather than the new gate
  • thread-scope.integration.ts, plus the app/api/webhooks/agentmail and lib/mothership/inbox unit suites, pass
  • biome, check:comment-hygiene, check:test-patterns, check:boundaries. Full type-check and audits run in CI

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing (new tests pass the test-audit authoring gate)
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel

vercel Bot commented Nov 22, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
docs Ready Ready Preview Nov 22, 2026 10:55pm UTC

Request Review

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 4 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

This PR changes authentication, authorization, or input validation. Ultrareviews find 2.4x more serious bugs than standard reviews. Comment @cubic-dev-ai ultrareview to run one.

Turn on auto-fix | Re-trigger cubic

@greptile-apps

greptile-apps Bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; it closes the unauthenticated allowlist path without changing admission for authenticated senders.

Summary

The webhook now requires sender authentication before checking workspace membership or the allowed-senders list.

  • Inbox senders need domain proof before their addresses can start a task.

No actionable issues found. Review was based on source inspection; tests were not run.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Verified webhook] --> B{Sender authenticated?}
  B -->|No| R[Reject sender]
  B -->|Yes| C{Member or allowed address?}
  C -->|No| R
  C -->|Yes| D[Continue admission checks]
  D --> E[Queue task]
  E --> F[Executor checks member identity]
Loading

Reviews (1) · Last reviewed commit: "fix(inbox): require an authenticated sen..." · Reviewed by Greptile

@waleedlatif1
waleedlatif1 merged commit 7f9735f into staging Nov 22, 2026
87 checks passed
@waleedlatif1
waleedlatif1 deleted the fix/agentmail-allowlist-auth branch November 23, 2026 00:04

This branch was successfully deployed

1 active deployment
Preview — 03309eb3 Deployed Nov 22, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant