Skip to content

Make detected entity types configurable in the extension #458

@hanneshapke

Description

@hanneshapke

Motivation

Today, the proxy/extension detects and masks all entity types the model emits. Users should be able to opt-in/out of specific entity types (e.g., disable AGE or COMPANYNAME) without disabling masking entirely.

Proposal

Add a configurable entity-type selection menu in the extension options page.

Dynamic configuration

The menu must be built dynamically from the model's label set (the source of truth), not hard-coded. The model's labels live in model/trained/label_mappings.json under pii.label2id, and currently expose 26 entity types (B-/I- pairs collapsed):

SURNAME, FIRSTNAME, BUILDINGNUM, DATEOFBIRTH, EMAIL, PHONENUMBER, CITY, URL, COMPANYNAME, STATE, ZIP, STREET, COUNTRY, SSN, DRIVERLICENSENUM, PASSPORTID, NATIONALID, IDCARDNUM, TAXNUM, LICENSEPLATENUM, PASSWORD, IBAN, AGE, SECURITYTOKEN, CREDITCARDNUMBER, USERNAME

This way, when the model is retrained with a different label set, the UI automatically reflects the new entities without code changes.

Behavior

  • The backend exposes the available entity types (read from label_mappings.json) via an endpoint the extension can query.
  • The options page renders a checkbox list of all entity types returned by the backend.
  • All entities are enabled by default (existing masking behavior is preserved on first run / upgrade).
  • The user's selection is persisted in extension storage.
  • On each request, the extension sends the enabled set (or the backend filters by it) so that disabled entities pass through without masking.

Acceptance criteria

  • Backend endpoint returns the dynamic list of entity types from label_mappings.json.
  • Options page (chrome-extension/options.html / options.js) renders the list dynamically.
  • All entities checked by default; user selection persists.
  • Disabled entities are not masked in proxied traffic.
  • Retraining with a different label set updates the menu without UI code changes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Mentoring will be providedThis is a harder issue, but not too difficult with a mentoradvancedAn issue that requires major refactoring or changes to the core architecture

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions