Skip to content

feat(privacy): 增加应用黑名单与敏感信息脱敏 #6

Description

@v833

Suggested labels: enhancement

Background

Current behavior:

  • AI actions send the selected text and active conversation to the configured model endpoint.
  • API keys use Electron safe storage, but all applications are eligible for selection listening.

Problem:

  • Password managers, banking software, remote desktop, and internal tools can expose sensitive text accidentally.
  • Selected content may include phone numbers, email addresses, identity numbers, secrets, or tokens.

Needed change:

  • Add application exclusions and optional sensitive-data redaction before network requests.

Goal

Prevent accidental data transmission while keeping local copy behavior available.

User Stories

  • As a privacy-conscious user, I want the assistant disabled in selected applications.
  • As a user handling sensitive documents, I want a redaction preview before sending.
  • As an administrator, I want predictable local-only behavior for blocked applications.

Requirements

1. Application blacklist

  • Match by executable name and optionally window title.
  • Provide recommended exclusions without enabling unverifiable guesses automatically.
  • Suppress AI toolbar actions in blocked applications while preserving configurable local copy behavior.

2. Sensitive-data detection

  • Detect configurable patterns for phone numbers, email addresses, identity numbers, API keys, and tokens.
  • Show a preview and require explicit confirmation when redaction changes content.
  • Allow per-pattern enablement and replacement style.

3. Privacy controls

  • Keep telemetry disabled.
  • Keep conversation history disabled by default.
  • Provide one command to clear local settings and optional history.

Acceptance Criteria

  • Blocked applications never trigger a model request.
  • Blacklist matching works across executable names and configured title patterns.
  • Redaction never modifies clipboard or source application content.
  • Users can preview, accept, or cancel redacted requests.
  • API keys and detected secrets never appear in logs or error details.
  • Privacy behavior is documented in Chinese README and settings.
  • Automated tests cover matching, redaction, cancellation, and no-network guarantees.

Test Plan

  • Automated tests: process matching and redaction fixtures including false positives.
  • Manual verification: password manager test window, remote desktop title, and selected sensitive samples.
  • Regression coverage: non-blocked apps and local copy action.

Out of Scope

  • Enterprise DLP integration.
  • Central policy management.
  • Guaranteeing detection of every sensitive value.

Dependencies / Risks

  • Pattern detection has false positives and must never silently alter sent content.
  • Window-title matching can be unstable and should be secondary to executable matching.

Effort Estimate

  • Implementation: 5-7 days.
  • Tests + docs: 3 days.
  • Total: 8-10 days.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions