Skip to content

feat(kyc): delete identity data from security settings cp-8.21.0 - #39037

Merged
georgeweiler merged 5 commits into
mainfrom
feat/kyc-delete-identity-settings
Nov 13, 2026
Merged

georgeweiler merged 5 commits into
mainfrom
feat/kyc-delete-identity-settings

Conversation

@georgeweiler

@georgeweiler georgeweiler commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Description

Customers who have started identity verification can delete the encrypted identity data MetaMask holds from Security settings, without a separate screen.

The section appears only when the money-account flag is on and a KYC session exists. Confirming calls KycController.deleteEncryptedStorage(). That requires @metamask/kyc-controller 0.15.0 and the KycService:createDeletion and KycService:completeDeletion messenger actions. Cancelling the confirmation leaves the data in place.

Performance checks do not apply: this is a static settings section with no lists, polling, or animation. It has not been exercised on a device yet.

Changelog

CHANGELOG entry: Added a Security settings control to delete encrypted identity verification data.

Related issues

Fixes:

Refs: #38381

Manual testing steps

Feature: delete identity data from Security settings

  Scenario: the section stays hidden until verification has started
    Given the money-account feature flag is off or there is no KYC session
    When I open Security settings
    Then I do not see "Delete Identity Data"

  Scenario: confirming deletes the encrypted identity data
    Given the money-account feature flag is on and a KYC session exists
    When I open Security settings
    And I tap "Delete identity data"
    And I confirm "This cannot be undone."
    Then the app deletes the encrypted identity data and reports success

  Scenario: cancelling leaves the identity data in place
    Given the delete section is visible
    When I tap "Delete identity data" and then cancel
    Then nothing is deleted

Screenshots/Recordings

Before

N/A

After

Screenshot 2026-11-06 at 12 54 42 PM Screenshot 2026-11-06 at 12 54 50 PM Screenshot 2026-11-06 at 12 54 24 PM

Pre-merge author checklist

Performance checks (if applicable)

  • I've tested on Android
    • Ideally on a mid-range device; emulator is acceptable
  • I've tested with a power user scenario
    • Use these power-user SRPs to import wallets with many accounts and tokens
  • I've instrumented key operations with Sentry traces for production performance metrics

For performance guidelines and tooling, see the Performance Guide.

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

Description

Customers who have started identity verification can delete the encrypted identity data MetaMask holds from Security settings, without a separate screen.

The section appears only when the money-account flag is on and a KYC session exists. Confirming asks for an email one-time code, then calls KycController.deleteEncryptedStorage({ aal2Token }) with that verification token. That requires @metamask/kyc-controller 0.16.0 and the KycService:createDeletion and KycService:completeDeletion messenger actions. Cancelling the confirmation, or backing out of the email check, leaves the data in place.

Performance checks do not apply: this is a static settings section with no lists, polling, or animation. It has not been exercised on a device yet.

Changelog

CHANGELOG entry: Added a Security settings control to delete encrypted identity verification data.

Related issues

Fixes:

Refs: #38381

Manual testing steps

Feature: delete identity data from Security settings

  Scenario: the section stays hidden until verification has started
    Given the money-account feature flag is off or there is no KYC session
    When I open Security settings
    Then I do not see "Delete Identity Data"

  Scenario: confirming deletes the encrypted identity data
    Given the money-account feature flag is on and a KYC session exists
    When I open Security settings
    And I tap "Delete identity data"
    And I confirm "This cannot be undone."
    And I complete the email one-time code check
    Then the app deletes the encrypted identity data and reports success

  Scenario: cancelling leaves the identity data in place
    Given the delete section is visible
    When I tap "Delete identity data" and then cancel
    Then nothing is deleted

  Scenario: backing out of email verification leaves the identity data in place
    Given the delete section is visible
    When I tap "Delete identity data" and confirm
    And I back out of the email one-time code check
    Then nothing is deleted and no error is shown

Screenshots/Recordings

Before

N/A

After

N/A

Pre-merge author checklist

Performance checks (if applicable)

  • I've tested on Android
    • Ideally on a mid-range device; emulator is acceptable
  • I've tested with a power user scenario
    • Use these power-user SRPs to import wallets with many accounts and tokens
  • I've instrumented key operations with Sentry traces for production performance metrics

For performance guidelines and tooling, see the Performance Guide.

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.
Open in Web Open in Cursor 

Note

Medium Risk
Introduces user-triggered deletion of encrypted KYC data with MFA gating; mistakes could affect identity verification state, but scope is limited to customers with an active session and the feature flag.

Reviewed by Cursor Bugbot for commit 23be80c. Bugbot is set up for automated code reviews on this repo. Configure here.

Put encrypted identity deletion on the existing Security settings page so customers do not need a separate screen.

Co-authored-by: Cursor <cursoragent@cursor.com>
@georgeweiler georgeweiler self-assigned this Nov 5, 2026
@github-actions

github-actions Bot commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

@github-actions github-actions Bot added the size-M label Nov 5, 2026
@metamask-ci metamask-ci Bot added the team-money-movement issues related to Money Movement features label Nov 5, 2026
@github-actions

github-actions Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Smart E2E Test Selection

Selected E2E tags

SmokeSeedlessOnboarding
SmokeAccounts

AI Confidence: 88

E2E reasoning

Expand to read

PR adds a new DeleteIdentityData section to Security Settings (below DeleteWalletData), a new test ID constant, and additive locale keys. The section is gated by neobank market and KYC state and returns null when ineligible. The only plausible effect on smoke specs is a layout shift in Security Settings, which could touch SRP reveal/export and delete wallet/reset flows. Keeping the seed tags SmokeAccounts and SmokeSeedlessOnboarding covers those.

View run

@lorenzosantos lorenzosantos changed the title feat(kyc): delete identity data from security settings feat(kyc): delete identity data from security settings cp-8.20.0 Nov 6, 2026
@metamask/kyc-controller 0.16.0 makes deleteEncryptedStorage take
{ aal2Token }. Confirming deletion now runs email OTP through
useMfa().verifyOrEnroll and passes the access token. Cancelling
that flow leaves the data in place.

Co-authored-by: george.weiler <george.weiler@consensys.net>
@lorenzosantos lorenzosantos changed the title feat(kyc): delete identity data from security settings cp-8.20.0 feat(kyc): delete identity data from security settings cp-8.21.0 Nov 12, 2026
@Akaryatrh
Akaryatrh marked this pull request as ready for review November 13, 2026 11:33
@Akaryatrh
Akaryatrh requested a review from a team as a code owner November 13, 2026 11:33

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit cb07387. Configure here.

Signed-off-by: Sébastien Van Eyck <sebastien.vaneyck@consensys.net>
@sonarqubecloud

Copy link
Copy Markdown

@georgeweiler
georgeweiler added this pull request to the merge queue Nov 13, 2026
Merged via the queue into main with commit 3d642d6 Nov 13, 2026
93 of 94 checks passed
@georgeweiler
georgeweiler deleted the feat/kyc-delete-identity-settings branch November 13, 2026 18:57
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 13, 2026
@metamask-ci metamask-ci Bot added the release-8.21.0 Issue or pull request that will be included in release 8.21.0 label Nov 13, 2026
@alidotforrest

Copy link
Copy Markdown
Contributor

hey @georgeweiler! is there any chance we could get a follow up with a few small copy updates for the delete identity data section (all under identity_verification in en.json)?

  1. delete_section_title
    Current: "Delete Identity Data"
    Suggested: "Delete identity data"
    Section headers use sentence case, and this matches the button label.

  2. delete_confirm_message
    Current: "This cannot be undone."
    Suggested: "This can’t be undone."
    We use contractions in UI copy.

  3. delete_error_message
    Current: "Something went wrong. Please try again."
    Suggested: "We couldn’t delete your identity data. Try again."
    Our guidelines skip "please" and ask errors to say what happened. If retrying won't help here, let's point to support instead.

  4. delete_error_title
    Current: "Couldn't delete identity data"
    Suggested: "Couldn’t delete identity data"
    Swapping in a curly apostrophe.

thank you!

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

Labels

release-8.21.0 Issue or pull request that will be included in release 8.21.0 size-M team-money-movement issues related to Money Movement features

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants