Skip to main content
Metadata enriches your moderation requests with contextual information. This enables powerful features like Risk Scoring, detailed analytics, and better audit trails.

Metadata Levels

White Circle supports metadata at two levels:

Session-Level Metadata

Add context about the session or environment at the request level:

Session Fields

Environment Fields

The environment object accepts any key-value pairs for custom context:
Values can be strings, numbers, or booleans.

Message-Level Metadata

Attach metadata to individual messages to provide context about who sent them and when:

User Metadata

Attach user information to messages with role: "user":
User metadata powers Risk Scoring. Include at least one stable identifier in metadata.user (id or email) to track policy violations per user over time, and optionally include ip as supplemental context since IP addresses can change.

Assistant Metadata

Attach AI response details to messages with role: "assistant": This data enables performance analytics in the White Circle dashboard.

Message Metadata

Attach identifiers and timestamps to any message:

Full Example

Use Cases

Risk Scoring

Include user.id, user.email, or user.ip to enable risk scoring. White Circle aggregates violations per user to detect high-risk accounts.

Audit Trails

Include message.id and message.timestamp for detailed logging and compliance.

Analytics

Include environment data to segment moderation results by app version, platform, or feature.

Best Practices

To use Risk Scoring, include at least one identifier in your message metadata (user.id, user.email, or user.ip):
For best correlation, include both id and email when available. Add ip as supplemental context when you trust the source IP.
Always use the same user.id and normalized user.email for the same user across requests. Use user.ip as supplemental context, because IPs can change. Inconsistent identifiers create separate profiles and fragment risk scoring data.
If you use multiple AI models, track their performance:
This data appears in your White Circle dashboard for analysis.