Moderate sketch lab text on the backend#74073
Open
molly-moen wants to merge 6 commits into
Open
Conversation
The Sketch Lab share-filtering frontend (share dialog failure message, privacy-profanity blocked view) now lives on the molly/lab2-profanity-frontend branch. This branch keeps the backend filtering only. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Adds backend share-filtering support for Sketch Lab by extracting user-entered text from Sketch Lab’s structured (React Flow) source JSON and applying existing PII/profanity checks during sources access.
Changes:
- Extend
ShareFilteringto support structured sources via a Sketch Lab text extractor and includesketchlabin filtered project types. - Update legacy sources middleware to pass through structured
sourcedata for filtering (instead of skipping non-string sources). - Add unit/integration coverage plus recorded S3 VCR cassettes and Sketch Lab JSON fixtures.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| shared/test/fixtures/vcr/sources/policy_channel_api_sketchlab.yml | VCR cassette for Sketch Lab policy-channel API flows. |
| shared/test/fixtures/vcr/sources/get_source_blocks_sketchlab_profanity_violations.yml | VCR cassette covering Sketch Lab profanity-violation access behavior. |
| lib/test/cdo/test_share_filtering.rb | Adds unit tests for Sketch Lab text extraction and filtering behavior. |
| lib/cdo/share_filtering.rb | Adds Sketch Lab structured-source extraction and wires it into share failure detection. |
| dashboard/legacy/test/middleware/test_sources.rb | Adds middleware tests validating Sketch Lab access restrictions under violations. |
| dashboard/legacy/test/fixtures/privacy-profanity/sketchlab-privacy-violation-source.json | Sketch Lab source fixture containing a privacy violation string. |
| dashboard/legacy/test/fixtures/privacy-profanity/sketchlab-normal-source.json | Sketch Lab source fixture representing clean content. |
| dashboard/legacy/middleware/helpers/profanity_privacy_helper.rb | Stops assuming source must be a String; passes structured sources through to ShareFiltering. |
molly-moen
marked this pull request as ready for review
July 23, 2026 21:21
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR filters user-provided text in sketch lab (text on shapes, in text boxes, and in alt text for images). For now this is mostly silent; users won't see that their project has been flagged unless they look at the share link in another account, in which case the canvas will be blank. Messaging the user and putting up an error in share will be done as a follow-up, as this is the first time we want to do this for lab2.
Previously we only supported filtering blockly projects, so this sets up a new pattern to support other json structures with user-provided text.
The vast majority of lines here are tests and test fixtures 😄
Temporary share view for a blocked project
Note the main.json is 404'ing. If the project is updated to no longer have profanity, the main.json loads.

Links