feat(sdk): add the blocked message status from outbound abuse scanning#44
Merged
Conversation
senderkit-app now runs outbound anti-phishing detection over email and SMS (app #196). A flagged send is halted and the message lands in a new terminal `blocked` state with a `blockedReason`. - Add `blocked` to `MESSAGE_STATUSES`, mirroring the app's `messageStatusEnum`. The `senderkit_messages_list.status` MCP/CLI filter is a strict `z.enum(MESSAGE_STATUSES)`, so it previously rejected `status: "blocked"` as invalid input. - Document `blocked` on `Message.status` and add the optional `Message.blockedReason` field. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01A299AvEPRfoWPP3Hq5NJGa
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Review of senderkit-app
mainsince the last SDK sync (PR #41, which covered app changes through #168) — app PRs #169 → #198. Almost all of that window is marketing/SEO, Supabase inbound-hook integrations, analytics/admin-impersonation, and billing/pricing config — none of which touch the SDK's outbound API contract. The one change that does is the new outbound anti-phishing detection (app #196, refined by #198).That feature scans rendered email/SMS content asynchronously and, on a high-confidence verdict in enforce mode, halts the send. The message lands in a brand-new terminal status
blocked(added to the app'smessageStatusEnum) with a human-readableblockedReasoncolumn. The synchronous send response is unchanged (stillqueued/scheduled), sosend/sendRawand the error classes need no changes — but the read surface does.What changed
MCP / CLI (
packages/sdk/src/mcp-schemas.ts)blockedtoMESSAGE_STATUSES(betweenopted_outandcanceled), keeping it in lockstep with the app enum.senderkit_messages_list.statusis a strictz.enum(MESSAGE_STATUSES), so before this change the MCP/CLI tool rejectedstatus: "blocked"as invalid input — callers could not filter for blocked messages. The filter description string now listsblockedtoo.SDK types (
packages/sdk/src/types.ts)blockedonMessage.statusand added the optionalMessage.blockedReason?: string | nullfield. (statusstaysstringandMessagekeeps its index signature, so this is non-breaking.)Changeset
@senderkit/sdk: minor,@senderkit/cli: patch.Not changed (and why)
SendResponse,SenderKit*Error) is untouched.template_limit_reached, quota 409) are unchanged and the SDK doesn't model plans/quota.api.senderkit.comsurface.Verification
pnpm buildandpnpm testpass (sdk 58, cli 80, react-email 29).🤖 Generated with Claude Code
Generated by Claude Code