Skip to content

Conversation

@kozikkamil
Copy link
Contributor

@kozikkamil kozikkamil commented Nov 26, 2025

Description

Adds a method to report potential fraud:

  1. Gets all labels created by the user in this project
  2. Creates a Trust & Safety case for the user (MANUAL event type, HIGH severity)
  3. Removes the user from the project (prevents creating more labels)
  4. Deletes all the user's labels

Fixes # (issue)

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Document change (fix typo or modifying any markdown files, code comments or anything in the examples folder only)

All Submissions

  • Have you followed the guidelines in our Contributing document?
  • Have you provided a description?
  • Are your changes properly formatted?

New Feature Submissions

  • Does your submission pass tests?
  • Have you added thorough tests for your new feature?
  • Have you commented your code, particularly in hard-to-understand areas?
  • Have you added a Docstring?

Changes to Core Features

  • Have you written new tests for your core changes, as applicable?
  • Have you successfully run tests with your changes locally?
  • Have you updated any code comments, as applicable?

Note

Implements a fraud-reporting flow (create T&S case, remove user from project, delete their labels) and adds SDK support to delete project memberships and filter/delete labels by creator.

  • Alignerr:
    • Fraud reporting workflow in libs/lbox-alignerr/src/alignerr/alignerr_project.py:
      • report_fraud(user_id, reason, custom_metadata) orchestrates: fetch user labels, create T&S case, remove user from project, delete labels.
      • Helpers: _get_user_labels, _create_trust_safety_case, _remove_user_from_project (uses client API), _delete_user_labels.
  • Labelbox SDK:
    • Client: add delete_project_memberships(project_id, user_ids) GraphQL mutation to remove users from a project.
    • Project:
      • Extend labels(..., created_by=None) to filter labels by creator.
      • Add delete_labels_by_user(user_id) to bulk soft-delete a user’s labels.

Written by Cursor Bugbot for commit 21b5287. This will update automatically on new commits. Configure here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants