Skip to content

[Security/Privacy]: Add data anonymization and right-to-deletion — users must be able to permanently delete all their thought data #1737

Description

@divyanshim27

Summary

A mental wellness app that stores users' innermost negative thoughts carries extraordinary data sensitivity obligations. Users must be able to permanently and verifiably delete all their stored thought data. Without a right-to-deletion feature, the platform may violate GDPR Article 17 (Right to Erasure) and creates severe trust and legal risks.

Problem

  • There is likely no "Delete My Account and All Data" feature.
  • User thought data (potentially the most personal data category — mental health information) may persist indefinitely.
  • Under GDPR, processing special category data (mental health) without explicit consent and deletion capability is non-compliant.
  • A data breach exposing users' negative thought logs would be a severe trust violation.

Proposed Solution

Implement a full account and data deletion flow:

@router.delete("/account")
async def delete_account(current_user=Depends(get_current_user), db=Depends(get_db)):
    # Delete all thought journal entries
    await db.thoughts.delete_many({"user_id": current_user.id})
    # Delete community contributions (anonymize or delete)
    await db.community_reframes.delete_many({"user_id": current_user.id})
    # Delete user account
    await db.users.delete_one({"id": current_user.id})
    # Invalidate all sessions
    await db.refresh_tokens.delete_many({"user_id": current_user.id})
    # Send confirmation email
    await send_deletion_confirmation(current_user.email)
    return {"message": "Your account and all data have been permanently deleted."}

With a 30-day grace period (soft delete) and immediate hard delete option.

I would be happy to implement this. Could you assign this issue to me?

Labels: security, privacy, gdpr, compliance, GSSoC 2026

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions