> ## Documentation Index
> Fetch the complete documentation index at: https://docs.pup.run/llms.txt
> Use this file to discover all available pages before exploring further.

# Message-spam protection

> Configure explainable message-rate signals and their durable security-response handoff.

Message-spam protection evaluates twelve independent signals: short bursts,
consecutive duplicates, repeated content across interleaved messages, sustained
message rate, link rate, uppercase proportion, repeated characters, repeated
tokens, combining-mark distortion, and invite bursts, repeats, and destination
rates. Link counting is separate from domain allow/deny rules.

Each server can choose member-and-channel or member-and-server scope, configure
an individual threshold and rolling window for every signal, and exempt selected
channels, roles, or members. Invite protection additionally accepts an allow-list
of approved invite destinations (the invite code after normalization). Modes are
disabled, observe, review, and enforce. All of these choices are stored with a
per-server policy revision; none is a product-wide moderation policy.

Decisions include the matching signal, observed count, threshold, window, scope,
mode, policy revision, and correlation ID. The handoff is durable and idempotent.
Queue delivery failures remain visible in operator diagnostics and are retried
without creating a second decision.

## Invite protection

Invite matching recognizes `discord.gg/code`, `discord.com/invite/code`, and
the older `discordapp.com/invite/code` form. It normalizes Unicode compatibility
characters and removes whitespace and zero-width formatting before matching, so
formats such as `discord . gg / code` resolve to the same destination. Only
normalized destination codes and counts are retained, never message content.

An invite decision is routed through the existing security incident projection.
An active `message_spam` security rule controls the configured response and its
review/enforcement ownership; review-mode decisions create the normal durable
review path. The outbox delivery is idempotent, so a worker retry resumes that
same incident/review route rather than producing a second moderation response.
Before enabling enforcement, use the detector preview and a disposable server to
check approved destinations, scope, exemptions, and the selected response rule.

Only a SHA-256 content fingerprint, link count, routing identifiers, and timestamp
are retained for rolling-window evaluation. Raw message content is not stored by
this detector. Automated repository checks do not replace disposable-server
acceptance before enforcement is enabled.

## Uppercase proportion

Each server chooses the uppercase percentage and the minimum message length and
number of cased letters required before this signal is considered. A match records
the uppercase and cased-letter counts plus those three configured values, so a
reviewer can see why it matched without retrieving message text. The same
channel, role, and member exemptions apply before any signal is evaluated.

The detector uses Unicode uppercase and lowercase letter categories. Scripts with
no case distinction (for example Chinese, Japanese, Korean, Arabic, and emoji)
do not contribute letters and cannot match this signal; short content cannot
match it either. That is a language limitation, not a moderation judgment. In
review mode, a match is routed as one durable reviewed decision and does not
delete, warn, or timeout a member.

## Repetition and visually distorted text

The repetition and distortion signals use Unicode normalization to count adjacent
repeated characters, adjacent repeated word-like tokens, and combining marks.
Each server chooses a minimum length plus maximum repeat and combining-mark
ratios. It can exempt code blocks and the detected `ar`, `en`, `ja`, `ko`, or `zh`
script family where local language conventions make these signals unsuitable.
The same channel, role, and member exemptions apply.

Pup retains only ratios, a coarse language family, code-block presence, and a
categorical normalized preview such as `[visually-distorted text normalized]`.
It never retains the message text for this detector, and the preview deliberately
does not repeat the triggering text or reveal configured limits. Detection is a
review aid, not a claim that stylized or non-Latin writing is abusive.
