DEV Community

ZekeCross3245
ZekeCross3245

Posted on

SMS Alert Service: Passwordless Backup Account Notifications Explained in 3 Evidence Gates

Blocking a bad destination protects recipients, but blocking a tenant's only recovery channel can also block account access. TL;DR: for a property-management developer portal, make passwordless backup SMS and account notifications pass three evidence gates: destination eligibility, permission for the specific purpose, and a durable record of the send decision. Keep email bounce evidence separate from SMS destination evidence. Compare services on whether their event semantics can support those decisions across US and EU operations; a low headline price cannot answer that question.

This is a proposed architecture, with illustrative policies and data rather than a claim about any particular service. The concrete job is to stop retries to invalid tenant contacts while preserving enough evidence to explain why an account alert was sent or withheld. Its difficult boundary is between a delivery event and the authority to change future sending behavior. An event saying that one message failed should not silently become a permanent judgment about every channel attached to the account.

Evidence needs scope.

How should an SMS alert service suppress failed passwordless backup account notifications?

Start with an example: tenant account tenant-104 has email contact revision 7 and phone contact revision 3. A bounce associated with email revision 6 arrives after the tenant corrects the address. Under this design, the old event belongs in the evidence record, but it cannot suppress revision 7. Nor should an email bounce suppress the phone merely because both contacts belong to the same tenant. These revision numbers are illustrative identifiers, not measured results.

The same reasoning applies to passwordless backup messages.

A failed SMS attempt is evidence about an attempt; the decision to suppress a destination additionally needs a documented interpretation of that event, its destination revision, and its scope. Treat ambiguous outcomes as unresolved until the integration's documented semantics justify a stronger conclusion. Otherwise, a vague failure label becomes an unreviewed access-control decision.

Name the failure modes before designing the handler: stale evidence suppressing a corrected contact, duplicate events creating duplicate transitions, and a delayed success clearing an unrelated suppression. None requires an exotic incident story. Each is a case the proposed state machine must define explicitly. In particular, a successful account-notification attempt should not automatically erase a purpose-specific restriction or establish consent for another purpose.

Delivery proves little.

OWASP's Forgot Password guidance provides the security boundary for the recovery side of this system: recovery tokens or codes should be securely generated, sufficiently long, stored securely, single use, and time limited. It also calls for consistent responses and protection against excessive submissions. A delivery status cannot substitute for those controls, and this article does not establish that SMS is sufficient for every MFA or recovery requirement.

Derive three gates from the evidence you need

The first gate asks whether this exact destination revision is eligible for this channel and purpose. Store the decision separately from the underlying event history so that operators can inspect the explanation without having to reconstruct it from whichever event happened to arrive last. An illustrative policy might suppress a destination only after a recognized permanent-invalid outcome, hold ambiguous failures for review, and require an explicit corrective action before lifting suppression. Those categories need a mapping grounded in the selected service's documentation; they are not universal status codes.

The second gate asks what authorizes this communication. GDPR Article 7 says that, where processing is based on consent, the controller must be able to demonstrate that consent, and withdrawal must be as easy as giving it. That conditional matters: Article 7 does not establish that every property-management security alert must rely on consent. Record the assessed basis and purpose, and have the responsible privacy team determine the applicable requirements. Do not infer permission from successful delivery, a stored phone number, or the fact that another channel remains usable. The third gate asks whether the decision and its explanation can be committed before dispatch. For this design, keep a decision record containing a contact revision, purpose, policy version, evidence reference, outcome, and internal decision identifier. Commit an eligible decision together with a pending dispatch record in one transaction; a worker can then process committed work. This is a design recommendation whose database guarantees must be verified, not a promise that adding a queue creates exactly-once delivery.

The dispatch worker should recheck the current contact revision and suppression state before handing off the message. Define that recheck as the authorization boundary and record its time: a suppression committed after handoff cannot retroactively recall the message. That race belongs in the operational contract, especially when a tenant changes a phone number during an active recovery attempt.

Keep recovery secrets out of these evidence records. Store references and reason codes, with access and retention rules chosen for the actual purpose. An append-only history can make changes easier to inspect, but append-only storage alone does not establish legal compliance, suitable retention, or protection against privileged modification. The storage contract needs to say who can change what.

Compare the evidence contract before the delivery bill

With the gates defined, a service comparison becomes concrete. Ask each candidate to document what its destination-invalid classifications mean, how events are authenticated, how retries and duplicates are identified, and what evidence can be exported. An undocumented answer is a gap in the assessment, not evidence that the capability exists. Keep the same sample cases and acceptance criteria for every candidate.

Design choice Benefit for the proposed portal Trade-off or limit to verify
Local suppression with retained evidence references One policy can govern email and SMS while preserving channel scope The team owns event mapping, access control, and correction workflows
Service-managed suppression as an additional check A second enforcement point can reject ineligible destinations Its scope, export behavior, and reconciliation rules need documentation
Contact revisions on decisions and events Old evidence cannot automatically change a corrected destination Every adapter must preserve the revision association
Decision and pending dispatch committed together Operators can trace dispatch back to an eligibility decision Worker retries still require an explicit duplicate-send policy

For US and EU operations, put the required processing locations, retention controls, and contractual evidence into the evaluation sheet; do not infer them from a service's geographic coverage claim. This is an assessment requirement, not a statement that one universal regional rule covers every tenant or message. Separate account security notifications from other property communications so that a purpose-specific decision stays intelligible.

Cost still belongs in the review.

Estimate it using the intended message mix, retry policy, evidence retention, and operational workload, with current quotes for the actual destinations. The relevant trade-off is whether a cheaper delivery interface transfers evidence reconciliation and recipient correction work onto the engineering team. No unit-price leaderboard can settle that.

A minimal reducer with a deliberately narrow contract

The following Python example implements only the destination-eligibility transition for a single current contact. The event is synthetic and already normalized; permanent_invalid is a local policy label. In production, authentication, raw-event validation, documented status mapping, and durable deduplication must precede this function. Permission assessment and dispatch authorization remain separate gates.

from dataclasses import dataclass, replace


@dataclass(frozen=True)
class ContactState:
    contact_id: str
    channel: str
    revision: int
    purpose: str
    suppressed: bool = False
    evidence_id: str | None = None


@dataclass(frozen=True)
class DeliveryEvidence:
    event_id: str
    contact_id: str
    channel: str
    revision: int
    purpose: str
    outcome: str


def apply_evidence(
    state: ContactState, event: DeliveryEvidence
) -> ContactState:
    current_scope = (
        state.contact_id, state.channel, state.revision, state.purpose
    )
    event_scope = (
        event.contact_id, event.channel, event.revision, event.purpose
    )
    if event_scope != current_scope:
        return state
    if state.suppressed or event.outcome != "permanent_invalid":
        return state
    return replace(state, suppressed=True, evidence_id=event.event_id)


contact = ContactState(
    contact_id="tenant-104-phone",
    channel="sms",
    revision=3,
    purpose="passwordless_backup",
)
evidence = DeliveryEvidence(
    event_id="example-event-12",
    contact_id="tenant-104-phone",
    channel="sms",
    revision=3,
    purpose="passwordless_backup",
    outcome="permanent_invalid",
)
updated_contact = apply_evidence(contact, evidence)
Enter fullscreen mode Exit fullscreen mode

The asymmetry is intentional: this reducer can add suppression, but it cannot clear it. A delayed success therefore cannot undo a restriction. A separate correction workflow should verify the replacement contact, establish its revision and eligibility, and retain a reference to the decision that authorized the change.

This code does not persist anything. A production handler must preserve the received evidence and update state under a transaction or equivalent concurrency control; otherwise, two handlers can each operate on a stale snapshot. Test the storage boundary as seriously as the reducer. A clean function with an unsafe commit path is still an unsafe design.

Roll out with explainable decisions

Begin in observation mode, comparing proposed suppression decisions with the existing process without changing dispatch eligibility. Replay synthetic cases for an old revision, a duplicate permanent-invalid event, an email bounce against a phone contact, and a success arriving after suppression. Verify the retained reason for each result, then enable enforcement for a bounded cohort with an explicit rollback owner. These are proposed acceptance tests, not reported production outcomes.

Watch unmatched events, evidence-processing delay, denied dispatches by reason, and corrections awaiting review. Keep tokens and full message bodies out of routine diagnostics. Before expanding the rollout, require an operator to explain one allowed backup alert and one suppressed account notification using their decision records. If that explanation depends on guesswork, the compliance-evidence objective remains unmet.

The release criterion is a traceable eligibility decision for the right recipient revision and purpose, followed by a documented dispatch boundary. That gives property operations a defensible correction process while keeping recovery security, recipient validity, and permission assessment distinct.

References

OWASP's Forgot Password Cheat Sheet supports the recovery-code and request-handling controls discussed above. GDPR Article 7 supports the conditional consent-evidence and withdrawal requirements. Neither source specifies the proposed reducer, retention period, service event vocabulary, or suppression policy; those are design choices requiring local validation.

Sources

Top comments (0)