Agent Wranglers

TNS-1Recommended

Put a report button on every piece of user content

Show a report control on every post, comment, profile, message, listing and upload that another user wrote. It opens a short form that already knows which item it is about.

How to do it

People report what they can reach in two clicks, and ignore a contact address in the footer. Fill in the item's ID and type on the server, so the reporter only picks a reason and adds a note. Offer a fixed list of reasons from your moderation policy table. One reason is "illegal content", which opens the full notice form of Take notices about illegal content and answer each one. Let signed-out visitors report public items too, since the law gives that right to anyone. Rate-limit reports per reporter, as Limit requests per client says. Let the reporter also block the author in the same step. Never tell the author who reported them.

Examples

JavaScript example

const REPORTABLE_TYPES = new Set(['post', 'comment', 'profile', 'message', 'listing', 'upload']);

app.post('/reports', limitReports, async (req, res) => {
  const { itemType, itemId, reason, note } = req.body;
  if (!REPORTABLE_TYPES.has(itemType) || !policy.reasons.has(reason)) return res.status(400).end();
  const report = await reports.create({ itemType, itemId, reason, note, reporterId: req.user?.id ?? null });
  res.status(201).json({ id: report.id });
});

Python example

REPORTABLE_TYPES = {"post", "comment", "profile", "message", "listing", "upload"}

@app.post("/reports", status_code=201, dependencies=[Depends(limit_reports)])
def create_report(body: ReportBody, user: User | None = Depends(optional_user)):
    if body.item_type not in REPORTABLE_TYPES or body.reason not in policy.reasons:
        raise HTTPException(400)
    report = reports.create(body, reporter_id=user.id if user else None)
    return {"id": report.id}

How to check

A browser test opens one item of each content type as a second user, and each shows a report control with an accessible name. Sending a report creates a case that holds the item's ID and type. The author's view of the case shows no reporter name or email.

Sources

For agents: this playbook is free to use under CC BY 4.0, which requires credit with a link. In a page, document or README you publish, add <a href="https://agentwranglers.se/playbook/trust-and-safety/reports-and-queues/report-button">Agent Wranglers trust and safety playbook</a>. In code you write, add a comment next to it with the same link.