atproto/packages/api/docs/moderation.md

261 lines
7.1 KiB
Markdown
Raw Permalink Normal View History

Labeling & moderation updates to SDK (#1366) * First pass on label definitions and reference-doc generation for them * Tune labels * Drop the 'csam' label in favor of using !hide CSAM is an extremely delicate issue. Moderators must be careful to remove it from the system without calling direct attention to it. Using the generic !hide achieves the same effect while obscuring the reason for the removal. Server and AppView bans will then be employed (along with any other needed mechanisms) to strip the content from the network. There is also a 'false accusation' concern with using the csam label. Fingerprinting techniques and AI are used to scan for csam. These are capable of producing false positives which will then be reverted after human review. The reputational damage caused by a false positive could be severe, so we want to be careful about any system which might publicize a false positive. * Add label definition code generation * Implement all type signatures for moderation * Complete a first pass on the labeling sdk * Add post-moderation test suite * Add post moderation behavior documentation * Add self-post behaviors * Improve post moderation doc * Tune up the post moderation doc * Tune up the post moderation doc * Tune up the post moderation doc * Simplify the post moderation behavior descriptions * More behavior description tuneup * Add profile moderation final behaviors and tests * Improve generated post-moderation-behaviors doc * Add profile moderation behaviors doc * Test muted-by-list specifically * Fixes to label descriptions * Fix to muted-by-list behavior * Dont blur account in moderateProfile() when muting * Tune label copy * Apply post embed blurring when account is marked with blurmedia label * Fix output signature * Fixes to blocking behavior * Rename LabelDefinitionPreference to LabelPreference * Update docs * Fix test * Fix: self-harm should blur media only * Fixes to tests * Improve label copy * Remove all labels that do not have a specific policy Communicating moderation policies with active users is important. This PR originally included labels which were proposed but did not yet have policies. While we didn't intend to use them until a policy was established, I decided it's better to hold off putting them in the code until we're sure about them. They can be found in backup files prefixed with "proposed-".
2023-08-03 10:28:06 -07:00
# Moderation API
Applying the moderation system is a challenging task, but we've done our best to simplify it for you. The Moderation API helps handle a wide range of tasks, including:
Additional 3p labeler updates (#2286) * Rename bsky_labeler_did * Use labeldef default setting * Add definedBy to interpretted label defs * Improve dev-env mocks for labels * Remove global label defs for dmca-violation, doxxing, and !no-promote * Change nudity global label def to default to ignore and no longer be adult-only * Remove old !no-promote tests * Add mod authorities header and move bsky labeler into it * Rename modsPref and addModService/removeModService to labelersPref and add/removeLabeler * Add defaultSetting and adultOnly to custom label value definitions * Rename InterprettedLabelValueDefinition to InterpretedLabelValueDefinition * Update dev-env mock * Move muted words and hidden posts into moderationPrefs * Add muted word and hidden post handling to moderatePost * Add mutewords tests * Finish muteword tests * Add mod-authority.test to dev-env * Rename global label value def gore to graphic-media * Fix typo * Stop converting old label values * Update label target=profile behaviors: dont filter content on hide, dont blur display names, but do show the info cards * Update label target=account behaviors: dont blur media of content * Add muteword moderation behaviors * Fix mock label defs * Implement quote-post moderation handling * Add adult content test * Handle sync legacy labels (#2291) * Handle sync legacy labels * Remap values on read * Filter out double-written legacy label values * Better naming, fix types * Fix test * Update moderation docs in sdk * Update to new atproto-accept-labelers header behavior * Add getLabelDefinitions() helper method * Add proxy header support to agent * Update mock moderation * lint * Implement moderation for userlists and feedgens * Add another test label * fix labeler in dev-env agents * fix label hydration test * fix lint error * fix agent test * fix takedown labels test --------- Co-authored-by: Eric Bailey <git@esb.lol> Co-authored-by: dholms <dtholmgren@gmail.com>
2024-03-12 21:10:19 -07:00
- Moderator labeling
Labeling & moderation updates to SDK (#1366) * First pass on label definitions and reference-doc generation for them * Tune labels * Drop the 'csam' label in favor of using !hide CSAM is an extremely delicate issue. Moderators must be careful to remove it from the system without calling direct attention to it. Using the generic !hide achieves the same effect while obscuring the reason for the removal. Server and AppView bans will then be employed (along with any other needed mechanisms) to strip the content from the network. There is also a 'false accusation' concern with using the csam label. Fingerprinting techniques and AI are used to scan for csam. These are capable of producing false positives which will then be reverted after human review. The reputational damage caused by a false positive could be severe, so we want to be careful about any system which might publicize a false positive. * Add label definition code generation * Implement all type signatures for moderation * Complete a first pass on the labeling sdk * Add post-moderation test suite * Add post moderation behavior documentation * Add self-post behaviors * Improve post moderation doc * Tune up the post moderation doc * Tune up the post moderation doc * Tune up the post moderation doc * Simplify the post moderation behavior descriptions * More behavior description tuneup * Add profile moderation final behaviors and tests * Improve generated post-moderation-behaviors doc * Add profile moderation behaviors doc * Test muted-by-list specifically * Fixes to label descriptions * Fix to muted-by-list behavior * Dont blur account in moderateProfile() when muting * Tune label copy * Apply post embed blurring when account is marked with blurmedia label * Fix output signature * Fixes to blocking behavior * Rename LabelDefinitionPreference to LabelPreference * Update docs * Fix test * Fix: self-harm should blur media only * Fixes to tests * Improve label copy * Remove all labels that do not have a specific policy Communicating moderation policies with active users is important. This PR originally included labels which were proposed but did not yet have policies. While we didn't intend to use them until a policy was established, I decided it's better to hold off putting them in the code until we're sure about them. They can be found in backup files prefixed with "proposed-".
2023-08-03 10:28:06 -07:00
- User muting (including mutelists)
- User blocking
Additional 3p labeler updates (#2286) * Rename bsky_labeler_did * Use labeldef default setting * Add definedBy to interpretted label defs * Improve dev-env mocks for labels * Remove global label defs for dmca-violation, doxxing, and !no-promote * Change nudity global label def to default to ignore and no longer be adult-only * Remove old !no-promote tests * Add mod authorities header and move bsky labeler into it * Rename modsPref and addModService/removeModService to labelersPref and add/removeLabeler * Add defaultSetting and adultOnly to custom label value definitions * Rename InterprettedLabelValueDefinition to InterpretedLabelValueDefinition * Update dev-env mock * Move muted words and hidden posts into moderationPrefs * Add muted word and hidden post handling to moderatePost * Add mutewords tests * Finish muteword tests * Add mod-authority.test to dev-env * Rename global label value def gore to graphic-media * Fix typo * Stop converting old label values * Update label target=profile behaviors: dont filter content on hide, dont blur display names, but do show the info cards * Update label target=account behaviors: dont blur media of content * Add muteword moderation behaviors * Fix mock label defs * Implement quote-post moderation handling * Add adult content test * Handle sync legacy labels (#2291) * Handle sync legacy labels * Remap values on read * Filter out double-written legacy label values * Better naming, fix types * Fix test * Update moderation docs in sdk * Update to new atproto-accept-labelers header behavior * Add getLabelDefinitions() helper method * Add proxy header support to agent * Update mock moderation * lint * Implement moderation for userlists and feedgens * Add another test label * fix labeler in dev-env agents * fix label hydration test * fix lint error * fix agent test * fix takedown labels test --------- Co-authored-by: Eric Bailey <git@esb.lol> Co-authored-by: dholms <dtholmgren@gmail.com>
2024-03-12 21:10:19 -07:00
- Mutewords
- Hidden posts
Labeling & moderation updates to SDK (#1366) * First pass on label definitions and reference-doc generation for them * Tune labels * Drop the 'csam' label in favor of using !hide CSAM is an extremely delicate issue. Moderators must be careful to remove it from the system without calling direct attention to it. Using the generic !hide achieves the same effect while obscuring the reason for the removal. Server and AppView bans will then be employed (along with any other needed mechanisms) to strip the content from the network. There is also a 'false accusation' concern with using the csam label. Fingerprinting techniques and AI are used to scan for csam. These are capable of producing false positives which will then be reverted after human review. The reputational damage caused by a false positive could be severe, so we want to be careful about any system which might publicize a false positive. * Add label definition code generation * Implement all type signatures for moderation * Complete a first pass on the labeling sdk * Add post-moderation test suite * Add post moderation behavior documentation * Add self-post behaviors * Improve post moderation doc * Tune up the post moderation doc * Tune up the post moderation doc * Tune up the post moderation doc * Simplify the post moderation behavior descriptions * More behavior description tuneup * Add profile moderation final behaviors and tests * Improve generated post-moderation-behaviors doc * Add profile moderation behaviors doc * Test muted-by-list specifically * Fixes to label descriptions * Fix to muted-by-list behavior * Dont blur account in moderateProfile() when muting * Tune label copy * Apply post embed blurring when account is marked with blurmedia label * Fix output signature * Fixes to blocking behavior * Rename LabelDefinitionPreference to LabelPreference * Update docs * Fix test * Fix: self-harm should blur media only * Fixes to tests * Improve label copy * Remove all labels that do not have a specific policy Communicating moderation policies with active users is important. This PR originally included labels which were proposed but did not yet have policies. While we didn't intend to use them until a policy was established, I decided it's better to hold off putting them in the code until we're sure about them. They can be found in backup files prefixed with "proposed-".
2023-08-03 10:28:06 -07:00
## Configuration
Every moderation function takes a set of options which look like this:
```typescript
{
// the logged-in user's DID
userDid: 'did:plc:1234...',
Additional 3p labeler updates (#2286) * Rename bsky_labeler_did * Use labeldef default setting * Add definedBy to interpretted label defs * Improve dev-env mocks for labels * Remove global label defs for dmca-violation, doxxing, and !no-promote * Change nudity global label def to default to ignore and no longer be adult-only * Remove old !no-promote tests * Add mod authorities header and move bsky labeler into it * Rename modsPref and addModService/removeModService to labelersPref and add/removeLabeler * Add defaultSetting and adultOnly to custom label value definitions * Rename InterprettedLabelValueDefinition to InterpretedLabelValueDefinition * Update dev-env mock * Move muted words and hidden posts into moderationPrefs * Add muted word and hidden post handling to moderatePost * Add mutewords tests * Finish muteword tests * Add mod-authority.test to dev-env * Rename global label value def gore to graphic-media * Fix typo * Stop converting old label values * Update label target=profile behaviors: dont filter content on hide, dont blur display names, but do show the info cards * Update label target=account behaviors: dont blur media of content * Add muteword moderation behaviors * Fix mock label defs * Implement quote-post moderation handling * Add adult content test * Handle sync legacy labels (#2291) * Handle sync legacy labels * Remap values on read * Filter out double-written legacy label values * Better naming, fix types * Fix test * Update moderation docs in sdk * Update to new atproto-accept-labelers header behavior * Add getLabelDefinitions() helper method * Add proxy header support to agent * Update mock moderation * lint * Implement moderation for userlists and feedgens * Add another test label * fix labeler in dev-env agents * fix label hydration test * fix lint error * fix agent test * fix takedown labels test --------- Co-authored-by: Eric Bailey <git@esb.lol> Co-authored-by: dholms <dtholmgren@gmail.com>
2024-03-12 21:10:19 -07:00
moderationPrefs: {
// is adult content allowed?
adultContentEnabled: true,
Labeling & moderation updates to SDK (#1366) * First pass on label definitions and reference-doc generation for them * Tune labels * Drop the 'csam' label in favor of using !hide CSAM is an extremely delicate issue. Moderators must be careful to remove it from the system without calling direct attention to it. Using the generic !hide achieves the same effect while obscuring the reason for the removal. Server and AppView bans will then be employed (along with any other needed mechanisms) to strip the content from the network. There is also a 'false accusation' concern with using the csam label. Fingerprinting techniques and AI are used to scan for csam. These are capable of producing false positives which will then be reverted after human review. The reputational damage caused by a false positive could be severe, so we want to be careful about any system which might publicize a false positive. * Add label definition code generation * Implement all type signatures for moderation * Complete a first pass on the labeling sdk * Add post-moderation test suite * Add post moderation behavior documentation * Add self-post behaviors * Improve post moderation doc * Tune up the post moderation doc * Tune up the post moderation doc * Tune up the post moderation doc * Simplify the post moderation behavior descriptions * More behavior description tuneup * Add profile moderation final behaviors and tests * Improve generated post-moderation-behaviors doc * Add profile moderation behaviors doc * Test muted-by-list specifically * Fixes to label descriptions * Fix to muted-by-list behavior * Dont blur account in moderateProfile() when muting * Tune label copy * Apply post embed blurring when account is marked with blurmedia label * Fix output signature * Fixes to blocking behavior * Rename LabelDefinitionPreference to LabelPreference * Update docs * Fix test * Fix: self-harm should blur media only * Fixes to tests * Improve label copy * Remove all labels that do not have a specific policy Communicating moderation policies with active users is important. This PR originally included labels which were proposed but did not yet have policies. While we didn't intend to use them until a policy was established, I decided it's better to hold off putting them in the code until we're sure about them. They can be found in backup files prefixed with "proposed-".
2023-08-03 10:28:06 -07:00
Additional 3p labeler updates (#2286) * Rename bsky_labeler_did * Use labeldef default setting * Add definedBy to interpretted label defs * Improve dev-env mocks for labels * Remove global label defs for dmca-violation, doxxing, and !no-promote * Change nudity global label def to default to ignore and no longer be adult-only * Remove old !no-promote tests * Add mod authorities header and move bsky labeler into it * Rename modsPref and addModService/removeModService to labelersPref and add/removeLabeler * Add defaultSetting and adultOnly to custom label value definitions * Rename InterprettedLabelValueDefinition to InterpretedLabelValueDefinition * Update dev-env mock * Move muted words and hidden posts into moderationPrefs * Add muted word and hidden post handling to moderatePost * Add mutewords tests * Finish muteword tests * Add mod-authority.test to dev-env * Rename global label value def gore to graphic-media * Fix typo * Stop converting old label values * Update label target=profile behaviors: dont filter content on hide, dont blur display names, but do show the info cards * Update label target=account behaviors: dont blur media of content * Add muteword moderation behaviors * Fix mock label defs * Implement quote-post moderation handling * Add adult content test * Handle sync legacy labels (#2291) * Handle sync legacy labels * Remap values on read * Filter out double-written legacy label values * Better naming, fix types * Fix test * Update moderation docs in sdk * Update to new atproto-accept-labelers header behavior * Add getLabelDefinitions() helper method * Add proxy header support to agent * Update mock moderation * lint * Implement moderation for userlists and feedgens * Add another test label * fix labeler in dev-env agents * fix label hydration test * fix lint error * fix agent test * fix takedown labels test --------- Co-authored-by: Eric Bailey <git@esb.lol> Co-authored-by: dholms <dtholmgren@gmail.com>
2024-03-12 21:10:19 -07:00
// the global label settings (used on self-labels)
labels: {
porn: 'hide',
sexual: 'warn',
nudity: 'ignore',
// ...
},
Additional 3p labeler updates (#2286) * Rename bsky_labeler_did * Use labeldef default setting * Add definedBy to interpretted label defs * Improve dev-env mocks for labels * Remove global label defs for dmca-violation, doxxing, and !no-promote * Change nudity global label def to default to ignore and no longer be adult-only * Remove old !no-promote tests * Add mod authorities header and move bsky labeler into it * Rename modsPref and addModService/removeModService to labelersPref and add/removeLabeler * Add defaultSetting and adultOnly to custom label value definitions * Rename InterprettedLabelValueDefinition to InterpretedLabelValueDefinition * Update dev-env mock * Move muted words and hidden posts into moderationPrefs * Add muted word and hidden post handling to moderatePost * Add mutewords tests * Finish muteword tests * Add mod-authority.test to dev-env * Rename global label value def gore to graphic-media * Fix typo * Stop converting old label values * Update label target=profile behaviors: dont filter content on hide, dont blur display names, but do show the info cards * Update label target=account behaviors: dont blur media of content * Add muteword moderation behaviors * Fix mock label defs * Implement quote-post moderation handling * Add adult content test * Handle sync legacy labels (#2291) * Handle sync legacy labels * Remap values on read * Filter out double-written legacy label values * Better naming, fix types * Fix test * Update moderation docs in sdk * Update to new atproto-accept-labelers header behavior * Add getLabelDefinitions() helper method * Add proxy header support to agent * Update mock moderation * lint * Implement moderation for userlists and feedgens * Add another test label * fix labeler in dev-env agents * fix label hydration test * fix lint error * fix agent test * fix takedown labels test --------- Co-authored-by: Eric Bailey <git@esb.lol> Co-authored-by: dholms <dtholmgren@gmail.com>
2024-03-12 21:10:19 -07:00
// the subscribed labelers and their label settings
labelers: [
{
did: 'did:plc:1234...',
labels: {
porn: 'hide',
sexual: 'warn',
nudity: 'ignore',
// ...
}
Labeling & moderation updates to SDK (#1366) * First pass on label definitions and reference-doc generation for them * Tune labels * Drop the 'csam' label in favor of using !hide CSAM is an extremely delicate issue. Moderators must be careful to remove it from the system without calling direct attention to it. Using the generic !hide achieves the same effect while obscuring the reason for the removal. Server and AppView bans will then be employed (along with any other needed mechanisms) to strip the content from the network. There is also a 'false accusation' concern with using the csam label. Fingerprinting techniques and AI are used to scan for csam. These are capable of producing false positives which will then be reverted after human review. The reputational damage caused by a false positive could be severe, so we want to be careful about any system which might publicize a false positive. * Add label definition code generation * Implement all type signatures for moderation * Complete a first pass on the labeling sdk * Add post-moderation test suite * Add post moderation behavior documentation * Add self-post behaviors * Improve post moderation doc * Tune up the post moderation doc * Tune up the post moderation doc * Tune up the post moderation doc * Simplify the post moderation behavior descriptions * More behavior description tuneup * Add profile moderation final behaviors and tests * Improve generated post-moderation-behaviors doc * Add profile moderation behaviors doc * Test muted-by-list specifically * Fixes to label descriptions * Fix to muted-by-list behavior * Dont blur account in moderateProfile() when muting * Tune label copy * Apply post embed blurring when account is marked with blurmedia label * Fix output signature * Fixes to blocking behavior * Rename LabelDefinitionPreference to LabelPreference * Update docs * Fix test * Fix: self-harm should blur media only * Fixes to tests * Improve label copy * Remove all labels that do not have a specific policy Communicating moderation policies with active users is important. This PR originally included labels which were proposed but did not yet have policies. While we didn't intend to use them until a policy was established, I decided it's better to hold off putting them in the code until we're sure about them. They can be found in backup files prefixed with "proposed-".
2023-08-03 10:28:06 -07:00
}
Additional 3p labeler updates (#2286) * Rename bsky_labeler_did * Use labeldef default setting * Add definedBy to interpretted label defs * Improve dev-env mocks for labels * Remove global label defs for dmca-violation, doxxing, and !no-promote * Change nudity global label def to default to ignore and no longer be adult-only * Remove old !no-promote tests * Add mod authorities header and move bsky labeler into it * Rename modsPref and addModService/removeModService to labelersPref and add/removeLabeler * Add defaultSetting and adultOnly to custom label value definitions * Rename InterprettedLabelValueDefinition to InterpretedLabelValueDefinition * Update dev-env mock * Move muted words and hidden posts into moderationPrefs * Add muted word and hidden post handling to moderatePost * Add mutewords tests * Finish muteword tests * Add mod-authority.test to dev-env * Rename global label value def gore to graphic-media * Fix typo * Stop converting old label values * Update label target=profile behaviors: dont filter content on hide, dont blur display names, but do show the info cards * Update label target=account behaviors: dont blur media of content * Add muteword moderation behaviors * Fix mock label defs * Implement quote-post moderation handling * Add adult content test * Handle sync legacy labels (#2291) * Handle sync legacy labels * Remap values on read * Filter out double-written legacy label values * Better naming, fix types * Fix test * Update moderation docs in sdk * Update to new atproto-accept-labelers header behavior * Add getLabelDefinitions() helper method * Add proxy header support to agent * Update mock moderation * lint * Implement moderation for userlists and feedgens * Add another test label * fix labeler in dev-env agents * fix label hydration test * fix lint error * fix agent test * fix takedown labels test --------- Co-authored-by: Eric Bailey <git@esb.lol> Co-authored-by: dholms <dtholmgren@gmail.com>
2024-03-12 21:10:19 -07:00
],
mutedWords: [/* ... */],
hiddenPosts: [/* ... */]
},
// custom label definitions
labelDefs: {
// labelerDid => defs[]
'did:plc:1234...': [
/* ... */
]
}
Labeling & moderation updates to SDK (#1366) * First pass on label definitions and reference-doc generation for them * Tune labels * Drop the 'csam' label in favor of using !hide CSAM is an extremely delicate issue. Moderators must be careful to remove it from the system without calling direct attention to it. Using the generic !hide achieves the same effect while obscuring the reason for the removal. Server and AppView bans will then be employed (along with any other needed mechanisms) to strip the content from the network. There is also a 'false accusation' concern with using the csam label. Fingerprinting techniques and AI are used to scan for csam. These are capable of producing false positives which will then be reverted after human review. The reputational damage caused by a false positive could be severe, so we want to be careful about any system which might publicize a false positive. * Add label definition code generation * Implement all type signatures for moderation * Complete a first pass on the labeling sdk * Add post-moderation test suite * Add post moderation behavior documentation * Add self-post behaviors * Improve post moderation doc * Tune up the post moderation doc * Tune up the post moderation doc * Tune up the post moderation doc * Simplify the post moderation behavior descriptions * More behavior description tuneup * Add profile moderation final behaviors and tests * Improve generated post-moderation-behaviors doc * Add profile moderation behaviors doc * Test muted-by-list specifically * Fixes to label descriptions * Fix to muted-by-list behavior * Dont blur account in moderateProfile() when muting * Tune label copy * Apply post embed blurring when account is marked with blurmedia label * Fix output signature * Fixes to blocking behavior * Rename LabelDefinitionPreference to LabelPreference * Update docs * Fix test * Fix: self-harm should blur media only * Fixes to tests * Improve label copy * Remove all labels that do not have a specific policy Communicating moderation policies with active users is important. This PR originally included labels which were proposed but did not yet have policies. While we didn't intend to use them until a policy was established, I decided it's better to hold off putting them in the code until we're sure about them. They can be found in backup files prefixed with "proposed-".
2023-08-03 10:28:06 -07:00
}
```
This should match the following interfaces:
```typescript
Additional 3p labeler updates (#2286) * Rename bsky_labeler_did * Use labeldef default setting * Add definedBy to interpretted label defs * Improve dev-env mocks for labels * Remove global label defs for dmca-violation, doxxing, and !no-promote * Change nudity global label def to default to ignore and no longer be adult-only * Remove old !no-promote tests * Add mod authorities header and move bsky labeler into it * Rename modsPref and addModService/removeModService to labelersPref and add/removeLabeler * Add defaultSetting and adultOnly to custom label value definitions * Rename InterprettedLabelValueDefinition to InterpretedLabelValueDefinition * Update dev-env mock * Move muted words and hidden posts into moderationPrefs * Add muted word and hidden post handling to moderatePost * Add mutewords tests * Finish muteword tests * Add mod-authority.test to dev-env * Rename global label value def gore to graphic-media * Fix typo * Stop converting old label values * Update label target=profile behaviors: dont filter content on hide, dont blur display names, but do show the info cards * Update label target=account behaviors: dont blur media of content * Add muteword moderation behaviors * Fix mock label defs * Implement quote-post moderation handling * Add adult content test * Handle sync legacy labels (#2291) * Handle sync legacy labels * Remap values on read * Filter out double-written legacy label values * Better naming, fix types * Fix test * Update moderation docs in sdk * Update to new atproto-accept-labelers header behavior * Add getLabelDefinitions() helper method * Add proxy header support to agent * Update mock moderation * lint * Implement moderation for userlists and feedgens * Add another test label * fix labeler in dev-env agents * fix label hydration test * fix lint error * fix agent test * fix takedown labels test --------- Co-authored-by: Eric Bailey <git@esb.lol> Co-authored-by: dholms <dtholmgren@gmail.com>
2024-03-12 21:10:19 -07:00
export interface ModerationPrefsLabeler {
did: string
labels: Record<string, LabelPreference>
}
export interface ModerationPrefs {
Labeling & moderation updates to SDK (#1366) * First pass on label definitions and reference-doc generation for them * Tune labels * Drop the 'csam' label in favor of using !hide CSAM is an extremely delicate issue. Moderators must be careful to remove it from the system without calling direct attention to it. Using the generic !hide achieves the same effect while obscuring the reason for the removal. Server and AppView bans will then be employed (along with any other needed mechanisms) to strip the content from the network. There is also a 'false accusation' concern with using the csam label. Fingerprinting techniques and AI are used to scan for csam. These are capable of producing false positives which will then be reverted after human review. The reputational damage caused by a false positive could be severe, so we want to be careful about any system which might publicize a false positive. * Add label definition code generation * Implement all type signatures for moderation * Complete a first pass on the labeling sdk * Add post-moderation test suite * Add post moderation behavior documentation * Add self-post behaviors * Improve post moderation doc * Tune up the post moderation doc * Tune up the post moderation doc * Tune up the post moderation doc * Simplify the post moderation behavior descriptions * More behavior description tuneup * Add profile moderation final behaviors and tests * Improve generated post-moderation-behaviors doc * Add profile moderation behaviors doc * Test muted-by-list specifically * Fixes to label descriptions * Fix to muted-by-list behavior * Dont blur account in moderateProfile() when muting * Tune label copy * Apply post embed blurring when account is marked with blurmedia label * Fix output signature * Fixes to blocking behavior * Rename LabelDefinitionPreference to LabelPreference * Update docs * Fix test * Fix: self-harm should blur media only * Fixes to tests * Improve label copy * Remove all labels that do not have a specific policy Communicating moderation policies with active users is important. This PR originally included labels which were proposed but did not yet have policies. While we didn't intend to use them until a policy was established, I decided it's better to hold off putting them in the code until we're sure about them. They can be found in backup files prefixed with "proposed-".
2023-08-03 10:28:06 -07:00
adultContentEnabled: boolean
labels: Record<string, LabelPreference>
Additional 3p labeler updates (#2286) * Rename bsky_labeler_did * Use labeldef default setting * Add definedBy to interpretted label defs * Improve dev-env mocks for labels * Remove global label defs for dmca-violation, doxxing, and !no-promote * Change nudity global label def to default to ignore and no longer be adult-only * Remove old !no-promote tests * Add mod authorities header and move bsky labeler into it * Rename modsPref and addModService/removeModService to labelersPref and add/removeLabeler * Add defaultSetting and adultOnly to custom label value definitions * Rename InterprettedLabelValueDefinition to InterpretedLabelValueDefinition * Update dev-env mock * Move muted words and hidden posts into moderationPrefs * Add muted word and hidden post handling to moderatePost * Add mutewords tests * Finish muteword tests * Add mod-authority.test to dev-env * Rename global label value def gore to graphic-media * Fix typo * Stop converting old label values * Update label target=profile behaviors: dont filter content on hide, dont blur display names, but do show the info cards * Update label target=account behaviors: dont blur media of content * Add muteword moderation behaviors * Fix mock label defs * Implement quote-post moderation handling * Add adult content test * Handle sync legacy labels (#2291) * Handle sync legacy labels * Remap values on read * Filter out double-written legacy label values * Better naming, fix types * Fix test * Update moderation docs in sdk * Update to new atproto-accept-labelers header behavior * Add getLabelDefinitions() helper method * Add proxy header support to agent * Update mock moderation * lint * Implement moderation for userlists and feedgens * Add another test label * fix labeler in dev-env agents * fix label hydration test * fix lint error * fix agent test * fix takedown labels test --------- Co-authored-by: Eric Bailey <git@esb.lol> Co-authored-by: dholms <dtholmgren@gmail.com>
2024-03-12 21:10:19 -07:00
labelers: ModerationPrefsLabeler[]
mutedWords: AppBskyActorDefs.MutedWord[]
hiddenPosts: string[]
Labeling & moderation updates to SDK (#1366) * First pass on label definitions and reference-doc generation for them * Tune labels * Drop the 'csam' label in favor of using !hide CSAM is an extremely delicate issue. Moderators must be careful to remove it from the system without calling direct attention to it. Using the generic !hide achieves the same effect while obscuring the reason for the removal. Server and AppView bans will then be employed (along with any other needed mechanisms) to strip the content from the network. There is also a 'false accusation' concern with using the csam label. Fingerprinting techniques and AI are used to scan for csam. These are capable of producing false positives which will then be reverted after human review. The reputational damage caused by a false positive could be severe, so we want to be careful about any system which might publicize a false positive. * Add label definition code generation * Implement all type signatures for moderation * Complete a first pass on the labeling sdk * Add post-moderation test suite * Add post moderation behavior documentation * Add self-post behaviors * Improve post moderation doc * Tune up the post moderation doc * Tune up the post moderation doc * Tune up the post moderation doc * Simplify the post moderation behavior descriptions * More behavior description tuneup * Add profile moderation final behaviors and tests * Improve generated post-moderation-behaviors doc * Add profile moderation behaviors doc * Test muted-by-list specifically * Fixes to label descriptions * Fix to muted-by-list behavior * Dont blur account in moderateProfile() when muting * Tune label copy * Apply post embed blurring when account is marked with blurmedia label * Fix output signature * Fixes to blocking behavior * Rename LabelDefinitionPreference to LabelPreference * Update docs * Fix test * Fix: self-harm should blur media only * Fixes to tests * Improve label copy * Remove all labels that do not have a specific policy Communicating moderation policies with active users is important. This PR originally included labels which were proposed but did not yet have policies. While we didn't intend to use them until a policy was established, I decided it's better to hold off putting them in the code until we're sure about them. They can be found in backup files prefixed with "proposed-".
2023-08-03 10:28:06 -07:00
}
Additional 3p labeler updates (#2286) * Rename bsky_labeler_did * Use labeldef default setting * Add definedBy to interpretted label defs * Improve dev-env mocks for labels * Remove global label defs for dmca-violation, doxxing, and !no-promote * Change nudity global label def to default to ignore and no longer be adult-only * Remove old !no-promote tests * Add mod authorities header and move bsky labeler into it * Rename modsPref and addModService/removeModService to labelersPref and add/removeLabeler * Add defaultSetting and adultOnly to custom label value definitions * Rename InterprettedLabelValueDefinition to InterpretedLabelValueDefinition * Update dev-env mock * Move muted words and hidden posts into moderationPrefs * Add muted word and hidden post handling to moderatePost * Add mutewords tests * Finish muteword tests * Add mod-authority.test to dev-env * Rename global label value def gore to graphic-media * Fix typo * Stop converting old label values * Update label target=profile behaviors: dont filter content on hide, dont blur display names, but do show the info cards * Update label target=account behaviors: dont blur media of content * Add muteword moderation behaviors * Fix mock label defs * Implement quote-post moderation handling * Add adult content test * Handle sync legacy labels (#2291) * Handle sync legacy labels * Remap values on read * Filter out double-written legacy label values * Better naming, fix types * Fix test * Update moderation docs in sdk * Update to new atproto-accept-labelers header behavior * Add getLabelDefinitions() helper method * Add proxy header support to agent * Update mock moderation * lint * Implement moderation for userlists and feedgens * Add another test label * fix labeler in dev-env agents * fix label hydration test * fix lint error * fix agent test * fix takedown labels test --------- Co-authored-by: Eric Bailey <git@esb.lol> Co-authored-by: dholms <dtholmgren@gmail.com>
2024-03-12 21:10:19 -07:00
export interface ModerationOpts {
userDid: string | undefined
prefs: ModerationPrefs
/**
* Map of labeler did -> custom definitions
*/
labelDefs?: Record<string, InterpretedLabelValueDefinition[]>
Labeling & moderation updates to SDK (#1366) * First pass on label definitions and reference-doc generation for them * Tune labels * Drop the 'csam' label in favor of using !hide CSAM is an extremely delicate issue. Moderators must be careful to remove it from the system without calling direct attention to it. Using the generic !hide achieves the same effect while obscuring the reason for the removal. Server and AppView bans will then be employed (along with any other needed mechanisms) to strip the content from the network. There is also a 'false accusation' concern with using the csam label. Fingerprinting techniques and AI are used to scan for csam. These are capable of producing false positives which will then be reverted after human review. The reputational damage caused by a false positive could be severe, so we want to be careful about any system which might publicize a false positive. * Add label definition code generation * Implement all type signatures for moderation * Complete a first pass on the labeling sdk * Add post-moderation test suite * Add post moderation behavior documentation * Add self-post behaviors * Improve post moderation doc * Tune up the post moderation doc * Tune up the post moderation doc * Tune up the post moderation doc * Simplify the post moderation behavior descriptions * More behavior description tuneup * Add profile moderation final behaviors and tests * Improve generated post-moderation-behaviors doc * Add profile moderation behaviors doc * Test muted-by-list specifically * Fixes to label descriptions * Fix to muted-by-list behavior * Dont blur account in moderateProfile() when muting * Tune label copy * Apply post embed blurring when account is marked with blurmedia label * Fix output signature * Fixes to blocking behavior * Rename LabelDefinitionPreference to LabelPreference * Update docs * Fix test * Fix: self-harm should blur media only * Fixes to tests * Improve label copy * Remove all labels that do not have a specific policy Communicating moderation policies with active users is important. This PR originally included labels which were proposed but did not yet have policies. While we didn't intend to use them until a policy was established, I decided it's better to hold off putting them in the code until we're sure about them. They can be found in backup files prefixed with "proposed-".
2023-08-03 10:28:06 -07:00
}
Additional 3p labeler updates (#2286) * Rename bsky_labeler_did * Use labeldef default setting * Add definedBy to interpretted label defs * Improve dev-env mocks for labels * Remove global label defs for dmca-violation, doxxing, and !no-promote * Change nudity global label def to default to ignore and no longer be adult-only * Remove old !no-promote tests * Add mod authorities header and move bsky labeler into it * Rename modsPref and addModService/removeModService to labelersPref and add/removeLabeler * Add defaultSetting and adultOnly to custom label value definitions * Rename InterprettedLabelValueDefinition to InterpretedLabelValueDefinition * Update dev-env mock * Move muted words and hidden posts into moderationPrefs * Add muted word and hidden post handling to moderatePost * Add mutewords tests * Finish muteword tests * Add mod-authority.test to dev-env * Rename global label value def gore to graphic-media * Fix typo * Stop converting old label values * Update label target=profile behaviors: dont filter content on hide, dont blur display names, but do show the info cards * Update label target=account behaviors: dont blur media of content * Add muteword moderation behaviors * Fix mock label defs * Implement quote-post moderation handling * Add adult content test * Handle sync legacy labels (#2291) * Handle sync legacy labels * Remap values on read * Filter out double-written legacy label values * Better naming, fix types * Fix test * Update moderation docs in sdk * Update to new atproto-accept-labelers header behavior * Add getLabelDefinitions() helper method * Add proxy header support to agent * Update mock moderation * lint * Implement moderation for userlists and feedgens * Add another test label * fix labeler in dev-env agents * fix label hydration test * fix lint error * fix agent test * fix takedown labels test --------- Co-authored-by: Eric Bailey <git@esb.lol> Co-authored-by: dholms <dtholmgren@gmail.com>
2024-03-12 21:10:19 -07:00
```
Labeling & moderation updates to SDK (#1366) * First pass on label definitions and reference-doc generation for them * Tune labels * Drop the 'csam' label in favor of using !hide CSAM is an extremely delicate issue. Moderators must be careful to remove it from the system without calling direct attention to it. Using the generic !hide achieves the same effect while obscuring the reason for the removal. Server and AppView bans will then be employed (along with any other needed mechanisms) to strip the content from the network. There is also a 'false accusation' concern with using the csam label. Fingerprinting techniques and AI are used to scan for csam. These are capable of producing false positives which will then be reverted after human review. The reputational damage caused by a false positive could be severe, so we want to be careful about any system which might publicize a false positive. * Add label definition code generation * Implement all type signatures for moderation * Complete a first pass on the labeling sdk * Add post-moderation test suite * Add post moderation behavior documentation * Add self-post behaviors * Improve post moderation doc * Tune up the post moderation doc * Tune up the post moderation doc * Tune up the post moderation doc * Simplify the post moderation behavior descriptions * More behavior description tuneup * Add profile moderation final behaviors and tests * Improve generated post-moderation-behaviors doc * Add profile moderation behaviors doc * Test muted-by-list specifically * Fixes to label descriptions * Fix to muted-by-list behavior * Dont blur account in moderateProfile() when muting * Tune label copy * Apply post embed blurring when account is marked with blurmedia label * Fix output signature * Fixes to blocking behavior * Rename LabelDefinitionPreference to LabelPreference * Update docs * Fix test * Fix: self-harm should blur media only * Fixes to tests * Improve label copy * Remove all labels that do not have a specific policy Communicating moderation policies with active users is important. This PR originally included labels which were proposed but did not yet have policies. While we didn't intend to use them until a policy was established, I decided it's better to hold off putting them in the code until we're sure about them. They can be found in backup files prefixed with "proposed-".
2023-08-03 10:28:06 -07:00
Additional 3p labeler updates (#2286) * Rename bsky_labeler_did * Use labeldef default setting * Add definedBy to interpretted label defs * Improve dev-env mocks for labels * Remove global label defs for dmca-violation, doxxing, and !no-promote * Change nudity global label def to default to ignore and no longer be adult-only * Remove old !no-promote tests * Add mod authorities header and move bsky labeler into it * Rename modsPref and addModService/removeModService to labelersPref and add/removeLabeler * Add defaultSetting and adultOnly to custom label value definitions * Rename InterprettedLabelValueDefinition to InterpretedLabelValueDefinition * Update dev-env mock * Move muted words and hidden posts into moderationPrefs * Add muted word and hidden post handling to moderatePost * Add mutewords tests * Finish muteword tests * Add mod-authority.test to dev-env * Rename global label value def gore to graphic-media * Fix typo * Stop converting old label values * Update label target=profile behaviors: dont filter content on hide, dont blur display names, but do show the info cards * Update label target=account behaviors: dont blur media of content * Add muteword moderation behaviors * Fix mock label defs * Implement quote-post moderation handling * Add adult content test * Handle sync legacy labels (#2291) * Handle sync legacy labels * Remap values on read * Filter out double-written legacy label values * Better naming, fix types * Fix test * Update moderation docs in sdk * Update to new atproto-accept-labelers header behavior * Add getLabelDefinitions() helper method * Add proxy header support to agent * Update mock moderation * lint * Implement moderation for userlists and feedgens * Add another test label * fix labeler in dev-env agents * fix label hydration test * fix lint error * fix agent test * fix takedown labels test --------- Co-authored-by: Eric Bailey <git@esb.lol> Co-authored-by: dholms <dtholmgren@gmail.com>
2024-03-12 21:10:19 -07:00
You can quickly grab the `ModerationPrefs` using the `agent.getPreferences()` method:
Labeling & moderation updates to SDK (#1366) * First pass on label definitions and reference-doc generation for them * Tune labels * Drop the 'csam' label in favor of using !hide CSAM is an extremely delicate issue. Moderators must be careful to remove it from the system without calling direct attention to it. Using the generic !hide achieves the same effect while obscuring the reason for the removal. Server and AppView bans will then be employed (along with any other needed mechanisms) to strip the content from the network. There is also a 'false accusation' concern with using the csam label. Fingerprinting techniques and AI are used to scan for csam. These are capable of producing false positives which will then be reverted after human review. The reputational damage caused by a false positive could be severe, so we want to be careful about any system which might publicize a false positive. * Add label definition code generation * Implement all type signatures for moderation * Complete a first pass on the labeling sdk * Add post-moderation test suite * Add post moderation behavior documentation * Add self-post behaviors * Improve post moderation doc * Tune up the post moderation doc * Tune up the post moderation doc * Tune up the post moderation doc * Simplify the post moderation behavior descriptions * More behavior description tuneup * Add profile moderation final behaviors and tests * Improve generated post-moderation-behaviors doc * Add profile moderation behaviors doc * Test muted-by-list specifically * Fixes to label descriptions * Fix to muted-by-list behavior * Dont blur account in moderateProfile() when muting * Tune label copy * Apply post embed blurring when account is marked with blurmedia label * Fix output signature * Fixes to blocking behavior * Rename LabelDefinitionPreference to LabelPreference * Update docs * Fix test * Fix: self-harm should blur media only * Fixes to tests * Improve label copy * Remove all labels that do not have a specific policy Communicating moderation policies with active users is important. This PR originally included labels which were proposed but did not yet have policies. While we didn't intend to use them until a policy was established, I decided it's better to hold off putting them in the code until we're sure about them. They can be found in backup files prefixed with "proposed-".
2023-08-03 10:28:06 -07:00
Additional 3p labeler updates (#2286) * Rename bsky_labeler_did * Use labeldef default setting * Add definedBy to interpretted label defs * Improve dev-env mocks for labels * Remove global label defs for dmca-violation, doxxing, and !no-promote * Change nudity global label def to default to ignore and no longer be adult-only * Remove old !no-promote tests * Add mod authorities header and move bsky labeler into it * Rename modsPref and addModService/removeModService to labelersPref and add/removeLabeler * Add defaultSetting and adultOnly to custom label value definitions * Rename InterprettedLabelValueDefinition to InterpretedLabelValueDefinition * Update dev-env mock * Move muted words and hidden posts into moderationPrefs * Add muted word and hidden post handling to moderatePost * Add mutewords tests * Finish muteword tests * Add mod-authority.test to dev-env * Rename global label value def gore to graphic-media * Fix typo * Stop converting old label values * Update label target=profile behaviors: dont filter content on hide, dont blur display names, but do show the info cards * Update label target=account behaviors: dont blur media of content * Add muteword moderation behaviors * Fix mock label defs * Implement quote-post moderation handling * Add adult content test * Handle sync legacy labels (#2291) * Handle sync legacy labels * Remap values on read * Filter out double-written legacy label values * Better naming, fix types * Fix test * Update moderation docs in sdk * Update to new atproto-accept-labelers header behavior * Add getLabelDefinitions() helper method * Add proxy header support to agent * Update mock moderation * lint * Implement moderation for userlists and feedgens * Add another test label * fix labeler in dev-env agents * fix label hydration test * fix lint error * fix agent test * fix takedown labels test --------- Co-authored-by: Eric Bailey <git@esb.lol> Co-authored-by: dholms <dtholmgren@gmail.com>
2024-03-12 21:10:19 -07:00
```typescript
const prefs = await agent.getPreferences()
moderatePost(post, {
userDid: /*...*/,
prefs: prefs.moderationPrefs,
labelDefs: /*...*/
})
Labeling & moderation updates to SDK (#1366) * First pass on label definitions and reference-doc generation for them * Tune labels * Drop the 'csam' label in favor of using !hide CSAM is an extremely delicate issue. Moderators must be careful to remove it from the system without calling direct attention to it. Using the generic !hide achieves the same effect while obscuring the reason for the removal. Server and AppView bans will then be employed (along with any other needed mechanisms) to strip the content from the network. There is also a 'false accusation' concern with using the csam label. Fingerprinting techniques and AI are used to scan for csam. These are capable of producing false positives which will then be reverted after human review. The reputational damage caused by a false positive could be severe, so we want to be careful about any system which might publicize a false positive. * Add label definition code generation * Implement all type signatures for moderation * Complete a first pass on the labeling sdk * Add post-moderation test suite * Add post moderation behavior documentation * Add self-post behaviors * Improve post moderation doc * Tune up the post moderation doc * Tune up the post moderation doc * Tune up the post moderation doc * Simplify the post moderation behavior descriptions * More behavior description tuneup * Add profile moderation final behaviors and tests * Improve generated post-moderation-behaviors doc * Add profile moderation behaviors doc * Test muted-by-list specifically * Fixes to label descriptions * Fix to muted-by-list behavior * Dont blur account in moderateProfile() when muting * Tune label copy * Apply post embed blurring when account is marked with blurmedia label * Fix output signature * Fixes to blocking behavior * Rename LabelDefinitionPreference to LabelPreference * Update docs * Fix test * Fix: self-harm should blur media only * Fixes to tests * Improve label copy * Remove all labels that do not have a specific policy Communicating moderation policies with active users is important. This PR originally included labels which were proposed but did not yet have policies. While we didn't intend to use them until a policy was established, I decided it's better to hold off putting them in the code until we're sure about them. They can be found in backup files prefixed with "proposed-".
2023-08-03 10:28:06 -07:00
```
Additional 3p labeler updates (#2286) * Rename bsky_labeler_did * Use labeldef default setting * Add definedBy to interpretted label defs * Improve dev-env mocks for labels * Remove global label defs for dmca-violation, doxxing, and !no-promote * Change nudity global label def to default to ignore and no longer be adult-only * Remove old !no-promote tests * Add mod authorities header and move bsky labeler into it * Rename modsPref and addModService/removeModService to labelersPref and add/removeLabeler * Add defaultSetting and adultOnly to custom label value definitions * Rename InterprettedLabelValueDefinition to InterpretedLabelValueDefinition * Update dev-env mock * Move muted words and hidden posts into moderationPrefs * Add muted word and hidden post handling to moderatePost * Add mutewords tests * Finish muteword tests * Add mod-authority.test to dev-env * Rename global label value def gore to graphic-media * Fix typo * Stop converting old label values * Update label target=profile behaviors: dont filter content on hide, dont blur display names, but do show the info cards * Update label target=account behaviors: dont blur media of content * Add muteword moderation behaviors * Fix mock label defs * Implement quote-post moderation handling * Add adult content test * Handle sync legacy labels (#2291) * Handle sync legacy labels * Remap values on read * Filter out double-written legacy label values * Better naming, fix types * Fix test * Update moderation docs in sdk * Update to new atproto-accept-labelers header behavior * Add getLabelDefinitions() helper method * Add proxy header support to agent * Update mock moderation * lint * Implement moderation for userlists and feedgens * Add another test label * fix labeler in dev-env agents * fix label hydration test * fix lint error * fix agent test * fix takedown labels test --------- Co-authored-by: Eric Bailey <git@esb.lol> Co-authored-by: dholms <dtholmgren@gmail.com>
2024-03-12 21:10:19 -07:00
To gather the label definitions (`labelDefs`) see the _Labelers_ section below.
Labeling & moderation updates to SDK (#1366) * First pass on label definitions and reference-doc generation for them * Tune labels * Drop the 'csam' label in favor of using !hide CSAM is an extremely delicate issue. Moderators must be careful to remove it from the system without calling direct attention to it. Using the generic !hide achieves the same effect while obscuring the reason for the removal. Server and AppView bans will then be employed (along with any other needed mechanisms) to strip the content from the network. There is also a 'false accusation' concern with using the csam label. Fingerprinting techniques and AI are used to scan for csam. These are capable of producing false positives which will then be reverted after human review. The reputational damage caused by a false positive could be severe, so we want to be careful about any system which might publicize a false positive. * Add label definition code generation * Implement all type signatures for moderation * Complete a first pass on the labeling sdk * Add post-moderation test suite * Add post moderation behavior documentation * Add self-post behaviors * Improve post moderation doc * Tune up the post moderation doc * Tune up the post moderation doc * Tune up the post moderation doc * Simplify the post moderation behavior descriptions * More behavior description tuneup * Add profile moderation final behaviors and tests * Improve generated post-moderation-behaviors doc * Add profile moderation behaviors doc * Test muted-by-list specifically * Fixes to label descriptions * Fix to muted-by-list behavior * Dont blur account in moderateProfile() when muting * Tune label copy * Apply post embed blurring when account is marked with blurmedia label * Fix output signature * Fixes to blocking behavior * Rename LabelDefinitionPreference to LabelPreference * Update docs * Fix test * Fix: self-harm should blur media only * Fixes to tests * Improve label copy * Remove all labels that do not have a specific policy Communicating moderation policies with active users is important. This PR originally included labels which were proposed but did not yet have policies. While we didn't intend to use them until a policy was established, I decided it's better to hold off putting them in the code until we're sure about them. They can be found in backup files prefixed with "proposed-".
2023-08-03 10:28:06 -07:00
Additional 3p labeler updates (#2286) * Rename bsky_labeler_did * Use labeldef default setting * Add definedBy to interpretted label defs * Improve dev-env mocks for labels * Remove global label defs for dmca-violation, doxxing, and !no-promote * Change nudity global label def to default to ignore and no longer be adult-only * Remove old !no-promote tests * Add mod authorities header and move bsky labeler into it * Rename modsPref and addModService/removeModService to labelersPref and add/removeLabeler * Add defaultSetting and adultOnly to custom label value definitions * Rename InterprettedLabelValueDefinition to InterpretedLabelValueDefinition * Update dev-env mock * Move muted words and hidden posts into moderationPrefs * Add muted word and hidden post handling to moderatePost * Add mutewords tests * Finish muteword tests * Add mod-authority.test to dev-env * Rename global label value def gore to graphic-media * Fix typo * Stop converting old label values * Update label target=profile behaviors: dont filter content on hide, dont blur display names, but do show the info cards * Update label target=account behaviors: dont blur media of content * Add muteword moderation behaviors * Fix mock label defs * Implement quote-post moderation handling * Add adult content test * Handle sync legacy labels (#2291) * Handle sync legacy labels * Remap values on read * Filter out double-written legacy label values * Better naming, fix types * Fix test * Update moderation docs in sdk * Update to new atproto-accept-labelers header behavior * Add getLabelDefinitions() helper method * Add proxy header support to agent * Update mock moderation * lint * Implement moderation for userlists and feedgens * Add another test label * fix labeler in dev-env agents * fix label hydration test * fix lint error * fix agent test * fix takedown labels test --------- Co-authored-by: Eric Bailey <git@esb.lol> Co-authored-by: dholms <dtholmgren@gmail.com>
2024-03-12 21:10:19 -07:00
## Labelers
Labelers are services that provide moderation labels. Your application will typically have 1+ top-level labelers set with the ability to do "takedowns" on content. This is controlled via this static function, though the default is to use Bluesky's moderation:
Labeling & moderation updates to SDK (#1366) * First pass on label definitions and reference-doc generation for them * Tune labels * Drop the 'csam' label in favor of using !hide CSAM is an extremely delicate issue. Moderators must be careful to remove it from the system without calling direct attention to it. Using the generic !hide achieves the same effect while obscuring the reason for the removal. Server and AppView bans will then be employed (along with any other needed mechanisms) to strip the content from the network. There is also a 'false accusation' concern with using the csam label. Fingerprinting techniques and AI are used to scan for csam. These are capable of producing false positives which will then be reverted after human review. The reputational damage caused by a false positive could be severe, so we want to be careful about any system which might publicize a false positive. * Add label definition code generation * Implement all type signatures for moderation * Complete a first pass on the labeling sdk * Add post-moderation test suite * Add post moderation behavior documentation * Add self-post behaviors * Improve post moderation doc * Tune up the post moderation doc * Tune up the post moderation doc * Tune up the post moderation doc * Simplify the post moderation behavior descriptions * More behavior description tuneup * Add profile moderation final behaviors and tests * Improve generated post-moderation-behaviors doc * Add profile moderation behaviors doc * Test muted-by-list specifically * Fixes to label descriptions * Fix to muted-by-list behavior * Dont blur account in moderateProfile() when muting * Tune label copy * Apply post embed blurring when account is marked with blurmedia label * Fix output signature * Fixes to blocking behavior * Rename LabelDefinitionPreference to LabelPreference * Update docs * Fix test * Fix: self-harm should blur media only * Fixes to tests * Improve label copy * Remove all labels that do not have a specific policy Communicating moderation policies with active users is important. This PR originally included labels which were proposed but did not yet have policies. While we didn't intend to use them until a policy was established, I decided it's better to hold off putting them in the code until we're sure about them. They can be found in backup files prefixed with "proposed-".
2023-08-03 10:28:06 -07:00
```typescript
Additional 3p labeler updates (#2286) * Rename bsky_labeler_did * Use labeldef default setting * Add definedBy to interpretted label defs * Improve dev-env mocks for labels * Remove global label defs for dmca-violation, doxxing, and !no-promote * Change nudity global label def to default to ignore and no longer be adult-only * Remove old !no-promote tests * Add mod authorities header and move bsky labeler into it * Rename modsPref and addModService/removeModService to labelersPref and add/removeLabeler * Add defaultSetting and adultOnly to custom label value definitions * Rename InterprettedLabelValueDefinition to InterpretedLabelValueDefinition * Update dev-env mock * Move muted words and hidden posts into moderationPrefs * Add muted word and hidden post handling to moderatePost * Add mutewords tests * Finish muteword tests * Add mod-authority.test to dev-env * Rename global label value def gore to graphic-media * Fix typo * Stop converting old label values * Update label target=profile behaviors: dont filter content on hide, dont blur display names, but do show the info cards * Update label target=account behaviors: dont blur media of content * Add muteword moderation behaviors * Fix mock label defs * Implement quote-post moderation handling * Add adult content test * Handle sync legacy labels (#2291) * Handle sync legacy labels * Remap values on read * Filter out double-written legacy label values * Better naming, fix types * Fix test * Update moderation docs in sdk * Update to new atproto-accept-labelers header behavior * Add getLabelDefinitions() helper method * Add proxy header support to agent * Update mock moderation * lint * Implement moderation for userlists and feedgens * Add another test label * fix labeler in dev-env agents * fix label hydration test * fix lint error * fix agent test * fix takedown labels test --------- Co-authored-by: Eric Bailey <git@esb.lol> Co-authored-by: dholms <dtholmgren@gmail.com>
2024-03-12 21:10:19 -07:00
BskyAgent.configure({
appLabelers: ['did:web:my-labeler.com'],
})
```
Labeling & moderation updates to SDK (#1366) * First pass on label definitions and reference-doc generation for them * Tune labels * Drop the 'csam' label in favor of using !hide CSAM is an extremely delicate issue. Moderators must be careful to remove it from the system without calling direct attention to it. Using the generic !hide achieves the same effect while obscuring the reason for the removal. Server and AppView bans will then be employed (along with any other needed mechanisms) to strip the content from the network. There is also a 'false accusation' concern with using the csam label. Fingerprinting techniques and AI are used to scan for csam. These are capable of producing false positives which will then be reverted after human review. The reputational damage caused by a false positive could be severe, so we want to be careful about any system which might publicize a false positive. * Add label definition code generation * Implement all type signatures for moderation * Complete a first pass on the labeling sdk * Add post-moderation test suite * Add post moderation behavior documentation * Add self-post behaviors * Improve post moderation doc * Tune up the post moderation doc * Tune up the post moderation doc * Tune up the post moderation doc * Simplify the post moderation behavior descriptions * More behavior description tuneup * Add profile moderation final behaviors and tests * Improve generated post-moderation-behaviors doc * Add profile moderation behaviors doc * Test muted-by-list specifically * Fixes to label descriptions * Fix to muted-by-list behavior * Dont blur account in moderateProfile() when muting * Tune label copy * Apply post embed blurring when account is marked with blurmedia label * Fix output signature * Fixes to blocking behavior * Rename LabelDefinitionPreference to LabelPreference * Update docs * Fix test * Fix: self-harm should blur media only * Fixes to tests * Improve label copy * Remove all labels that do not have a specific policy Communicating moderation policies with active users is important. This PR originally included labels which were proposed but did not yet have policies. While we didn't intend to use them until a policy was established, I decided it's better to hold off putting them in the code until we're sure about them. They can be found in backup files prefixed with "proposed-".
2023-08-03 10:28:06 -07:00
Additional 3p labeler updates (#2286) * Rename bsky_labeler_did * Use labeldef default setting * Add definedBy to interpretted label defs * Improve dev-env mocks for labels * Remove global label defs for dmca-violation, doxxing, and !no-promote * Change nudity global label def to default to ignore and no longer be adult-only * Remove old !no-promote tests * Add mod authorities header and move bsky labeler into it * Rename modsPref and addModService/removeModService to labelersPref and add/removeLabeler * Add defaultSetting and adultOnly to custom label value definitions * Rename InterprettedLabelValueDefinition to InterpretedLabelValueDefinition * Update dev-env mock * Move muted words and hidden posts into moderationPrefs * Add muted word and hidden post handling to moderatePost * Add mutewords tests * Finish muteword tests * Add mod-authority.test to dev-env * Rename global label value def gore to graphic-media * Fix typo * Stop converting old label values * Update label target=profile behaviors: dont filter content on hide, dont blur display names, but do show the info cards * Update label target=account behaviors: dont blur media of content * Add muteword moderation behaviors * Fix mock label defs * Implement quote-post moderation handling * Add adult content test * Handle sync legacy labels (#2291) * Handle sync legacy labels * Remap values on read * Filter out double-written legacy label values * Better naming, fix types * Fix test * Update moderation docs in sdk * Update to new atproto-accept-labelers header behavior * Add getLabelDefinitions() helper method * Add proxy header support to agent * Update mock moderation * lint * Implement moderation for userlists and feedgens * Add another test label * fix labeler in dev-env agents * fix label hydration test * fix lint error * fix agent test * fix takedown labels test --------- Co-authored-by: Eric Bailey <git@esb.lol> Co-authored-by: dholms <dtholmgren@gmail.com>
2024-03-12 21:10:19 -07:00
Users may also add their own labelers. The active labelers are controlled via an HTTP header which is automatically set by the agent when `getPreferences` is called, or when the labeler preferences are changed.
Labeling & moderation updates to SDK (#1366) * First pass on label definitions and reference-doc generation for them * Tune labels * Drop the 'csam' label in favor of using !hide CSAM is an extremely delicate issue. Moderators must be careful to remove it from the system without calling direct attention to it. Using the generic !hide achieves the same effect while obscuring the reason for the removal. Server and AppView bans will then be employed (along with any other needed mechanisms) to strip the content from the network. There is also a 'false accusation' concern with using the csam label. Fingerprinting techniques and AI are used to scan for csam. These are capable of producing false positives which will then be reverted after human review. The reputational damage caused by a false positive could be severe, so we want to be careful about any system which might publicize a false positive. * Add label definition code generation * Implement all type signatures for moderation * Complete a first pass on the labeling sdk * Add post-moderation test suite * Add post moderation behavior documentation * Add self-post behaviors * Improve post moderation doc * Tune up the post moderation doc * Tune up the post moderation doc * Tune up the post moderation doc * Simplify the post moderation behavior descriptions * More behavior description tuneup * Add profile moderation final behaviors and tests * Improve generated post-moderation-behaviors doc * Add profile moderation behaviors doc * Test muted-by-list specifically * Fixes to label descriptions * Fix to muted-by-list behavior * Dont blur account in moderateProfile() when muting * Tune label copy * Apply post embed blurring when account is marked with blurmedia label * Fix output signature * Fixes to blocking behavior * Rename LabelDefinitionPreference to LabelPreference * Update docs * Fix test * Fix: self-harm should blur media only * Fixes to tests * Improve label copy * Remove all labels that do not have a specific policy Communicating moderation policies with active users is important. This PR originally included labels which were proposed but did not yet have policies. While we didn't intend to use them until a policy was established, I decided it's better to hold off putting them in the code until we're sure about them. They can be found in backup files prefixed with "proposed-".
2023-08-03 10:28:06 -07:00
Additional 3p labeler updates (#2286) * Rename bsky_labeler_did * Use labeldef default setting * Add definedBy to interpretted label defs * Improve dev-env mocks for labels * Remove global label defs for dmca-violation, doxxing, and !no-promote * Change nudity global label def to default to ignore and no longer be adult-only * Remove old !no-promote tests * Add mod authorities header and move bsky labeler into it * Rename modsPref and addModService/removeModService to labelersPref and add/removeLabeler * Add defaultSetting and adultOnly to custom label value definitions * Rename InterprettedLabelValueDefinition to InterpretedLabelValueDefinition * Update dev-env mock * Move muted words and hidden posts into moderationPrefs * Add muted word and hidden post handling to moderatePost * Add mutewords tests * Finish muteword tests * Add mod-authority.test to dev-env * Rename global label value def gore to graphic-media * Fix typo * Stop converting old label values * Update label target=profile behaviors: dont filter content on hide, dont blur display names, but do show the info cards * Update label target=account behaviors: dont blur media of content * Add muteword moderation behaviors * Fix mock label defs * Implement quote-post moderation handling * Add adult content test * Handle sync legacy labels (#2291) * Handle sync legacy labels * Remap values on read * Filter out double-written legacy label values * Better naming, fix types * Fix test * Update moderation docs in sdk * Update to new atproto-accept-labelers header behavior * Add getLabelDefinitions() helper method * Add proxy header support to agent * Update mock moderation * lint * Implement moderation for userlists and feedgens * Add another test label * fix labeler in dev-env agents * fix label hydration test * fix lint error * fix agent test * fix takedown labels test --------- Co-authored-by: Eric Bailey <git@esb.lol> Co-authored-by: dholms <dtholmgren@gmail.com>
2024-03-12 21:10:19 -07:00
Labelers publish a `app.bsky.labeler.service` record that looks like this:
```js
{
$type: 'app.bsky.labeler.service',
policies: {
// the list of label values the labeler will publish
labelValues: [
'rude',
],
// any custom definitions the labeler will be using
labelValueDefinitions: [
{
identifier: 'rude',
blurs: 'content',
severity: 'alert',
defaultSetting: 'warn',
adultOnly: false,
locales: [
{
lang: 'en',
name: 'Rude',
description: 'Not keeping things civil.',
},
],
},
],
},
createdAt: '2024-03-12T17:17:17.215Z'
Labeling & moderation updates to SDK (#1366) * First pass on label definitions and reference-doc generation for them * Tune labels * Drop the 'csam' label in favor of using !hide CSAM is an extremely delicate issue. Moderators must be careful to remove it from the system without calling direct attention to it. Using the generic !hide achieves the same effect while obscuring the reason for the removal. Server and AppView bans will then be employed (along with any other needed mechanisms) to strip the content from the network. There is also a 'false accusation' concern with using the csam label. Fingerprinting techniques and AI are used to scan for csam. These are capable of producing false positives which will then be reverted after human review. The reputational damage caused by a false positive could be severe, so we want to be careful about any system which might publicize a false positive. * Add label definition code generation * Implement all type signatures for moderation * Complete a first pass on the labeling sdk * Add post-moderation test suite * Add post moderation behavior documentation * Add self-post behaviors * Improve post moderation doc * Tune up the post moderation doc * Tune up the post moderation doc * Tune up the post moderation doc * Simplify the post moderation behavior descriptions * More behavior description tuneup * Add profile moderation final behaviors and tests * Improve generated post-moderation-behaviors doc * Add profile moderation behaviors doc * Test muted-by-list specifically * Fixes to label descriptions * Fix to muted-by-list behavior * Dont blur account in moderateProfile() when muting * Tune label copy * Apply post embed blurring when account is marked with blurmedia label * Fix output signature * Fixes to blocking behavior * Rename LabelDefinitionPreference to LabelPreference * Update docs * Fix test * Fix: self-harm should blur media only * Fixes to tests * Improve label copy * Remove all labels that do not have a specific policy Communicating moderation policies with active users is important. This PR originally included labels which were proposed but did not yet have policies. While we didn't intend to use them until a policy was established, I decided it's better to hold off putting them in the code until we're sure about them. They can be found in backup files prefixed with "proposed-".
2023-08-03 10:28:06 -07:00
}
```
Additional 3p labeler updates (#2286) * Rename bsky_labeler_did * Use labeldef default setting * Add definedBy to interpretted label defs * Improve dev-env mocks for labels * Remove global label defs for dmca-violation, doxxing, and !no-promote * Change nudity global label def to default to ignore and no longer be adult-only * Remove old !no-promote tests * Add mod authorities header and move bsky labeler into it * Rename modsPref and addModService/removeModService to labelersPref and add/removeLabeler * Add defaultSetting and adultOnly to custom label value definitions * Rename InterprettedLabelValueDefinition to InterpretedLabelValueDefinition * Update dev-env mock * Move muted words and hidden posts into moderationPrefs * Add muted word and hidden post handling to moderatePost * Add mutewords tests * Finish muteword tests * Add mod-authority.test to dev-env * Rename global label value def gore to graphic-media * Fix typo * Stop converting old label values * Update label target=profile behaviors: dont filter content on hide, dont blur display names, but do show the info cards * Update label target=account behaviors: dont blur media of content * Add muteword moderation behaviors * Fix mock label defs * Implement quote-post moderation handling * Add adult content test * Handle sync legacy labels (#2291) * Handle sync legacy labels * Remap values on read * Filter out double-written legacy label values * Better naming, fix types * Fix test * Update moderation docs in sdk * Update to new atproto-accept-labelers header behavior * Add getLabelDefinitions() helper method * Add proxy header support to agent * Update mock moderation * lint * Implement moderation for userlists and feedgens * Add another test label * fix labeler in dev-env agents * fix label hydration test * fix lint error * fix agent test * fix takedown labels test --------- Co-authored-by: Eric Bailey <git@esb.lol> Co-authored-by: dholms <dtholmgren@gmail.com>
2024-03-12 21:10:19 -07:00
The label value definition are custom labels which only apply to that labeler. Your client needs to sync those definitions in order to correctly interpret them. To do that, call `app.bsky.labeler.getService()` (or the `getServices` batch variant) periodically to fetch their definitions. We recommend caching the response (at time our writing the official client uses a TTL of 6 hours).
Here is how to do this:
```typescript
Client SDK rework (#2483) * feat(api): support creation of oauth based AtpAgents * oauth: misc fixes for confidential clients * fix(xprc): remove ReadableStream.from polyfill * OAuth docs tweaks (#2679) * OAuth: clarification about client_name being shown * OAuth: re-write handle resolution privacy concern * avoid relying on ReadableStream.from in xrpc-server tests * feat(oauth-types): expose "ALLOW_UNSECURE_ORIGINS" constant * feat(handle-resolver): expose "AtprotoIdentityDidMethods" type * fix(oauth-client): ensure that the oauth metadata document contains client_id_metadata_document_supported * fix(oauth-types): prevent unknown query string in loopback client id * fix(identity-resolver): check that handle is in did doc's "alsoKnownAs" * feat(oauth-client:oauth-resolver): allow logging in using either the PDS URL or Entryway URL * fix(oauth-client): return better error in case of invalid "oauth-protected-resource" status code * refactor(did): group atproto specific checks in own * feat(api): relax typing of "appLabelers" and "labelers" AtpClient properties * allow any did as labeller (for tests mainly) * fix(api): allow to override "atproto-proxy" on a per-request basis * remove release candidate versions from changelog * update changeset for api and xrpc packages * Add missing changeset * revert RC versions * Proper wording in OAUTH.md api example * remove "pre" changeset file * xrpc: restore original behavior of setHEader and unsetHeader * docs: add comment for XrpcClient 's constructor arg * feat(api): expose "schemas" publicly * feat(api): allow customizing the whatwg fetch function of the AtpAgent * docs(api): improve migration docs * docs: change reference to BskyAgent to AtpAgent * docs: mention the breaking change regarding setSessionPersistHandler * fix(api): better split AtpClient concerns * fix(xrpc): remove unused import * refactor(api): simplify class hierarchu by removeing AtpClient * fix(api): mock proper method for facets detection * restore ability to restore session asynchronously * feat(api): allow instantiating Agent with same argument as super class * docs(api): properly extend Agent class * style(xrpc): var name * docs(api): remove "async" to header getter --------- Co-authored-by: Devin Ivy <devinivy@gmail.com> Co-authored-by: bnewbold <bnewbold@robocracy.org> Co-authored-by: Hailey <me@haileyok.com>
2024-08-12 19:57:21 +02:00
import { AtpAgent } from '@atproto/api'
Additional 3p labeler updates (#2286) * Rename bsky_labeler_did * Use labeldef default setting * Add definedBy to interpretted label defs * Improve dev-env mocks for labels * Remove global label defs for dmca-violation, doxxing, and !no-promote * Change nudity global label def to default to ignore and no longer be adult-only * Remove old !no-promote tests * Add mod authorities header and move bsky labeler into it * Rename modsPref and addModService/removeModService to labelersPref and add/removeLabeler * Add defaultSetting and adultOnly to custom label value definitions * Rename InterprettedLabelValueDefinition to InterpretedLabelValueDefinition * Update dev-env mock * Move muted words and hidden posts into moderationPrefs * Add muted word and hidden post handling to moderatePost * Add mutewords tests * Finish muteword tests * Add mod-authority.test to dev-env * Rename global label value def gore to graphic-media * Fix typo * Stop converting old label values * Update label target=profile behaviors: dont filter content on hide, dont blur display names, but do show the info cards * Update label target=account behaviors: dont blur media of content * Add muteword moderation behaviors * Fix mock label defs * Implement quote-post moderation handling * Add adult content test * Handle sync legacy labels (#2291) * Handle sync legacy labels * Remap values on read * Filter out double-written legacy label values * Better naming, fix types * Fix test * Update moderation docs in sdk * Update to new atproto-accept-labelers header behavior * Add getLabelDefinitions() helper method * Add proxy header support to agent * Update mock moderation * lint * Implement moderation for userlists and feedgens * Add another test label * fix labeler in dev-env agents * fix label hydration test * fix lint error * fix agent test * fix takedown labels test --------- Co-authored-by: Eric Bailey <git@esb.lol> Co-authored-by: dholms <dtholmgren@gmail.com>
2024-03-12 21:10:19 -07:00
Client SDK rework (#2483) * feat(api): support creation of oauth based AtpAgents * oauth: misc fixes for confidential clients * fix(xprc): remove ReadableStream.from polyfill * OAuth docs tweaks (#2679) * OAuth: clarification about client_name being shown * OAuth: re-write handle resolution privacy concern * avoid relying on ReadableStream.from in xrpc-server tests * feat(oauth-types): expose "ALLOW_UNSECURE_ORIGINS" constant * feat(handle-resolver): expose "AtprotoIdentityDidMethods" type * fix(oauth-client): ensure that the oauth metadata document contains client_id_metadata_document_supported * fix(oauth-types): prevent unknown query string in loopback client id * fix(identity-resolver): check that handle is in did doc's "alsoKnownAs" * feat(oauth-client:oauth-resolver): allow logging in using either the PDS URL or Entryway URL * fix(oauth-client): return better error in case of invalid "oauth-protected-resource" status code * refactor(did): group atproto specific checks in own * feat(api): relax typing of "appLabelers" and "labelers" AtpClient properties * allow any did as labeller (for tests mainly) * fix(api): allow to override "atproto-proxy" on a per-request basis * remove release candidate versions from changelog * update changeset for api and xrpc packages * Add missing changeset * revert RC versions * Proper wording in OAUTH.md api example * remove "pre" changeset file * xrpc: restore original behavior of setHEader and unsetHeader * docs: add comment for XrpcClient 's constructor arg * feat(api): expose "schemas" publicly * feat(api): allow customizing the whatwg fetch function of the AtpAgent * docs(api): improve migration docs * docs: change reference to BskyAgent to AtpAgent * docs: mention the breaking change regarding setSessionPersistHandler * fix(api): better split AtpClient concerns * fix(xrpc): remove unused import * refactor(api): simplify class hierarchu by removeing AtpClient * fix(api): mock proper method for facets detection * restore ability to restore session asynchronously * feat(api): allow instantiating Agent with same argument as super class * docs(api): properly extend Agent class * style(xrpc): var name * docs(api): remove "async" to header getter --------- Co-authored-by: Devin Ivy <devinivy@gmail.com> Co-authored-by: bnewbold <bnewbold@robocracy.org> Co-authored-by: Hailey <me@haileyok.com>
2024-08-12 19:57:21 +02:00
const agent = new AtpAgent({ service: 'https://example.com' })
Additional 3p labeler updates (#2286) * Rename bsky_labeler_did * Use labeldef default setting * Add definedBy to interpretted label defs * Improve dev-env mocks for labels * Remove global label defs for dmca-violation, doxxing, and !no-promote * Change nudity global label def to default to ignore and no longer be adult-only * Remove old !no-promote tests * Add mod authorities header and move bsky labeler into it * Rename modsPref and addModService/removeModService to labelersPref and add/removeLabeler * Add defaultSetting and adultOnly to custom label value definitions * Rename InterprettedLabelValueDefinition to InterpretedLabelValueDefinition * Update dev-env mock * Move muted words and hidden posts into moderationPrefs * Add muted word and hidden post handling to moderatePost * Add mutewords tests * Finish muteword tests * Add mod-authority.test to dev-env * Rename global label value def gore to graphic-media * Fix typo * Stop converting old label values * Update label target=profile behaviors: dont filter content on hide, dont blur display names, but do show the info cards * Update label target=account behaviors: dont blur media of content * Add muteword moderation behaviors * Fix mock label defs * Implement quote-post moderation handling * Add adult content test * Handle sync legacy labels (#2291) * Handle sync legacy labels * Remap values on read * Filter out double-written legacy label values * Better naming, fix types * Fix test * Update moderation docs in sdk * Update to new atproto-accept-labelers header behavior * Add getLabelDefinitions() helper method * Add proxy header support to agent * Update mock moderation * lint * Implement moderation for userlists and feedgens * Add another test label * fix labeler in dev-env agents * fix label hydration test * fix lint error * fix agent test * fix takedown labels test --------- Co-authored-by: Eric Bailey <git@esb.lol> Co-authored-by: dholms <dtholmgren@gmail.com>
2024-03-12 21:10:19 -07:00
// assume `agent` is a signed in session
const prefs = await agent.getPreferences()
const labelDefs = await agent.getLabelDefinitions(prefs)
moderatePost(post, {
userDid: agent.session.did,
prefs: prefs.moderationPrefs,
labelDefs,
})
```
## The `moderate*()` APIs
The SDK exports methods to moderate the different kinds of content on the network.
```typescript
import {
moderateProfile,
moderatePost,
moderateNotification,
moderateFeedGen,
moderateUserList,
moderateLabeler,
} from '@atproto/api'
```
Each of these follows the same API signature:
```typescript
const res = moderatePost(post, moderationOptions)
```
Labeling & moderation updates to SDK (#1366) * First pass on label definitions and reference-doc generation for them * Tune labels * Drop the 'csam' label in favor of using !hide CSAM is an extremely delicate issue. Moderators must be careful to remove it from the system without calling direct attention to it. Using the generic !hide achieves the same effect while obscuring the reason for the removal. Server and AppView bans will then be employed (along with any other needed mechanisms) to strip the content from the network. There is also a 'false accusation' concern with using the csam label. Fingerprinting techniques and AI are used to scan for csam. These are capable of producing false positives which will then be reverted after human review. The reputational damage caused by a false positive could be severe, so we want to be careful about any system which might publicize a false positive. * Add label definition code generation * Implement all type signatures for moderation * Complete a first pass on the labeling sdk * Add post-moderation test suite * Add post moderation behavior documentation * Add self-post behaviors * Improve post moderation doc * Tune up the post moderation doc * Tune up the post moderation doc * Tune up the post moderation doc * Simplify the post moderation behavior descriptions * More behavior description tuneup * Add profile moderation final behaviors and tests * Improve generated post-moderation-behaviors doc * Add profile moderation behaviors doc * Test muted-by-list specifically * Fixes to label descriptions * Fix to muted-by-list behavior * Dont blur account in moderateProfile() when muting * Tune label copy * Apply post embed blurring when account is marked with blurmedia label * Fix output signature * Fixes to blocking behavior * Rename LabelDefinitionPreference to LabelPreference * Update docs * Fix test * Fix: self-harm should blur media only * Fixes to tests * Improve label copy * Remove all labels that do not have a specific policy Communicating moderation policies with active users is important. This PR originally included labels which were proposed but did not yet have policies. While we didn't intend to use them until a policy was established, I decided it's better to hold off putting them in the code until we're sure about them. They can be found in backup files prefixed with "proposed-".
2023-08-03 10:28:06 -07:00
Additional 3p labeler updates (#2286) * Rename bsky_labeler_did * Use labeldef default setting * Add definedBy to interpretted label defs * Improve dev-env mocks for labels * Remove global label defs for dmca-violation, doxxing, and !no-promote * Change nudity global label def to default to ignore and no longer be adult-only * Remove old !no-promote tests * Add mod authorities header and move bsky labeler into it * Rename modsPref and addModService/removeModService to labelersPref and add/removeLabeler * Add defaultSetting and adultOnly to custom label value definitions * Rename InterprettedLabelValueDefinition to InterpretedLabelValueDefinition * Update dev-env mock * Move muted words and hidden posts into moderationPrefs * Add muted word and hidden post handling to moderatePost * Add mutewords tests * Finish muteword tests * Add mod-authority.test to dev-env * Rename global label value def gore to graphic-media * Fix typo * Stop converting old label values * Update label target=profile behaviors: dont filter content on hide, dont blur display names, but do show the info cards * Update label target=account behaviors: dont blur media of content * Add muteword moderation behaviors * Fix mock label defs * Implement quote-post moderation handling * Add adult content test * Handle sync legacy labels (#2291) * Handle sync legacy labels * Remap values on read * Filter out double-written legacy label values * Better naming, fix types * Fix test * Update moderation docs in sdk * Update to new atproto-accept-labelers header behavior * Add getLabelDefinitions() helper method * Add proxy header support to agent * Update mock moderation * lint * Implement moderation for userlists and feedgens * Add another test label * fix labeler in dev-env agents * fix label hydration test * fix lint error * fix agent test * fix takedown labels test --------- Co-authored-by: Eric Bailey <git@esb.lol> Co-authored-by: dholms <dtholmgren@gmail.com>
2024-03-12 21:10:19 -07:00
The response object provides an API for figuring out what your UI should do in different contexts.
Labeling & moderation updates to SDK (#1366) * First pass on label definitions and reference-doc generation for them * Tune labels * Drop the 'csam' label in favor of using !hide CSAM is an extremely delicate issue. Moderators must be careful to remove it from the system without calling direct attention to it. Using the generic !hide achieves the same effect while obscuring the reason for the removal. Server and AppView bans will then be employed (along with any other needed mechanisms) to strip the content from the network. There is also a 'false accusation' concern with using the csam label. Fingerprinting techniques and AI are used to scan for csam. These are capable of producing false positives which will then be reverted after human review. The reputational damage caused by a false positive could be severe, so we want to be careful about any system which might publicize a false positive. * Add label definition code generation * Implement all type signatures for moderation * Complete a first pass on the labeling sdk * Add post-moderation test suite * Add post moderation behavior documentation * Add self-post behaviors * Improve post moderation doc * Tune up the post moderation doc * Tune up the post moderation doc * Tune up the post moderation doc * Simplify the post moderation behavior descriptions * More behavior description tuneup * Add profile moderation final behaviors and tests * Improve generated post-moderation-behaviors doc * Add profile moderation behaviors doc * Test muted-by-list specifically * Fixes to label descriptions * Fix to muted-by-list behavior * Dont blur account in moderateProfile() when muting * Tune label copy * Apply post embed blurring when account is marked with blurmedia label * Fix output signature * Fixes to blocking behavior * Rename LabelDefinitionPreference to LabelPreference * Update docs * Fix test * Fix: self-harm should blur media only * Fixes to tests * Improve label copy * Remove all labels that do not have a specific policy Communicating moderation policies with active users is important. This PR originally included labels which were proposed but did not yet have policies. While we didn't intend to use them until a policy was established, I decided it's better to hold off putting them in the code until we're sure about them. They can be found in backup files prefixed with "proposed-".
2023-08-03 10:28:06 -07:00
```typescript
Client SDK rework (#2483) * feat(api): support creation of oauth based AtpAgents * oauth: misc fixes for confidential clients * fix(xprc): remove ReadableStream.from polyfill * OAuth docs tweaks (#2679) * OAuth: clarification about client_name being shown * OAuth: re-write handle resolution privacy concern * avoid relying on ReadableStream.from in xrpc-server tests * feat(oauth-types): expose "ALLOW_UNSECURE_ORIGINS" constant * feat(handle-resolver): expose "AtprotoIdentityDidMethods" type * fix(oauth-client): ensure that the oauth metadata document contains client_id_metadata_document_supported * fix(oauth-types): prevent unknown query string in loopback client id * fix(identity-resolver): check that handle is in did doc's "alsoKnownAs" * feat(oauth-client:oauth-resolver): allow logging in using either the PDS URL or Entryway URL * fix(oauth-client): return better error in case of invalid "oauth-protected-resource" status code * refactor(did): group atproto specific checks in own * feat(api): relax typing of "appLabelers" and "labelers" AtpClient properties * allow any did as labeller (for tests mainly) * fix(api): allow to override "atproto-proxy" on a per-request basis * remove release candidate versions from changelog * update changeset for api and xrpc packages * Add missing changeset * revert RC versions * Proper wording in OAUTH.md api example * remove "pre" changeset file * xrpc: restore original behavior of setHEader and unsetHeader * docs: add comment for XrpcClient 's constructor arg * feat(api): expose "schemas" publicly * feat(api): allow customizing the whatwg fetch function of the AtpAgent * docs(api): improve migration docs * docs: change reference to BskyAgent to AtpAgent * docs: mention the breaking change regarding setSessionPersistHandler * fix(api): better split AtpClient concerns * fix(xrpc): remove unused import * refactor(api): simplify class hierarchu by removeing AtpClient * fix(api): mock proper method for facets detection * restore ability to restore session asynchronously * feat(api): allow instantiating Agent with same argument as super class * docs(api): properly extend Agent class * style(xrpc): var name * docs(api): remove "async" to header getter --------- Co-authored-by: Devin Ivy <devinivy@gmail.com> Co-authored-by: bnewbold <bnewbold@robocracy.org> Co-authored-by: Hailey <me@haileyok.com>
2024-08-12 19:57:21 +02:00
res.ui(context) /* =>
Labeling & moderation updates to SDK (#1366) * First pass on label definitions and reference-doc generation for them * Tune labels * Drop the 'csam' label in favor of using !hide CSAM is an extremely delicate issue. Moderators must be careful to remove it from the system without calling direct attention to it. Using the generic !hide achieves the same effect while obscuring the reason for the removal. Server and AppView bans will then be employed (along with any other needed mechanisms) to strip the content from the network. There is also a 'false accusation' concern with using the csam label. Fingerprinting techniques and AI are used to scan for csam. These are capable of producing false positives which will then be reverted after human review. The reputational damage caused by a false positive could be severe, so we want to be careful about any system which might publicize a false positive. * Add label definition code generation * Implement all type signatures for moderation * Complete a first pass on the labeling sdk * Add post-moderation test suite * Add post moderation behavior documentation * Add self-post behaviors * Improve post moderation doc * Tune up the post moderation doc * Tune up the post moderation doc * Tune up the post moderation doc * Simplify the post moderation behavior descriptions * More behavior description tuneup * Add profile moderation final behaviors and tests * Improve generated post-moderation-behaviors doc * Add profile moderation behaviors doc * Test muted-by-list specifically * Fixes to label descriptions * Fix to muted-by-list behavior * Dont blur account in moderateProfile() when muting * Tune label copy * Apply post embed blurring when account is marked with blurmedia label * Fix output signature * Fixes to blocking behavior * Rename LabelDefinitionPreference to LabelPreference * Update docs * Fix test * Fix: self-harm should blur media only * Fixes to tests * Improve label copy * Remove all labels that do not have a specific policy Communicating moderation policies with active users is important. This PR originally included labels which were proposed but did not yet have policies. While we didn't intend to use them until a policy was established, I decided it's better to hold off putting them in the code until we're sure about them. They can be found in backup files prefixed with "proposed-".
2023-08-03 10:28:06 -07:00
Additional 3p labeler updates (#2286) * Rename bsky_labeler_did * Use labeldef default setting * Add definedBy to interpretted label defs * Improve dev-env mocks for labels * Remove global label defs for dmca-violation, doxxing, and !no-promote * Change nudity global label def to default to ignore and no longer be adult-only * Remove old !no-promote tests * Add mod authorities header and move bsky labeler into it * Rename modsPref and addModService/removeModService to labelersPref and add/removeLabeler * Add defaultSetting and adultOnly to custom label value definitions * Rename InterprettedLabelValueDefinition to InterpretedLabelValueDefinition * Update dev-env mock * Move muted words and hidden posts into moderationPrefs * Add muted word and hidden post handling to moderatePost * Add mutewords tests * Finish muteword tests * Add mod-authority.test to dev-env * Rename global label value def gore to graphic-media * Fix typo * Stop converting old label values * Update label target=profile behaviors: dont filter content on hide, dont blur display names, but do show the info cards * Update label target=account behaviors: dont blur media of content * Add muteword moderation behaviors * Fix mock label defs * Implement quote-post moderation handling * Add adult content test * Handle sync legacy labels (#2291) * Handle sync legacy labels * Remap values on read * Filter out double-written legacy label values * Better naming, fix types * Fix test * Update moderation docs in sdk * Update to new atproto-accept-labelers header behavior * Add getLabelDefinitions() helper method * Add proxy header support to agent * Update mock moderation * lint * Implement moderation for userlists and feedgens * Add another test label * fix labeler in dev-env agents * fix label hydration test * fix lint error * fix agent test * fix takedown labels test --------- Co-authored-by: Eric Bailey <git@esb.lol> Co-authored-by: dholms <dtholmgren@gmail.com>
2024-03-12 21:10:19 -07:00
ModerationUI {
filter: boolean // should the content be removed from the interface?
blur: boolean // should the content be put behind a cover?
alert: boolean // should an alert be put on the content? (negative)
inform: boolean // should an informational notice be put on the content? (neutral)
noOverride: boolean // if blur=true, should the UI disable opening the cover?
Labeling & moderation updates to SDK (#1366) * First pass on label definitions and reference-doc generation for them * Tune labels * Drop the 'csam' label in favor of using !hide CSAM is an extremely delicate issue. Moderators must be careful to remove it from the system without calling direct attention to it. Using the generic !hide achieves the same effect while obscuring the reason for the removal. Server and AppView bans will then be employed (along with any other needed mechanisms) to strip the content from the network. There is also a 'false accusation' concern with using the csam label. Fingerprinting techniques and AI are used to scan for csam. These are capable of producing false positives which will then be reverted after human review. The reputational damage caused by a false positive could be severe, so we want to be careful about any system which might publicize a false positive. * Add label definition code generation * Implement all type signatures for moderation * Complete a first pass on the labeling sdk * Add post-moderation test suite * Add post moderation behavior documentation * Add self-post behaviors * Improve post moderation doc * Tune up the post moderation doc * Tune up the post moderation doc * Tune up the post moderation doc * Simplify the post moderation behavior descriptions * More behavior description tuneup * Add profile moderation final behaviors and tests * Improve generated post-moderation-behaviors doc * Add profile moderation behaviors doc * Test muted-by-list specifically * Fixes to label descriptions * Fix to muted-by-list behavior * Dont blur account in moderateProfile() when muting * Tune label copy * Apply post embed blurring when account is marked with blurmedia label * Fix output signature * Fixes to blocking behavior * Rename LabelDefinitionPreference to LabelPreference * Update docs * Fix test * Fix: self-harm should blur media only * Fixes to tests * Improve label copy * Remove all labels that do not have a specific policy Communicating moderation policies with active users is important. This PR originally included labels which were proposed but did not yet have policies. While we didn't intend to use them until a policy was established, I decided it's better to hold off putting them in the code until we're sure about them. They can be found in backup files prefixed with "proposed-".
2023-08-03 10:28:06 -07:00
Additional 3p labeler updates (#2286) * Rename bsky_labeler_did * Use labeldef default setting * Add definedBy to interpretted label defs * Improve dev-env mocks for labels * Remove global label defs for dmca-violation, doxxing, and !no-promote * Change nudity global label def to default to ignore and no longer be adult-only * Remove old !no-promote tests * Add mod authorities header and move bsky labeler into it * Rename modsPref and addModService/removeModService to labelersPref and add/removeLabeler * Add defaultSetting and adultOnly to custom label value definitions * Rename InterprettedLabelValueDefinition to InterpretedLabelValueDefinition * Update dev-env mock * Move muted words and hidden posts into moderationPrefs * Add muted word and hidden post handling to moderatePost * Add mutewords tests * Finish muteword tests * Add mod-authority.test to dev-env * Rename global label value def gore to graphic-media * Fix typo * Stop converting old label values * Update label target=profile behaviors: dont filter content on hide, dont blur display names, but do show the info cards * Update label target=account behaviors: dont blur media of content * Add muteword moderation behaviors * Fix mock label defs * Implement quote-post moderation handling * Add adult content test * Handle sync legacy labels (#2291) * Handle sync legacy labels * Remap values on read * Filter out double-written legacy label values * Better naming, fix types * Fix test * Update moderation docs in sdk * Update to new atproto-accept-labelers header behavior * Add getLabelDefinitions() helper method * Add proxy header support to agent * Update mock moderation * lint * Implement moderation for userlists and feedgens * Add another test label * fix labeler in dev-env agents * fix label hydration test * fix lint error * fix agent test * fix takedown labels test --------- Co-authored-by: Eric Bailey <git@esb.lol> Co-authored-by: dholms <dtholmgren@gmail.com>
2024-03-12 21:10:19 -07:00
// the reasons for each of the flags:
filters: ModerationCause[]
blurs: ModerationCause[]
alerts: ModerationCause[]
informs: ModerationCause[]
Labeling & moderation updates to SDK (#1366) * First pass on label definitions and reference-doc generation for them * Tune labels * Drop the 'csam' label in favor of using !hide CSAM is an extremely delicate issue. Moderators must be careful to remove it from the system without calling direct attention to it. Using the generic !hide achieves the same effect while obscuring the reason for the removal. Server and AppView bans will then be employed (along with any other needed mechanisms) to strip the content from the network. There is also a 'false accusation' concern with using the csam label. Fingerprinting techniques and AI are used to scan for csam. These are capable of producing false positives which will then be reverted after human review. The reputational damage caused by a false positive could be severe, so we want to be careful about any system which might publicize a false positive. * Add label definition code generation * Implement all type signatures for moderation * Complete a first pass on the labeling sdk * Add post-moderation test suite * Add post moderation behavior documentation * Add self-post behaviors * Improve post moderation doc * Tune up the post moderation doc * Tune up the post moderation doc * Tune up the post moderation doc * Simplify the post moderation behavior descriptions * More behavior description tuneup * Add profile moderation final behaviors and tests * Improve generated post-moderation-behaviors doc * Add profile moderation behaviors doc * Test muted-by-list specifically * Fixes to label descriptions * Fix to muted-by-list behavior * Dont blur account in moderateProfile() when muting * Tune label copy * Apply post embed blurring when account is marked with blurmedia label * Fix output signature * Fixes to blocking behavior * Rename LabelDefinitionPreference to LabelPreference * Update docs * Fix test * Fix: self-harm should blur media only * Fixes to tests * Improve label copy * Remove all labels that do not have a specific policy Communicating moderation policies with active users is important. This PR originally included labels which were proposed but did not yet have policies. While we didn't intend to use them until a policy was established, I decided it's better to hold off putting them in the code until we're sure about them. They can be found in backup files prefixed with "proposed-".
2023-08-03 10:28:06 -07:00
}
Additional 3p labeler updates (#2286) * Rename bsky_labeler_did * Use labeldef default setting * Add definedBy to interpretted label defs * Improve dev-env mocks for labels * Remove global label defs for dmca-violation, doxxing, and !no-promote * Change nudity global label def to default to ignore and no longer be adult-only * Remove old !no-promote tests * Add mod authorities header and move bsky labeler into it * Rename modsPref and addModService/removeModService to labelersPref and add/removeLabeler * Add defaultSetting and adultOnly to custom label value definitions * Rename InterprettedLabelValueDefinition to InterpretedLabelValueDefinition * Update dev-env mock * Move muted words and hidden posts into moderationPrefs * Add muted word and hidden post handling to moderatePost * Add mutewords tests * Finish muteword tests * Add mod-authority.test to dev-env * Rename global label value def gore to graphic-media * Fix typo * Stop converting old label values * Update label target=profile behaviors: dont filter content on hide, dont blur display names, but do show the info cards * Update label target=account behaviors: dont blur media of content * Add muteword moderation behaviors * Fix mock label defs * Implement quote-post moderation handling * Add adult content test * Handle sync legacy labels (#2291) * Handle sync legacy labels * Remap values on read * Filter out double-written legacy label values * Better naming, fix types * Fix test * Update moderation docs in sdk * Update to new atproto-accept-labelers header behavior * Add getLabelDefinitions() helper method * Add proxy header support to agent * Update mock moderation * lint * Implement moderation for userlists and feedgens * Add another test label * fix labeler in dev-env agents * fix label hydration test * fix lint error * fix agent test * fix takedown labels test --------- Co-authored-by: Eric Bailey <git@esb.lol> Co-authored-by: dholms <dtholmgren@gmail.com>
2024-03-12 21:10:19 -07:00
*/
```
There are multiple UI contexts available:
- `profileList` A profile being listed, eg in search or a follower list
- `profileView` A profile being viewed directly
- `avatar` The user's avatar in any context
- `banner` The user's banner in any context
- `displayName` The user's display name in any context
- `contentList` Content being listed, eg posts in a feed, posts as replies, a user list list, a feed generator list, etc
- `contentView` Content being viewed direct, eg an opened post, the user list page, the feedgen page, etc
- `contentMedia ` Media inside the content, eg a picture embedded in a post
Here's how a post in a feed would use these tools to make a decision:
```typescript
const mod = moderatePost(post, moderationOptions)
if (mod.ui('contentList').filter) {
// dont show the post
Labeling & moderation updates to SDK (#1366) * First pass on label definitions and reference-doc generation for them * Tune labels * Drop the 'csam' label in favor of using !hide CSAM is an extremely delicate issue. Moderators must be careful to remove it from the system without calling direct attention to it. Using the generic !hide achieves the same effect while obscuring the reason for the removal. Server and AppView bans will then be employed (along with any other needed mechanisms) to strip the content from the network. There is also a 'false accusation' concern with using the csam label. Fingerprinting techniques and AI are used to scan for csam. These are capable of producing false positives which will then be reverted after human review. The reputational damage caused by a false positive could be severe, so we want to be careful about any system which might publicize a false positive. * Add label definition code generation * Implement all type signatures for moderation * Complete a first pass on the labeling sdk * Add post-moderation test suite * Add post moderation behavior documentation * Add self-post behaviors * Improve post moderation doc * Tune up the post moderation doc * Tune up the post moderation doc * Tune up the post moderation doc * Simplify the post moderation behavior descriptions * More behavior description tuneup * Add profile moderation final behaviors and tests * Improve generated post-moderation-behaviors doc * Add profile moderation behaviors doc * Test muted-by-list specifically * Fixes to label descriptions * Fix to muted-by-list behavior * Dont blur account in moderateProfile() when muting * Tune label copy * Apply post embed blurring when account is marked with blurmedia label * Fix output signature * Fixes to blocking behavior * Rename LabelDefinitionPreference to LabelPreference * Update docs * Fix test * Fix: self-harm should blur media only * Fixes to tests * Improve label copy * Remove all labels that do not have a specific policy Communicating moderation policies with active users is important. This PR originally included labels which were proposed but did not yet have policies. While we didn't intend to use them until a policy was established, I decided it's better to hold off putting them in the code until we're sure about them. They can be found in backup files prefixed with "proposed-".
2023-08-03 10:28:06 -07:00
}
Additional 3p labeler updates (#2286) * Rename bsky_labeler_did * Use labeldef default setting * Add definedBy to interpretted label defs * Improve dev-env mocks for labels * Remove global label defs for dmca-violation, doxxing, and !no-promote * Change nudity global label def to default to ignore and no longer be adult-only * Remove old !no-promote tests * Add mod authorities header and move bsky labeler into it * Rename modsPref and addModService/removeModService to labelersPref and add/removeLabeler * Add defaultSetting and adultOnly to custom label value definitions * Rename InterprettedLabelValueDefinition to InterpretedLabelValueDefinition * Update dev-env mock * Move muted words and hidden posts into moderationPrefs * Add muted word and hidden post handling to moderatePost * Add mutewords tests * Finish muteword tests * Add mod-authority.test to dev-env * Rename global label value def gore to graphic-media * Fix typo * Stop converting old label values * Update label target=profile behaviors: dont filter content on hide, dont blur display names, but do show the info cards * Update label target=account behaviors: dont blur media of content * Add muteword moderation behaviors * Fix mock label defs * Implement quote-post moderation handling * Add adult content test * Handle sync legacy labels (#2291) * Handle sync legacy labels * Remap values on read * Filter out double-written legacy label values * Better naming, fix types * Fix test * Update moderation docs in sdk * Update to new atproto-accept-labelers header behavior * Add getLabelDefinitions() helper method * Add proxy header support to agent * Update mock moderation * lint * Implement moderation for userlists and feedgens * Add another test label * fix labeler in dev-env agents * fix label hydration test * fix lint error * fix agent test * fix takedown labels test --------- Co-authored-by: Eric Bailey <git@esb.lol> Co-authored-by: dholms <dtholmgren@gmail.com>
2024-03-12 21:10:19 -07:00
if (mod.ui('contentList').blur) {
// cover the post with the explanation from mod.ui('contentList').blurs[0]
if (mod.ui('contentList').noOverride) {
// dont allow the cover to be removed
}
Labeling & moderation updates to SDK (#1366) * First pass on label definitions and reference-doc generation for them * Tune labels * Drop the 'csam' label in favor of using !hide CSAM is an extremely delicate issue. Moderators must be careful to remove it from the system without calling direct attention to it. Using the generic !hide achieves the same effect while obscuring the reason for the removal. Server and AppView bans will then be employed (along with any other needed mechanisms) to strip the content from the network. There is also a 'false accusation' concern with using the csam label. Fingerprinting techniques and AI are used to scan for csam. These are capable of producing false positives which will then be reverted after human review. The reputational damage caused by a false positive could be severe, so we want to be careful about any system which might publicize a false positive. * Add label definition code generation * Implement all type signatures for moderation * Complete a first pass on the labeling sdk * Add post-moderation test suite * Add post moderation behavior documentation * Add self-post behaviors * Improve post moderation doc * Tune up the post moderation doc * Tune up the post moderation doc * Tune up the post moderation doc * Simplify the post moderation behavior descriptions * More behavior description tuneup * Add profile moderation final behaviors and tests * Improve generated post-moderation-behaviors doc * Add profile moderation behaviors doc * Test muted-by-list specifically * Fixes to label descriptions * Fix to muted-by-list behavior * Dont blur account in moderateProfile() when muting * Tune label copy * Apply post embed blurring when account is marked with blurmedia label * Fix output signature * Fixes to blocking behavior * Rename LabelDefinitionPreference to LabelPreference * Update docs * Fix test * Fix: self-harm should blur media only * Fixes to tests * Improve label copy * Remove all labels that do not have a specific policy Communicating moderation policies with active users is important. This PR originally included labels which were proposed but did not yet have policies. While we didn't intend to use them until a policy was established, I decided it's better to hold off putting them in the code until we're sure about them. They can be found in backup files prefixed with "proposed-".
2023-08-03 10:28:06 -07:00
}
Additional 3p labeler updates (#2286) * Rename bsky_labeler_did * Use labeldef default setting * Add definedBy to interpretted label defs * Improve dev-env mocks for labels * Remove global label defs for dmca-violation, doxxing, and !no-promote * Change nudity global label def to default to ignore and no longer be adult-only * Remove old !no-promote tests * Add mod authorities header and move bsky labeler into it * Rename modsPref and addModService/removeModService to labelersPref and add/removeLabeler * Add defaultSetting and adultOnly to custom label value definitions * Rename InterprettedLabelValueDefinition to InterpretedLabelValueDefinition * Update dev-env mock * Move muted words and hidden posts into moderationPrefs * Add muted word and hidden post handling to moderatePost * Add mutewords tests * Finish muteword tests * Add mod-authority.test to dev-env * Rename global label value def gore to graphic-media * Fix typo * Stop converting old label values * Update label target=profile behaviors: dont filter content on hide, dont blur display names, but do show the info cards * Update label target=account behaviors: dont blur media of content * Add muteword moderation behaviors * Fix mock label defs * Implement quote-post moderation handling * Add adult content test * Handle sync legacy labels (#2291) * Handle sync legacy labels * Remap values on read * Filter out double-written legacy label values * Better naming, fix types * Fix test * Update moderation docs in sdk * Update to new atproto-accept-labelers header behavior * Add getLabelDefinitions() helper method * Add proxy header support to agent * Update mock moderation * lint * Implement moderation for userlists and feedgens * Add another test label * fix labeler in dev-env agents * fix label hydration test * fix lint error * fix agent test * fix takedown labels test --------- Co-authored-by: Eric Bailey <git@esb.lol> Co-authored-by: dholms <dtholmgren@gmail.com>
2024-03-12 21:10:19 -07:00
if (mod.ui('contentMedia').blur) {
// cover the post's embedded images with the explanation from mod.ui('contentMedia').blurs[0]
Additional 3p labeler updates (#2286) * Rename bsky_labeler_did * Use labeldef default setting * Add definedBy to interpretted label defs * Improve dev-env mocks for labels * Remove global label defs for dmca-violation, doxxing, and !no-promote * Change nudity global label def to default to ignore and no longer be adult-only * Remove old !no-promote tests * Add mod authorities header and move bsky labeler into it * Rename modsPref and addModService/removeModService to labelersPref and add/removeLabeler * Add defaultSetting and adultOnly to custom label value definitions * Rename InterprettedLabelValueDefinition to InterpretedLabelValueDefinition * Update dev-env mock * Move muted words and hidden posts into moderationPrefs * Add muted word and hidden post handling to moderatePost * Add mutewords tests * Finish muteword tests * Add mod-authority.test to dev-env * Rename global label value def gore to graphic-media * Fix typo * Stop converting old label values * Update label target=profile behaviors: dont filter content on hide, dont blur display names, but do show the info cards * Update label target=account behaviors: dont blur media of content * Add muteword moderation behaviors * Fix mock label defs * Implement quote-post moderation handling * Add adult content test * Handle sync legacy labels (#2291) * Handle sync legacy labels * Remap values on read * Filter out double-written legacy label values * Better naming, fix types * Fix test * Update moderation docs in sdk * Update to new atproto-accept-labelers header behavior * Add getLabelDefinitions() helper method * Add proxy header support to agent * Update mock moderation * lint * Implement moderation for userlists and feedgens * Add another test label * fix labeler in dev-env agents * fix label hydration test * fix lint error * fix agent test * fix takedown labels test --------- Co-authored-by: Eric Bailey <git@esb.lol> Co-authored-by: dholms <dtholmgren@gmail.com>
2024-03-12 21:10:19 -07:00
if (mod.ui('contentMedia').noOverride) {
// dont allow the cover to be removed
Labeling & moderation updates to SDK (#1366) * First pass on label definitions and reference-doc generation for them * Tune labels * Drop the 'csam' label in favor of using !hide CSAM is an extremely delicate issue. Moderators must be careful to remove it from the system without calling direct attention to it. Using the generic !hide achieves the same effect while obscuring the reason for the removal. Server and AppView bans will then be employed (along with any other needed mechanisms) to strip the content from the network. There is also a 'false accusation' concern with using the csam label. Fingerprinting techniques and AI are used to scan for csam. These are capable of producing false positives which will then be reverted after human review. The reputational damage caused by a false positive could be severe, so we want to be careful about any system which might publicize a false positive. * Add label definition code generation * Implement all type signatures for moderation * Complete a first pass on the labeling sdk * Add post-moderation test suite * Add post moderation behavior documentation * Add self-post behaviors * Improve post moderation doc * Tune up the post moderation doc * Tune up the post moderation doc * Tune up the post moderation doc * Simplify the post moderation behavior descriptions * More behavior description tuneup * Add profile moderation final behaviors and tests * Improve generated post-moderation-behaviors doc * Add profile moderation behaviors doc * Test muted-by-list specifically * Fixes to label descriptions * Fix to muted-by-list behavior * Dont blur account in moderateProfile() when muting * Tune label copy * Apply post embed blurring when account is marked with blurmedia label * Fix output signature * Fixes to blocking behavior * Rename LabelDefinitionPreference to LabelPreference * Update docs * Fix test * Fix: self-harm should blur media only * Fixes to tests * Improve label copy * Remove all labels that do not have a specific policy Communicating moderation policies with active users is important. This PR originally included labels which were proposed but did not yet have policies. While we didn't intend to use them until a policy was established, I decided it's better to hold off putting them in the code until we're sure about them. They can be found in backup files prefixed with "proposed-".
2023-08-03 10:28:06 -07:00
}
}
Additional 3p labeler updates (#2286) * Rename bsky_labeler_did * Use labeldef default setting * Add definedBy to interpretted label defs * Improve dev-env mocks for labels * Remove global label defs for dmca-violation, doxxing, and !no-promote * Change nudity global label def to default to ignore and no longer be adult-only * Remove old !no-promote tests * Add mod authorities header and move bsky labeler into it * Rename modsPref and addModService/removeModService to labelersPref and add/removeLabeler * Add defaultSetting and adultOnly to custom label value definitions * Rename InterprettedLabelValueDefinition to InterpretedLabelValueDefinition * Update dev-env mock * Move muted words and hidden posts into moderationPrefs * Add muted word and hidden post handling to moderatePost * Add mutewords tests * Finish muteword tests * Add mod-authority.test to dev-env * Rename global label value def gore to graphic-media * Fix typo * Stop converting old label values * Update label target=profile behaviors: dont filter content on hide, dont blur display names, but do show the info cards * Update label target=account behaviors: dont blur media of content * Add muteword moderation behaviors * Fix mock label defs * Implement quote-post moderation handling * Add adult content test * Handle sync legacy labels (#2291) * Handle sync legacy labels * Remap values on read * Filter out double-written legacy label values * Better naming, fix types * Fix test * Update moderation docs in sdk * Update to new atproto-accept-labelers header behavior * Add getLabelDefinitions() helper method * Add proxy header support to agent * Update mock moderation * lint * Implement moderation for userlists and feedgens * Add another test label * fix labeler in dev-env agents * fix label hydration test * fix lint error * fix agent test * fix takedown labels test --------- Co-authored-by: Eric Bailey <git@esb.lol> Co-authored-by: dholms <dtholmgren@gmail.com>
2024-03-12 21:10:19 -07:00
if (mod.ui('avatar').blur) {
// cover the avatar with the explanation from mod.ui('avatar').blurs[0]
if (mod.ui('avatar').noOverride) {
// dont allow the cover to be removed
}
Labeling & moderation updates to SDK (#1366) * First pass on label definitions and reference-doc generation for them * Tune labels * Drop the 'csam' label in favor of using !hide CSAM is an extremely delicate issue. Moderators must be careful to remove it from the system without calling direct attention to it. Using the generic !hide achieves the same effect while obscuring the reason for the removal. Server and AppView bans will then be employed (along with any other needed mechanisms) to strip the content from the network. There is also a 'false accusation' concern with using the csam label. Fingerprinting techniques and AI are used to scan for csam. These are capable of producing false positives which will then be reverted after human review. The reputational damage caused by a false positive could be severe, so we want to be careful about any system which might publicize a false positive. * Add label definition code generation * Implement all type signatures for moderation * Complete a first pass on the labeling sdk * Add post-moderation test suite * Add post moderation behavior documentation * Add self-post behaviors * Improve post moderation doc * Tune up the post moderation doc * Tune up the post moderation doc * Tune up the post moderation doc * Simplify the post moderation behavior descriptions * More behavior description tuneup * Add profile moderation final behaviors and tests * Improve generated post-moderation-behaviors doc * Add profile moderation behaviors doc * Test muted-by-list specifically * Fixes to label descriptions * Fix to muted-by-list behavior * Dont blur account in moderateProfile() when muting * Tune label copy * Apply post embed blurring when account is marked with blurmedia label * Fix output signature * Fixes to blocking behavior * Rename LabelDefinitionPreference to LabelPreference * Update docs * Fix test * Fix: self-harm should blur media only * Fixes to tests * Improve label copy * Remove all labels that do not have a specific policy Communicating moderation policies with active users is important. This PR originally included labels which were proposed but did not yet have policies. While we didn't intend to use them until a policy was established, I decided it's better to hold off putting them in the code until we're sure about them. They can be found in backup files prefixed with "proposed-".
2023-08-03 10:28:06 -07:00
}
Additional 3p labeler updates (#2286) * Rename bsky_labeler_did * Use labeldef default setting * Add definedBy to interpretted label defs * Improve dev-env mocks for labels * Remove global label defs for dmca-violation, doxxing, and !no-promote * Change nudity global label def to default to ignore and no longer be adult-only * Remove old !no-promote tests * Add mod authorities header and move bsky labeler into it * Rename modsPref and addModService/removeModService to labelersPref and add/removeLabeler * Add defaultSetting and adultOnly to custom label value definitions * Rename InterprettedLabelValueDefinition to InterpretedLabelValueDefinition * Update dev-env mock * Move muted words and hidden posts into moderationPrefs * Add muted word and hidden post handling to moderatePost * Add mutewords tests * Finish muteword tests * Add mod-authority.test to dev-env * Rename global label value def gore to graphic-media * Fix typo * Stop converting old label values * Update label target=profile behaviors: dont filter content on hide, dont blur display names, but do show the info cards * Update label target=account behaviors: dont blur media of content * Add muteword moderation behaviors * Fix mock label defs * Implement quote-post moderation handling * Add adult content test * Handle sync legacy labels (#2291) * Handle sync legacy labels * Remap values on read * Filter out double-written legacy label values * Better naming, fix types * Fix test * Update moderation docs in sdk * Update to new atproto-accept-labelers header behavior * Add getLabelDefinitions() helper method * Add proxy header support to agent * Update mock moderation * lint * Implement moderation for userlists and feedgens * Add another test label * fix labeler in dev-env agents * fix label hydration test * fix lint error * fix agent test * fix takedown labels test --------- Co-authored-by: Eric Bailey <git@esb.lol> Co-authored-by: dholms <dtholmgren@gmail.com>
2024-03-12 21:10:19 -07:00
for (const alert of mod.ui('contentList').alerts) {
// render this alert
Labeling & moderation updates to SDK (#1366) * First pass on label definitions and reference-doc generation for them * Tune labels * Drop the 'csam' label in favor of using !hide CSAM is an extremely delicate issue. Moderators must be careful to remove it from the system without calling direct attention to it. Using the generic !hide achieves the same effect while obscuring the reason for the removal. Server and AppView bans will then be employed (along with any other needed mechanisms) to strip the content from the network. There is also a 'false accusation' concern with using the csam label. Fingerprinting techniques and AI are used to scan for csam. These are capable of producing false positives which will then be reverted after human review. The reputational damage caused by a false positive could be severe, so we want to be careful about any system which might publicize a false positive. * Add label definition code generation * Implement all type signatures for moderation * Complete a first pass on the labeling sdk * Add post-moderation test suite * Add post moderation behavior documentation * Add self-post behaviors * Improve post moderation doc * Tune up the post moderation doc * Tune up the post moderation doc * Tune up the post moderation doc * Simplify the post moderation behavior descriptions * More behavior description tuneup * Add profile moderation final behaviors and tests * Improve generated post-moderation-behaviors doc * Add profile moderation behaviors doc * Test muted-by-list specifically * Fixes to label descriptions * Fix to muted-by-list behavior * Dont blur account in moderateProfile() when muting * Tune label copy * Apply post embed blurring when account is marked with blurmedia label * Fix output signature * Fixes to blocking behavior * Rename LabelDefinitionPreference to LabelPreference * Update docs * Fix test * Fix: self-harm should blur media only * Fixes to tests * Improve label copy * Remove all labels that do not have a specific policy Communicating moderation policies with active users is important. This PR originally included labels which were proposed but did not yet have policies. While we didn't intend to use them until a policy was established, I decided it's better to hold off putting them in the code until we're sure about them. They can be found in backup files prefixed with "proposed-".
2023-08-03 10:28:06 -07:00
}
Additional 3p labeler updates (#2286) * Rename bsky_labeler_did * Use labeldef default setting * Add definedBy to interpretted label defs * Improve dev-env mocks for labels * Remove global label defs for dmca-violation, doxxing, and !no-promote * Change nudity global label def to default to ignore and no longer be adult-only * Remove old !no-promote tests * Add mod authorities header and move bsky labeler into it * Rename modsPref and addModService/removeModService to labelersPref and add/removeLabeler * Add defaultSetting and adultOnly to custom label value definitions * Rename InterprettedLabelValueDefinition to InterpretedLabelValueDefinition * Update dev-env mock * Move muted words and hidden posts into moderationPrefs * Add muted word and hidden post handling to moderatePost * Add mutewords tests * Finish muteword tests * Add mod-authority.test to dev-env * Rename global label value def gore to graphic-media * Fix typo * Stop converting old label values * Update label target=profile behaviors: dont filter content on hide, dont blur display names, but do show the info cards * Update label target=account behaviors: dont blur media of content * Add muteword moderation behaviors * Fix mock label defs * Implement quote-post moderation handling * Add adult content test * Handle sync legacy labels (#2291) * Handle sync legacy labels * Remap values on read * Filter out double-written legacy label values * Better naming, fix types * Fix test * Update moderation docs in sdk * Update to new atproto-accept-labelers header behavior * Add getLabelDefinitions() helper method * Add proxy header support to agent * Update mock moderation * lint * Implement moderation for userlists and feedgens * Add another test label * fix labeler in dev-env agents * fix label hydration test * fix lint error * fix agent test * fix takedown labels test --------- Co-authored-by: Eric Bailey <git@esb.lol> Co-authored-by: dholms <dtholmgren@gmail.com>
2024-03-12 21:10:19 -07:00
for (const inform of mod.ui('contentList').informs) {
// render this inform
Labeling & moderation updates to SDK (#1366) * First pass on label definitions and reference-doc generation for them * Tune labels * Drop the 'csam' label in favor of using !hide CSAM is an extremely delicate issue. Moderators must be careful to remove it from the system without calling direct attention to it. Using the generic !hide achieves the same effect while obscuring the reason for the removal. Server and AppView bans will then be employed (along with any other needed mechanisms) to strip the content from the network. There is also a 'false accusation' concern with using the csam label. Fingerprinting techniques and AI are used to scan for csam. These are capable of producing false positives which will then be reverted after human review. The reputational damage caused by a false positive could be severe, so we want to be careful about any system which might publicize a false positive. * Add label definition code generation * Implement all type signatures for moderation * Complete a first pass on the labeling sdk * Add post-moderation test suite * Add post moderation behavior documentation * Add self-post behaviors * Improve post moderation doc * Tune up the post moderation doc * Tune up the post moderation doc * Tune up the post moderation doc * Simplify the post moderation behavior descriptions * More behavior description tuneup * Add profile moderation final behaviors and tests * Improve generated post-moderation-behaviors doc * Add profile moderation behaviors doc * Test muted-by-list specifically * Fixes to label descriptions * Fix to muted-by-list behavior * Dont blur account in moderateProfile() when muting * Tune label copy * Apply post embed blurring when account is marked with blurmedia label * Fix output signature * Fixes to blocking behavior * Rename LabelDefinitionPreference to LabelPreference * Update docs * Fix test * Fix: self-harm should blur media only * Fixes to tests * Improve label copy * Remove all labels that do not have a specific policy Communicating moderation policies with active users is important. This PR originally included labels which were proposed but did not yet have policies. While we didn't intend to use them until a policy was established, I decided it's better to hold off putting them in the code until we're sure about them. They can be found in backup files prefixed with "proposed-".
2023-08-03 10:28:06 -07:00
}
```
Additional 3p labeler updates (#2286) * Rename bsky_labeler_did * Use labeldef default setting * Add definedBy to interpretted label defs * Improve dev-env mocks for labels * Remove global label defs for dmca-violation, doxxing, and !no-promote * Change nudity global label def to default to ignore and no longer be adult-only * Remove old !no-promote tests * Add mod authorities header and move bsky labeler into it * Rename modsPref and addModService/removeModService to labelersPref and add/removeLabeler * Add defaultSetting and adultOnly to custom label value definitions * Rename InterprettedLabelValueDefinition to InterpretedLabelValueDefinition * Update dev-env mock * Move muted words and hidden posts into moderationPrefs * Add muted word and hidden post handling to moderatePost * Add mutewords tests * Finish muteword tests * Add mod-authority.test to dev-env * Rename global label value def gore to graphic-media * Fix typo * Stop converting old label values * Update label target=profile behaviors: dont filter content on hide, dont blur display names, but do show the info cards * Update label target=account behaviors: dont blur media of content * Add muteword moderation behaviors * Fix mock label defs * Implement quote-post moderation handling * Add adult content test * Handle sync legacy labels (#2291) * Handle sync legacy labels * Remap values on read * Filter out double-written legacy label values * Better naming, fix types * Fix test * Update moderation docs in sdk * Update to new atproto-accept-labelers header behavior * Add getLabelDefinitions() helper method * Add proxy header support to agent * Update mock moderation * lint * Implement moderation for userlists and feedgens * Add another test label * fix labeler in dev-env agents * fix label hydration test * fix lint error * fix agent test * fix takedown labels test --------- Co-authored-by: Eric Bailey <git@esb.lol> Co-authored-by: dholms <dtholmgren@gmail.com>
2024-03-12 21:10:19 -07:00
## Sending moderation reports
Any Labeler is capable of receiving moderation reports. As a result, you need to specify which labeler should receive the report. You do this with the `Atproto-Proxy` header:
```typescript
agent
.withProxy('atproto_labeler', 'did:web:my-labeler.com')
.createModerationReport({
reasonType: 'com.atproto.moderation.defs#reasonViolation',
reason: 'They were being such a jerk to me!',
subject: { did: 'did:web:bob.com' },
})
```