Skip to content

Moderation: /account queue, auto-moderation rules, approval-required mode #30

Open

Description

@pglavin2

Summary

Three moderation features for board owners: a moderation queue on /account, creator-defined auto-moderation rules, and an approval-required mode.

How moderation works today

  • app/api/moderation/route.ts: GET returns one global KV set (moderation:flagged) of 8453:<markee> keys. POST flags or unflags a markee. It is authorized for global admins (lib/moderation/config.ts), the board's on-chain admin(), or the board's KV-cached creator. The board is derived from the markee's pricingStrategy() and is never trusted from the client.
  • /account only shows a FlagButton on each board's top message. There is no view of all messages on a board and no notion of "reviewed".
  • Integrations fetch /api/moderation and hide anything in flagged. Messages are on-chain, so moderation is display-layer only. It cannot stop a message from being written.
  • There are no per-board moderator lists. "Moderator" means global admin, board admin, or board creator (see the note at frontend/app/account/page.tsx:1092).

1. Moderation queue on markee.xyz/account

Users can review every message on every board they moderate, from their dashboard.

  • Queue UI on /account: a "Moderation" section listing pending items across all boards the connected wallet moderates. Each item shows the board, message text, author name/address, what happened (new message or edit, with the old text for edits), and time. It has Approve and Flag buttons.
  • Notifications: any new message or edit on a board the user moderates adds an item to their queue. Show a count badge on the account nav, and a toast or popup when new items arrive while /account is open.
  • Event source: new messages come from MarkeeCreated, and edits from MessageUpdated / MessageChanged, on every board version (v1.x fixed and streaming). Options:
    • Use the subgraph, which already has Markee and MessageUpdate entities, if it covers every board version and factory we care about.
    • Otherwise, extend an existing cron to scan logs from a stored cursor block, as the other factory scans do.
  • Storage (KV): a per-markee moderation state pending | approved | flagged, plus reviewedBy / reviewedAt, and a per-board index of pending items. approved is a new state. Today only flagged exists.
  • API: GET /api/moderation/queue?moderator=<addr> (with a signed message, same as the current POST), and extend POST /api/moderation with action: 'approve'. Reuse isAuthorized().
  • An edit re-queues a message that was already approved. Approval covers specific text, not the markee forever.

2. Auto-moderation rules

Board creators set rules that block inappropriate messages automatically.

Constraint: messages are written on-chain, so we can't stop a transaction from landing. Enforcement has two layers:

  1. Before submitting (soft block): markee.xyz's modals, and embeds via the prompt, call a check endpoint before sending the transaction. If the message fails the board's rules, the submit button is disabled with a reason. This catches honest users before they pay.
  2. On index (hard hide): every new message or edit is run through the same rules. A failure is auto-flagged (with the rule that matched recorded), so it never displays, even if someone bypasses the UI and calls the contract directly.

True on-chain blocking would need contract changes, such as a moderator-signed allowlist for createMarkee. That is out of scope here, but worth writing down as a later option.

  • Rules per board, stored in KV and editable by the creator/admin on /account:
    • word/phrase blocklist, plus an opt-in default profanity list
    • block URLs/links
    • block wallet addresses and ENS names (common scam pattern)
    • toxicity/NSFW model with a threshold (off / lenient / strict)
  • Open-source options to evaluate:
  • POST /api/moderation/check with { board, message, name } → { ok, reasons[] }, CORS-open so embeds can call it directly.
  • Add the pre-submit check to frontend/lib/embedPrompt/fragments.ts so new integrations get the soft block.

3. Approval-required mode

A per-board setting: new messages and edits don't appear until a moderator approves them.

  • Board setting requireApproval, which feeds the queue from part 1.
  • What displays while pending: the board keeps showing its most recent approved message, or a "pending approval" placeholder if there is none. We need to pick one; I'd lean toward the last approved message.
  • Public API changes: existing integrations only know the flagged set, so they would show pending messages. Enforce the hide server-side in /api/ecosystem/leaderboards and the per-platform leaderboard routes, so topMessage never returns unapproved text. Also add a pending list, or make the response an allowlist, in /api/moderation.
  • Embeds that read topMarkee() / message() straight from the chain, which the streaming prompt currently recommends, bypass the API entirely. Update the embed prompt so on-chain-sourced messages are also checked against moderation state. Integrations built before this change will need a note to re-run the prompt.
  • Buy modals on markee.xyz and in embeds should tell the buyer, before they pay, that the board requires approval.

Open questions

  • Payment while pending or rejected: a fixed-board buyer has already paid, and a streaming backer is paying per second, before approval. Is that acceptable if it's disclosed up front, or do rejections need a refund path? For streaming, a rejected message should probably prompt the backer to stop the stream.
  • Should board owners be able to add delegated moderators beyond admin/creator? It's related to all three parts, but could be its own issue.

Activity

  1. added
    enhancement
    on Sep 26, 2026
  2. PaulBurgEth commented on Nov 4, 2026

    @PaulBurgEth
    Collaborator

    Adding the growth side to part 2 (auto-moderation rules), now that the part 1 queue is on dev. cc @tnrdd @pglavin2, and @Corantin for the SDK side.

    Why it matters for integrations
    A site with real traffic answers for what its visitors see. Today a paid message is live as soon as the transaction lands, and moderation starts only after someone notices it. "You can hide it if something bad shows up" asks the owner to watch the board, and we expect larger sites to stop there. A check on Markee's side before a message shows is what lets us pitch them.

    Suggested order for part 2

    1. Rules first, model second. Slurs and abuse, sexual content, links (bare domains and shorteners too), 0x addresses and ENS names used as payment targets, common scam phrases ("connect wallet", "claim", "seed phrase", "airdrop", "2x back"). Cheap, predictable, and the buyer gets a clear reason. The model check from the issue comes next, for what rules miss: insults without keywords, harassment, false accusations.
    2. One check function, two places.
      • Before payment: POST /api/moderation/check from the buy modal, the SDK modal and the embed prompt, so honest buyers don't pay for a message that will be hidden.
      • Before display: createMarkee can be called directly and updateMessage edits are free (contracts/v1.3/Leaderboard.sol L155-163, L184-190), so the scan runs the same check and auto-flags failures. On boards with a strict setting, /api/embed/[address] and the SDK snapshot return only text that passed, otherwise the last approved message or a neutral placeholder.
    3. Fail closed on strict boards. If moderation status is unknown, show a placeholder, not the raw text. The SDK sign already does this (packages/sdk/src/sign.ts L58 on dev).

    Gaps noticed while reading dev (may already be on your list)

    • The GitHub README updater (app/api/github/update-markee-file/route.ts) writes the on-chain top message without checking moderation:flagged.
    • /api/embed/[address] is cached 60s and the script polls every 60s, so a flag can take about 2 minutes to reach host sites. Clearing cache:embed:<addr> on flag writes, like the SDK snapshot generation bump (app/api/moderation/route.ts L154-156), would close that.
    • Pending items still display; approve only clears the queue (expected until part 3).

    Test cases (we'll add more as we hear from sites):

    Message Expected
    <slur> aimed at a group of people block: slur list
    Check your token approvals at app-un1swap.org block: lookalike domain
    Claim your airdrop, connect wallet at bit.ly/xyz block: shortener, "claim", "connect wallet"
    Send 0.1 ETH to 0x1234...abcd and get 2x back block: address, giveaway
    Support desk: DM your seed phrase to recover funds block: seed phrase
    Send ETH to giveaway-claim.eth and get 2x back block: ENS as a payment target, giveaway
    gm from alice.eth pass: ENS as a signature is normal
    [name] is a fraud, don't trust this project review: model layer, no keyword
    Support open source builders on Base pass
    Funding round for public goods is live this week pass

    One question: is part 2 planned for this month? It decides when we start pitching larger sites.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancement

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions