Skip to content

[P0][security] PolicySchema is 100% dead — enforce or remove #1882

Description

@os-zhuang

Part of the metadata liveness audit umbrella #1878 (P0 security cluster).

Problem

PolicySchema is 100% dead: password complexity, session idle/absolute timeout, forceMfa, IP allow-list (trustedRanges/vpnRequired), and audit retention/redaction are all parsed but enforced by nothing. It is not even registered as a metadata type. better-auth runs hardcoded defaults instead (auth-manager.ts:458), producing a false sense of compliance — an admin can author a strict policy and the system silently ignores it.

Decision required (enforce or remove)

  • Enforce: register policy as a metadata type, wire each group into its enforcement point (better-auth config for password/session/MFA, request middleware for IP allow-list, audit pipeline for retention/redaction).
  • Remove: delete PolicySchema from the spec so authors aren't misled, and document the actual (hardcoded) behavior.

Shipping it parsed-but-unenforced is a compliance/security liability and is not an acceptable end state.

Evidence

  • docs/audits/2026-06-security-identity-property-liveness.md
  • auth-manager.ts:458 (hardcoded defaults)

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority:p0Critical: blocker, must ship before MVPsecurity

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions