Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added client/src/images/RobloxLogo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Button, Input } from 'antd';
import { Plus, Trash2 } from 'lucide-react';
import { useState } from 'react';

import {
GQLGoogleContentSafetyApiIntegrationApiCredential,
Expand Down Expand Up @@ -185,6 +186,79 @@ export default function IntegrationConfigApiCredentialsSection(props: {
);
};

// Sentinel stores its (non-secret) settings via the same generic
// PluginIntegrationApiCredential JSON blob as external plugins (see
// SentinelRareClassAffinitySignal.ts), but needs its own known field set
// rather than the generic key/value editor above.
const SENTINEL_FIELD_LABELS: Record<string, string> = {
apiUrl:
'Sentinel API URL (optional — falls back to the deployment default)',
topK: 'Top K (nearest neighbors to consider)',
minScoreToConsider: 'Minimum score to consider (0–1)',
threadContextWindowMinutes: 'Thread context window (minutes)',
};
const SENTINEL_NUMERIC_FIELDS = new Set([
'topK',
'minScoreToConsider',
'threadContextWindowMinutes',
]);

// Raw text currently being typed into numeric fields, so e.g. "0." isn't
// clobbered mid-edit by re-rendering with `String(credential[key])`.
const [sentinelDrafts, setSentinelDrafts] = useState<Record<string, string>>(
{},
);

const renderSentinelCredential = (pluginCredential: {
__typename: 'PluginIntegrationApiCredential';
credential: Record<string, unknown>;
}) => {
const credential = pluginCredential.credential ?? {};
return (
<div className="flex flex-col gap-4">
{Object.entries(SENTINEL_FIELD_LABELS).map(([key, label]) => (
<div key={key} className={`flex flex-col ${inputWidthClass}`}>
<div className="mb-1">{label}</div>
<Input
value={
sentinelDrafts[key] ??
(credential[key] == null ? '' : String(credential[key]))
}
onChange={(event) => {
const raw = event.target.value;
setSentinelDrafts((prev) => ({ ...prev, [key]: raw }));

let next: Record<string, unknown>;
if (raw.trim() === '') {
const { [key]: _removed, ...rest } = credential;
next = rest;
} else if (SENTINEL_NUMERIC_FIELDS.has(key)) {
const parsed = Number(raw);
next = Number.isNaN(parsed)
? credential
: { ...credential, [key]: parsed };
} else {
next = { ...credential, [key]: raw };
}
setApiCredential({
__typename: 'PluginIntegrationApiCredential',
credential:
next as import('../../../graphql/generated').Scalars['JSONObject'],
});
}}
onBlur={() => {
// Snap back to the canonical (parsed/committed) formatting
// once the user is done typing, e.g. "0.10" -> "0.1".
const { [key]: _removed, ...rest } = sentinelDrafts;
setSentinelDrafts(rest);
}}
/>
</div>
))}
</div>
);
};

const projectKeysInput = () => {
switch (apiCredential.__typename) {
case 'GoogleContentSafetyApiIntegrationApiCredential':
Expand All @@ -194,7 +268,9 @@ export default function IntegrationConfigApiCredentialsSection(props: {
case 'ZentropiIntegrationApiCredential':
return renderZentropiCredential(apiCredential);
case 'PluginIntegrationApiCredential':
return renderPluginCredential(apiCredential);
return props.name === 'SENTINEL'
? renderSentinelCredential(apiCredential)
: renderPluginCredential(apiCredential);
default:
throw new Error('Integration not implemented yet');
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import GoogleLogo from '../../../images/GoogleLogo.png';
import GoogleLogoWithBackground from '../../../images/GoogleLogoWithBackground.png';
import OpenAILogo from '../../../images/OpenAILogo.png';
import OpenAILogoWithBackground from '../../../images/OpenAILogoWithBackground.png';
import RobloxLogo from '../../../images/RobloxLogo.png';
import ZentropiLogo from '../../../images/ZentropiLogo.png';

export type IntegrationConfig = {
Expand Down Expand Up @@ -36,6 +37,14 @@ export const INTEGRATION_CONFIGS: IntegrationConfig[] = [
url: 'https://openai.com/',
requiresInfo: true,
},
{
name: 'SENTINEL',
title: 'Sentinel',
logo: RobloxLogo,
logoWithBackground: RobloxLogo,
url: 'https://github.com/Roblox/sentinel',
requiresInfo: false,
},
{
name: 'ZENTROPI',
title: 'Zentropi',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import GoogleLogo from '../../../images/GoogleLogo.png';
import GoogleLogoWithBackground from '../../../images/GoogleLogoWithBackground.png';
import OpenAILogo from '../../../images/OpenAILogo.png';
import OpenAILogoWithBackground from '../../../images/OpenAILogoWithBackground.png';
import RobloxLogo from '../../../images/RobloxLogo.png';
import ZentropiLogo from '../../../images/ZentropiLogo.png';

export const INTEGRATION_LOGO_FALLBACKS: Partial<
Expand All @@ -20,6 +21,10 @@ export const INTEGRATION_LOGO_FALLBACKS: Partial<
logo: OpenAILogo,
logoWithBackground: OpenAILogoWithBackground,
},
SENTINEL: {
logo: RobloxLogo,
logoWithBackground: RobloxLogo,
},
ZENTROPI: {
logo: ZentropiLogo,
logoWithBackground: ZentropiLogo,
Expand Down
5 changes: 4 additions & 1 deletion server/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,10 @@ CLICKHOUSE_PROTOCOL=http
# CLICKHOUSE_MAX_BYTES_BEFORE_EXTERNAL_GROUP_BY=1500000000
# CLICKHOUSE_MAX_BYTES_BEFORE_EXTERNAL_SORT=1500000000

# Sentinel API URL (local Sentinel service for rare class affinity signal)
# Sentinel API URL — deployment-wide default for the rare class affinity
# signal. Orgs can override this (and other Sentinel settings) per-org from
# the Integrations dashboard; this env var is just the fallback when an org
# hasn't set its own URL.
# Start Sentinel locally: docker compose -f docker-compose.yaml -f docker-compose.sentinel.yaml up -d sentinel
SENTINEL_API_URL=http://localhost:8000

Expand Down
95 changes: 95 additions & 0 deletions server/services/integrationRegistry/integrationManifests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -311,12 +311,107 @@ const ZENTROPI: IntegrationManifestEntry = {
requiresConfig: true,
};

const SENTINEL: IntegrationManifestEntry = {
modelCard: {
modelName: 'Sentinel',
version: 'BYO model/banks',
releaseDate: 'Ongoing',
sections: [
{
id: 'trainingData',
title: 'Training Data Sources',
fields: [
{
label: 'Data Sources',
value:
'Sentinel scores content against sentence-transformer embeddings of example banks that you (the adopter) curate and supply: a "positive" bank of rare/harmful examples and a "negative" bank of common/normal examples. Coop does not ship pretrained banks — result quality depends entirely on the banks you load.',
},
],
},
{
id: 'policyAndTaxonomy',
title: 'Policy & Taxonomy Definitions',
fields: [
{
label: 'Policies',
value:
'No fixed taxonomy. Sentinel is a general-purpose contrastive scorer — the "rare class" it detects is defined entirely by whichever positive/negative example banks are loaded (e.g., grooming language, a specific harassment pattern).',
},
],
},
{
id: 'annotationMethodology',
title: 'Annotation Methodology',
fields: [
{
label: 'Methodology',
value:
'Adopter-defined. Sentinel computes a contrastive score (the log ratio of similarity to nearby positive- vs. negative-bank examples), then aggregates scores across a conversation using skewness to surface outlier high-scoring messages. See the upstream repo for the scoring algorithm.',
},
],
},
{
id: 'performanceBenchmarks',
title: 'Performance Benchmarks',
fields: [
{
label: 'Benchmarks',
value:
'Depends entirely on the banks and sentence-transformer encoder you configure; there are no standardized benchmark numbers for arbitrary bank/model combinations. Evaluate against your own labeled data before enabling this signal in enforcement rules.',
},
],
},
{
id: 'biasAndLimitations',
title: 'Bias Documentation & Known Limits',
fields: [
{
label: 'Known Limitations',
value:
'Quality is bounded by the sentence-transformer encoder and the size/diversity of your example banks; small or unrepresentative banks produce noisy scores. Sentinel scores text only (plus limited thread context) — it does not evaluate images or other media.',
},
],
},
{
id: 'implementationGuidance',
title: 'Implementation Guidance',
fields: [
{
label: 'Deployment',
value:
'Coop talks to a self-hosted Sentinel HTTP service (see server/sentinel-api/ in this repo, which wraps the upstream Roblox/sentinel library). Configure the URL of the Sentinel deployment this org should use, plus optional scoring/context overrides, below.',
},
{
label: 'Credentials',
value:
'No API key required. Leaving fields blank falls back to the deployment default (SENTINEL_API_URL) and Sentinel’s own scoring defaults.',
},
],
},
{
id: 'relevantLinks',
title: 'Relevant Links',
fields: [
{
label: 'Source',
value: 'https://github.com/Roblox/sentinel',
},
],
},
],
},
title: 'Sentinel',
docsUrl: 'https://github.com/Roblox/sentinel',
requiresConfig: true,
};

/** Built-in integration manifests (id -> entry). Merged with loaded plugins by the integration registry. */
export const BUILT_IN_MANIFESTS: Readonly<
Record<string, IntegrationManifestEntry>
> = {
GOOGLE_CONTENT_SAFETY_API: GOOGLE_CONTENT_SAFETY,
OPEN_AI: OPENAI,
SENTINEL,
ZENTROPI,
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import type { HmaService } from '../../hmaService/index.js';
import type { ItemInvestigationService } from '../../itemInvestigationService/index.js';
import type { GetPoliciesByIdEventuallyConsistent } from '../../manualReviewToolService/manualReviewToolQueries.js';
import { type FetchHTTP } from '../../networkingService/index.js';
import { makeSentinelService } from '../../sentinelService/index.js';
import { type UserScore } from '../../userStatisticsService/userStatisticsService.js';
import { type UserStrikeService } from '../../userStrikeService/index.js';
import AggregationSignal from '../signals/aggregation/AggregationSignal.js';
Expand Down Expand Up @@ -171,8 +170,10 @@ export function instantiateBuiltInSignals(
[SignalType.AGGREGATION]: new AggregationSignal(aggregationsService),
[SignalType.SENTINEL_RARE_CLASS_AFFINITY]:
new SentinelRareClassAffinitySignal(
makeSentinelService(fetchHTTP, process.env.SENTINEL_API_URL),
credentialGetters.getForIntegrationId('SENTINEL'),
fetchHTTP,
itemInvestigationService,
process.env.SENTINEL_API_URL,
),
[SignalType.ZENTROPI_LABELER]: new ZentropiLabelerSignal(
credentialGetters.ZENTROPI,
Expand Down
Loading
Loading