Skip to content

Add text PII detection and redaction#263

Merged
JE-Chen merged 1 commit into
devfrom
feat/pii-text-batch
Jun 20, 2026
Merged

Add text PII detection and redaction#263
JE-Chen merged 1 commit into
devfrom
feat/pii-text-batch

Conversation

@JE-Chen

@JE-Chen JE-Chen commented Jun 20, 2026

Copy link
Copy Markdown
Member

AI-governance batch (from multi-agent web research; verified absent — image redaction was text-blind). Full layers + tests + EN/Zh v55 docs + README.

Feature (utils/pii_text, pure-stdlib re+hashlib)

  • detect_pii / redact_pii_text: find & mask emails, phones, SSNs, credit cards, IPv4, IBANs in free text (OCR/clipboard/LLM I/O/logs) — the string-level complement to the image-only redaction. Overlapping spans dedupe (earlier-then-longer wins, so a card isn't also a phone). Redact modes: label/mask/partial/hash. Patterns have no nested quantifiers (backtracking-safe).
  • Executor AC_detect_pii / AC_redact_pii (kinds as list or JSON string); MCP ac_*; Builder under Data.

Verification

  • 10 tests pass (detect each kind, spans, kinds filter, card-not-also-phone overlap, redact label/mask/partial/hash, no-PII unchanged, executor round-trip, wiring, facade); ruff clean; radon no CC≥C; bandit clean; PySide6-free.

@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 36 complexity · 0 duplication

Metric Results
Complexity 36
Duplication 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@JE-Chen JE-Chen merged commit 5d3a4ea into dev Jun 20, 2026
16 checks passed
@JE-Chen JE-Chen deleted the feat/pii-text-batch branch June 20, 2026 14:56
@sonarqubecloud

Copy link
Copy Markdown

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.

1 participant