Skip to content

feat(privacy): enforce G13 cohort rule and cover G7, G14, G15 with tests - #23

Merged
dalpan merged 1 commit into
mainfrom
feature/privacy-guardrails
Oct 31, 2026
Merged

dalpan merged 1 commit into
mainfrom
feature/privacy-guardrails

Conversation

@dalpan

@dalpan dalpan commented Oct 31, 2026

Copy link
Copy Markdown
Owner

Brings #21 to main. #21 was merged into feature/persona-reliability after that branch had already gone to main (via #20 → #22), so its commit (52a0079) never reached main.

No new changes; see #21 for the description. pytest: 260 passed.

🤖 Generated with Claude Code

G13 and G15 were documented as "planned enforcement". Checking the analytics
endpoints showed G13 was not held: GET /analytics/team returned every
member's average score to any member of the organization, trainees included.

- services/privacy.py: MIN_COHORT = 5.
- GET /analytics/team: per-member stats for staff only; other members get
  aggregates, and nothing but the member count when the org has fewer than 5.
- GET /risk-profile/org/{id}: a non-staff owner gets the same suppression
  when fewer than 5 members have a risk profile.
- G15: regression test that a live click, a GoPhish-reported recipient and a
  forwarded report leave XP, level, badges, lab results and the leaderboard
  unchanged.
- G7: tests that an unknown objective fails pre-flight and that a client
  cannot send a persona prompt.
- G14: index creation moved into server.ensure_indexes() so the 180-day TTL
  on live_events and live_messages can be tested.
- docs: guardrails table points at the enforcing code; api.md documents the
  cohort rule.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@dalpan
dalpan merged commit 0170482 into main Oct 31, 2026
4 checks passed
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