Skip to content

feat: PII Bouncer program (engine) + robust PII scanner rules#510

Draft
joethreepwood wants to merge 3 commits into
mainfrom
pii-bouncer
Draft

feat: PII Bouncer program (engine) + robust PII scanner rules#510
joethreepwood wants to merge 3 commits into
mainfrom
pii-bouncer

Conversation

@joethreepwood
Copy link
Copy Markdown
Contributor

@joethreepwood joethreepwood commented Jun 4, 2026

Summary

Adds the PII Bouncer to the wizard and hardens PostHog's PII detection. Three-repo effort; this PR is the wizard (engine) side. Companion PRs:

What's here

1. PII Bouncer program — a new pii-bouncer subcommand that scans frontend forms for sensitive inputs, adds the ph-no-capture privacy class, and configures session-recording masking so PII never reaches replays.

Per review feedback, all the agent instructions live in the context-mill skill, not the wizard. This PR is pure engine: a createSkillProgram() call, abort-case routing, and the outro. The earlier draft hardcoded the scan steps / abort signals / report format in customPrompt — that "packaged English" moved to the skill's SKILL.md.

  • src/lib/programs/pii-bouncer/index.tscreateSkillProgram() factory call; one-line customPrompt
  • src/lib/programs/pii-bouncer/abort-cases.tsPII_BOUNCER_ABORT_CASES (terminal UX copy); the match regexes are the contract with the skill's [ABORT] signals
  • Deleted detect.ts (wizard-side detection + the duplicated package walker a reviewer flagged) — the skill now detects prerequisites and emits [ABORT]

2. Robust PII scanner rules — mirrors the two new warlock rules into the wizard's inline scanner (yara-scanner.ts) so they take effect today, until the wizard consumes warlock directly:

  • pii_in_person_properties — sensitive PII in register/setPersonProperties (extends the existing capture/identify coverage)
  • pii_value_in_tracking_call — PII-shaped literal values (email/SSN/formatted card) under any property key

Architecture note

This PR is the result of a "wizard = engine, context-mill = cartridge" cleanup:

  • wizard program = the agent + terminal UX. Loads a skill by id, routes abort signals, renders outros. No product knowledge.
  • context-mill skill = the instructions (what to scan, how to mask, what to report). Loaded at runtime.
  • warlock = the security rules. Source of truth for scanner rules; the wizard's inline copy is a temporary mirror.

Test plan

  • pnpm build clean
  • pnpm test — 770 pass (+10 new scanner tests)
  • pnpm lint — 0 errors
  • node dist/bin.js --help lists pii-bouncer
  • Skill resolves + downloads from the local context-mill dev server (/skill-menu.jsonpii-bouncer.zip with SKILL.md)
  • Manual e2e (reviewer): via wizard-workbench mprocs stack, run pii-bouncer against a frontend app with forms; confirm ph-no-capture added, init mask config set, posthog-pii-bouncer-report.md written, and the [ABORT] no-posthog-js path renders a clean outro on a no-PostHog project.

Notes for reviewers

  • Inline scanner mirror is a deliberate dual-write — warlock is source of truth; flagged for a future "wizard consumes warlock directly" cleanup.
  • .claude/skills/adding-skill-program/SKILL.md claims bin.ts auto-derives subcommands from the registry; it doesn't (explicit .use() wiring is required). Worth a docs-only fast-follow.

🤖 Generated with Claude Code

Scans frontend forms for sensitive inputs and configures session
recording masking. Wizard-side plumbing only: program config,
detection (posthog-js presence), CLI subcommand, abort cases for
no-posthog-js / no-init-call / no-frontend-templates. The actual
form-scanning and edit recipes live in a follow-up context-mill
PR — without that skill, the program registers and runs end-to-end
but the agent hits a structured skill-not-found outro.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 4, 2026

🧙 Wizard CI

Run the Wizard CI and test your changes against wizard-workbench example apps by replying with a GitHub comment using one of the following commands:

Test all apps:

  • /wizard-ci all

Test all apps in a directory:

  • /wizard-ci basic-integration
  • /wizard-ci error-tracking-upload-source-maps
  • /wizard-ci misc
  • /wizard-ci revenue

Test an individual app:

  • /wizard-ci basic-integration/android
  • /wizard-ci basic-integration/angular
  • /wizard-ci basic-integration/astro
Show more apps
  • /wizard-ci basic-integration/django
  • /wizard-ci basic-integration/fastapi
  • /wizard-ci basic-integration/flask
  • /wizard-ci basic-integration/javascript-node
  • /wizard-ci basic-integration/javascript-web
  • /wizard-ci basic-integration/laravel
  • /wizard-ci basic-integration/next-js
  • /wizard-ci basic-integration/nuxt
  • /wizard-ci basic-integration/python
  • /wizard-ci basic-integration/rails
  • /wizard-ci basic-integration/react-native
  • /wizard-ci basic-integration/react-router
  • /wizard-ci basic-integration/sveltekit
  • /wizard-ci basic-integration/swift
  • /wizard-ci basic-integration/tanstack-router
  • /wizard-ci basic-integration/tanstack-start
  • /wizard-ci basic-integration/vue
  • /wizard-ci error-tracking-upload-source-maps/android
  • /wizard-ci error-tracking-upload-source-maps/flutter
  • /wizard-ci error-tracking-upload-source-maps/ios
  • /wizard-ci error-tracking-upload-source-maps/next
  • /wizard-ci error-tracking-upload-source-maps/next-no-posthog
  • /wizard-ci error-tracking-upload-source-maps/node-raw
  • /wizard-ci error-tracking-upload-source-maps/node-rollup
  • /wizard-ci error-tracking-upload-source-maps/node-rollup-typescript-plugin
  • /wizard-ci error-tracking-upload-source-maps/node-webpack
  • /wizard-ci error-tracking-upload-source-maps/nuxt-3-6
  • /wizard-ci error-tracking-upload-source-maps/nuxt-4-3
  • /wizard-ci error-tracking-upload-source-maps/react-native
  • /wizard-ci error-tracking-upload-source-maps/react-vite
  • /wizard-ci error-tracking-upload-source-maps/rust
  • /wizard-ci misc/quack-quack
  • /wizard-ci revenue/stripe

Results will be posted here when complete.

joethreepwood and others added 2 commits June 5, 2026 14:01
Addresses review feedback: the agent instructions (scan steps, abort
signals, report format) were hardcoded in the program's customPrompt —
"packaged English" that belongs in a context-mill skill, not the wizard.

- Collapse index.ts to a createSkillProgram() factory call; customPrompt
  is now a one-liner. The skill (loaded via skillId) drives the run.
- Delete wizard-side detection (detectPiiBouncerPrerequisites + the
  duplicated package walker a reviewer flagged). The skill detects
  prerequisites and emits [ABORT] signals; the wizard just routes them.
- Rename detect.ts -> abort-cases.ts, keeping only PII_BOUNCER_ABORT_CASES
  (terminal UX copy). The match regexes are the contract with the skill.

Wizard = engine + UX; context-mill skill = instructions. No product
knowledge left in the program.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Companion to the new warlock rules (posthog_pii_in_person_properties,
posthog_pii_value_in_tracking_call). The wizard ships an inline copy of
warlock's PII rules until it consumes warlock directly, so the patterns
are mirrored here to take effect today:

- pii_in_person_properties: sensitive PII in register/setPersonProperties
  (mirrors identify's "email/name OK, regulated PII not" split)
- pii_value_in_tracking_call: PII-shaped literal values (email/SSN/card)
  under any key — catches PII hidden behind innocuous property names

+10 scanner tests; warlock remains the source of truth.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@joethreepwood joethreepwood changed the title feat: add pii-bouncer wizard program scaffold feat: PII Bouncer program (engine) + robust PII scanner rules Jun 5, 2026
@joethreepwood joethreepwood self-assigned this Jun 5, 2026
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