Repository navigation
Description
Finding
Governance policy editors replace failed reads with editable defaults
Impact
If a governance policy read fails after loading (for example HTTP 503), the Settings editor presents built-in defaults as if they were the organization’s saved policy. The controls remain live and editable with no warning or Retry action. An administrator can unknowingly save the defaults over an existing stricter policy, weakening security controls such as password length/character requirements, login controls, session timeout, retention, or data handling settings.
Reproduction
- Open Settings → Governance → Password policy for an organization with a saved non-default policy (for example
minLength: 24, rotation enabled). - Let
governance/queries:getPolicysettle with a server/transport failure after loading ends. - Inspect the editor.
Actual result: the editor renders five live switches and a min-length field set to 12 (DEFAULT_PASSWORD_POLICY), with no read-failure message and no Retry/Try again/Reload action. The form remains registered/editable, so saving can overwrite the unknown saved policy with defaults.
Expected result: distinguish failed reads from a successful absent/default policy. Show a read-error state with Retry and prevent save/toggle writes until a real policy response is available; preserve any previously loaded values during background refetch.
Root cause and scope
At current origin 9ea59724df24d62729a9360f3902d964dab39b3e:
services/platform/app/features/settings/governance/components/password-policy-editor.tsx:45-75destructures onlydataandisLoadingfromuseGovernancePolicy;parseConfig(policy?.config)returnsDEFAULT_PASSWORD_POLICYforundefinedanddatabecomes a loaded form whenisLoadingis false.- The render at
:156-211keeps the switches and inputs enabled; noisError,error, orrefetchbranch exists. - The same
useGovernancePolicy/parseConfig(policy?.config)pattern appears in the current policy editors for session idle timeout, login, retention, upload, data notice, DSAR, personalization, routing, moderation, model access, PII, two-factor, voice output, and system prompt settings. This report is grouped around the shared failure mode; Password policy is the reproduced representative because it changes security posture directly.
Evidence
- Probe:
/Users/yannick/.codex/notes/tale-1000-additional/settings-next/governance-policy-read-error.probe.test.tsx - Replay:
/Users/yannick/.codex/notes/tale-1000-additional/settings-next/governance-policy-read-error.replay.log - Probe assertion: one Vitest test passed with
data: undefined, isLoading:false, isError:true; PasswordPolicyEditor rendered defaults (five switches and spinbutton value 12) with no alert/retry affordance.
Activity
yannickmonney commentedon Oct 5, 2026
ACCEPT carried.
dc7c9fa3018c312e9486409b6d9d26951e9b2411.0edf8ba7e523315d7888b7863a497ec2fde8b419(fix(platform): complete governance skeleton browser query mock), touching the expected Browser test file;fix(platform)is an allowed commitlint type/scope.824d030d208d333ef908089f7344429fd51a1209is a merge ofmainf04fe7c73fb8da0f3a31f771751a9b880460e545; file composition is the author fix plus main content.Delegated merge is proceeding with
--match-head-commit.