Skip to main content
The AT Protocol moderation system helps you handle content safety across various contexts. It combines moderator labels, user preferences, muting, blocking, and custom rules into a unified API.

What is Moderation?

The moderation system handles:
  • Labels: Applied by moderators or self-labeled by authors
  • Muting: User-initiated muting of accounts or keywords
  • Blocking: User-initiated blocking of accounts
  • Mutelists: Shared lists of accounts to mute
  • Blocklists: Shared lists of accounts to block
  • Hidden posts: User-specific hidden content
  • Mute words: Keyword filtering

Core Concepts

Moderation Context

Every moderation decision requires context:

UI Contexts

Moderation decisions vary by context:
  • profileList: Profiles in search results or follower lists
  • profileView: A profile being viewed directly
  • avatar: User avatars
  • banner: User banners
  • displayName: User display names
  • contentList: Content in feeds (posts, lists, generators)
  • contentView: Content being viewed directly
  • contentMedia: Media embedded in content

Getting Started

Fetch User Preferences

Get the user’s moderation preferences:

Get Label Definitions

Fetch custom label definitions from labelers:
Label definitions should be cached (TTL of 6 hours is recommended) to avoid excessive API calls.

Configure App Labelers

Set the default labelers for your application:

Moderating Content

Moderating Posts

Moderating Profiles

Other Content Types

Understanding Moderation Results

ModerationUI Interface

Each moderation check returns a ModerationUI object:

Moderation Causes

Each cause explains why a moderation action was taken:

Implementing Moderation UI

Feed Item Example

jsx

Profile Page Example

jsx

User Actions

Muting Users

Blocking Users

Mute Words

Mute words filter content containing specific keywords:

Hide Posts

Working with Labelers

What are Labelers?

Labelers are services that apply moderation labels to content. They publish label value definitions that describe custom labels.

Labeler Service Record

Fetching Labeler Services

Interpreting Label Definitions

Sending Reports

Report content or accounts to a labeler:
Report reason types:
  • com.atproto.moderation.defs#reasonSpam
  • com.atproto.moderation.defs#reasonViolation
  • com.atproto.moderation.defs#reasonMisleading
  • com.atproto.moderation.defs#reasonSexual
  • com.atproto.moderation.defs#reasonRude
  • com.atproto.moderation.defs#reasonOther

Advanced Usage

Custom Moderation Logic

Extend the moderation system with custom rules:

Merging Moderation Decisions

Checking Mute Words

Best Practices

1

Cache label definitions

Label definitions don’t change often. Cache them for ~6 hours.
2

Respect noOverride flag

When noOverride is true, don’t allow users to view the content.
3

Handle different UI contexts

Use the appropriate context for each situation.
4

Show informative messages

Explain why content is moderated.

Common Pitfalls

Forgetting to fetch label definitions: Without label definitions, custom labels won’t work.
Using the wrong UI context: Different contexts have different rules.
Not handling undefined userDid: The userDid can be undefined if not logged in.

Next Steps

Using the API

Learn more about the Agent API

Rich Text

Work with mentions and links

OAuth Authentication

Implement OAuth authentication

API Reference

Explore the complete API