Skip to content

[Product Gap] Build an auditable data-hygiene utility suite #1247

Description

@seonghobae

Buyer problem

Naruon needs reusable text-hygiene tools for email and agent workflows, but a buyer must never mistake a narrow regular expression for comprehensive privacy protection or a legacy digest for a secure hash.

This issue replaces PR #1246 with a product-grade vertical slice that is explicit about supported scope, preserves evidence, and fails safely.

Product contract

Implement three standalone tools that also work as modular registry components.

1. url_evidence_extractor

Return bounded, source-grounded URL evidence rather than unvalidated regex strings.

Required output per match:

  • raw_value
  • normalized_value
  • source_start
  • source_end
  • scheme_code
  • host_value
  • contains_userinfo
  • validation_status
  • warning_codes

Requirements:

  • accept only explicitly supported http and https absolute URI references;
  • parse components using a standard parser after candidate delimitation;
  • preserve the exact source substring and Unicode offsets;
  • handle parentheses, terminal punctuation, query strings, fragments, IPv6, IDNA and percent encoding deterministically;
  • never fetch an extracted URL;
  • mark embedded user information and other dangerous forms rather than silently treating them as safe;
  • enforce input length, maximum matches and per-match length;
  • produce deterministic order and deduplication without losing repeated-source locations.

2. contact_data_redactor

Do not call the first release a general PII redactor. The supported classes must be explicit and versioned.

P0 classes:

  • email addresses, including documented internationalization limits;
  • Korean and E.164-compatible telephone forms, including spaces, parentheses and country prefixes.

Required output:

  • redacted text;
  • immutable ordered match records with class, source span, replacement span and detector version;
  • match counts by class;
  • warning that unsupported PII classes are not removed;
  • optional deterministic placeholders that preserve entity distinction without exposing values.

Requirements:

  • no original personal-data value in logs, errors or metrics;
  • configurable but bounded false-positive policy;
  • golden corpus with Korean, English and mixed-script examples;
  • hostile Unicode, overlapping match, malformed input and maximum-size tests;
  • precision, recall, span F1 and calibration/reporting fixture against human-labelled data;
  • no claim of anonymization or irreversible de-identification.

3. content_checksum_generator

Default and normal product surface:

  • SHA-256;
  • SHA-3-256;
  • BLAKE2b-256 when interoperability permits.

MD5 and SHA-1 must not appear in the normal security-labelled surface. A legacy compatibility mode may be considered only when all of the following hold:

  • tool and output are named legacy_checksum;
  • disabled by default;
  • explicit non_security_use=true input is required;
  • response contains a machine-readable deprecation warning;
  • doctoring explains collision risk and migration;
  • no authentication, integrity, signature or security recommendation uses the legacy result.

Quality and security gates

  • production statement coverage: 100%;
  • production branch coverage: 100%;
  • public module/class/function/docstring coverage: 100%;
  • property tests for source-span round trips and deterministic output;
  • fuzz tests for hostile Unicode and oversized candidate boundaries;
  • exact current-head Application CI, Bandit, Semgrep, CodeQL/dependency/security scans;
  • no test-only success substitutions and no skipped security tests;
  • CHANGELOG.md, ARCHITECTURE.md or ADR update, and buyer/operator documentation;
  • database/audit objects, if added, use two-or-more-word snake_case names;
  • no LLM is required for deterministic detection. If an optional LLM verifier is introduced, use NVIDIA_NIM_API_KEY, never COPILOT_GITHUB_TOKEN, keep it outside the deterministic redaction path, and record model/prompt evidence without exposing source PII.

Realistic acceptance tests

  • punctuation-balanced URLs in Korean and English prose;
  • repeated same URL at different offsets;
  • userinfo, IDNA, IPv6, fragments and percent-encoded paths;
  • Korean mobile/landline/service numbers, E.164, spaces and parentheses;
  • near-miss strings that must not be redacted;
  • mixed email and phone overlaps;
  • 1 MiB bounded input and excessive-match fail-closed behavior;
  • deterministic checksum vectors and streaming/chunked equivalence;
  • explicit proof that legacy digests cannot be selected without the compatibility acknowledgement.

Standards and doctoring — APA 7th

Doctoring must include at least the following current primary sources and state their status accurately:

Boeckl, K., & Lefkovitz, N. (2020). NIST Privacy Framework: A tool for improving privacy through enterprise risk management, version 1.0. National Institute of Standards and Technology. https://doi.org/10.6028/NIST.CSWP.01162020

Berners-Lee, T., Fielding, R., & Masinter, L. (2005). Uniform resource identifier (URI): Generic syntax (RFC 3986). RFC Editor. https://doi.org/10.17487/RFC3986

McCallister, E., Grance, T., & Scarfone, K. (2010). Guide to protecting the confidentiality of personally identifiable information (PII) (NIST SP 800-122). National Institute of Standards and Technology. https://doi.org/10.6028/NIST.SP.800-122

National Institute of Standards and Technology. (2022, December 15). NIST transitioning away from SHA-1 for all applications. https://www.nist.gov/news-events/news/2022/12/nist-transitioning-away-sha-1-all-applications

At implementation time, re-check whether NIST Privacy Framework 1.1 has moved beyond its initial public draft; as of April 1, 2026, NIST still labels it “coming soon.”

Delivery sequence

  1. test-first contracts and gold corpus;
  2. bounded pure detectors and checksum API;
  3. API/registry integration;
  4. audit and exact-value documentation;
  5. full current-head verification;
  6. one focused PR, independent approval, then merge.

Supersedes #1246.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: authAuthentication, authorization, identity, or tenant isolationarea: ci-cdCI, GitHub Actions, checks, release, or supply chainarea: dependenciesDependency or lockfile maintenancearea: securitySecurity boundary, hardening, or vulnerability preventionmaintenancepriority: mediumNormal-priority or P2 workscope: product-gapCustomer-visible product gapstatus: triagedOpen issue has an organization taxonomy assignmenttype: featureNew or expanded product capability

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions