Repository navigation
Closed
Labels
bugBug
Description
Problem
Settings › Governance › Guardrails drops every saved custom PII pattern when it loads, then deletes them on the next PII save. Paths at main acd5dbd10.
- Saved shape. Custom patterns are stored in the shape the shared schema enforces,
{ name, regex, replacement }:piiCustomPatternSchemainpackages/shared/src/schemas/pii.ts:49-79is.strict(). The panel writes that shape (app/features/settings/governance/components/pii/pii-config-panel.tsx:348-353), and its type isPiiCustomPattern(:69). - Load filter.
app/features/settings/governance/components/pii-config.tsx:88-90keeps only entries passingisCustomPattern. That guard (:99-110) requires a string field namedpattern, which a stored entry never has. So every saved custom pattern is filtered out, and the panel shows none. - Next save. Any later PII save (the enable switch, the mode, a built-in pattern checkbox) sends
customPatterns: nextValue.customPatterns.filter(…)(:175-178), which is now[]. The admin's custom rules are deleted without a word, and the PII scrubber stops applying them.
Why nothing catches it: every case in pii-config.test.tsx uses customPatterns: [] (:42, :63, :75, :91), so no test loads a saved custom pattern. The guard's pattern check predates #4292, the file's latest change (it is already present at 68af0bc212^).
Who is affected: any organization that added custom patterns (for example an internal ID format) loses them the first time anyone saves a PII setting. Until then the admin is told none exist, and may add them again, only for them to vanish again.
Expected
isCustomPatternchecksregexandreplacement, matchingPiiCustomPattern, or parses withpiiCustomPatternSchema.- Never write a smaller
customPatternsthan the server holds because of a client-side filter. If an entry can't be read, show it as unreadable instead of dropping it. - Regression: a
pii-configtest that loads a policy with one saved custom pattern. It shows that pattern, and a mode change saves it unchanged. Onacd5dbd10the pattern is missing and the save sends[]. - Recovery note: organizations that saved PII settings since custom patterns were added may already have lost them. Check the audit log's policy history for earlier
customPatterns.
Severity and owner
- Severity: high. It is silent loss of a privacy control's configuration, triggered by an ordinary save.
- Owner: platform (governance, guardrails).
- Found by: Review A (TALE-358), 2026-10-12 08:15 Zurich occurrence, oldest-due
governance.guardrailsslice. This is static reading atacd5dbd10, verified against the shared schema and the backend (lib/pii/resolve-config.tspassescustomPatternsthrough unchanged). I didn't run it, because Review A's stack is BLOCKED.
Metadata
Metadata
Assignees
Labels
bugBug
Activity
yannickmonney commentedon Oct 12, 2026
Review A recheck (TALE-358, 2026-10-12 20:15 Zurich occurrence): fixed on
mainc94f1fd84. I read the merged source statically and checked the CI run on that exact commit; no live stack was used. Paths are underservices/platform/app/features/settings/governance/components/.pii-config.tsx:92), so{ name, regex, replacement }entries survive.:174).isPiiPolicyReadable,:102-105;policy-read-boundary.tsx:105-106). Enabling a custom-only policy keeps its mode (:204).pii-config.browser.test.tsxran uncached and passed inmain's Checks run 38287683781 (job "Browser", 114939862010;@tale/platform#test:browserturbo MISS, 67 files)..github/release-notes/v0.5.87.md:12): they say custom rules now survive, but not that rules may already have been deleted on earlier versions. Please add this issue's recovery note: an organization that saved any PII setting since adding custom rules should check the audit log's policy history for earliercustomPatternsand re-add them. Otherwise admins have no reason to look.