Compliance & Regulatory
Product-Specific Requirements
MathMind → COPPA (Children Under 13)
| Requirement |
Implementation |
| Verifiable parental consent |
Parent email verification before child can create account |
| No third-party analytics |
No Firebase, Mixpanel, Google Analytics — Apple will reject |
| Parental gate on purchases |
Require parent password/PIN for any IAP |
| Data retention policy |
Written policy, retain minimum necessary, auto-delete after inactivity |
| No behavioral advertising |
No ad SDKs, no tracking pixels |
| Penalty |
$53,088 per violation |
Updated June 2025, enforcement deadline April 2026. MathMind MUST comply before App Store submission.
OUTBOUND → CAN-SPAM (Commercial Email)
| Requirement |
Implementation |
| Physical address in every email |
Footer: "Perlantir AI Studio, [address]" |
| Unsubscribe mechanism |
One-click unsubscribe, honored within 10 business days |
| Accurate sender info |
From name matches business, no spoofing |
| Accurate subject line |
No deceptive subjects |
| B2B cold email is legal |
But must comply with all requirements |
| Penalty |
$51,744 per email |
Arena → GDPR (EU Users)
| Requirement |
Implementation |
| Lawful basis |
Consent for marketing, legitimate interest for core service |
| Right to access |
Data export endpoint returning user's data as JSON |
| Right to erasure |
Account deletion cascading to ALL related tables |
| Right to portability |
Export in machine-readable format (JSON) |
| 72-hour breach notification |
Incident response plan + contact procedure |
| DPAs with processors |
Supabase, Vercel, Anthropic, Stripe all have DPAs |
| Cookie consent |
Banner for non-essential cookies (analytics, marketing) |
Implementation Patterns
Account Deletion (CASCADE)
-- Must delete ALL user data, not just the users row
-- Test this with a real account — missed foreign keys = GDPR violation
-- Option 1: ON DELETE CASCADE on all foreign keys
ALTER TABLE entries ADD CONSTRAINT fk_entries_user
FOREIGN KEY (user_id) REFERENCES auth.users(id) ON DELETE CASCADE;
-- Option 2: Deletion function (more control, audit trail)
CREATE OR REPLACE FUNCTION delete_user_data(p_user_id uuid)
RETURNS void LANGUAGE plpgsql SECURITY DEFINER AS $$
BEGIN
-- Log deletion for audit (keep 30 days)
INSERT INTO deletion_log (user_id, deleted_at) VALUES (p_user_id, now());
-- Delete in dependency order
DELETE FROM votes WHERE user_id = p_user_id;
DELETE FROM entries WHERE user_id = p_user_id;
DELETE FROM agents WHERE user_id = p_user_id;
DELETE FROM subscriptions WHERE user_id = p_user_id;
DELETE FROM team_members WHERE user_id = p_user_id;
-- Delete storage files
-- (handled separately via Edge Function)
-- Finally delete auth user
-- (triggers Supabase cascade)
END; $$;
Data Export
// API route: GET /api/account/export
export async function GET() {
const supabase = await createClient()
const { data: { user } } = await supabase.auth.getUser()
if (!user) return unauthorized()
const [profile, agents, entries, votes] = await Promise.all([
supabase.from('profiles').select('*').eq('user_id', user.id),
supabase.from('agents').select('*').eq('user_id', user.id),
supabase.from('entries').select('*').eq('user_id', user.id),
supabase.from('votes').select('*').eq('user_id', user.id),
])
return NextResponse.json({
exported_at: new Date().toISOString(),
profile: profile.data,
agents: agents.data,
entries: entries.data,
votes: votes.data,
})
}
Consent Tracking (Append-Only)
CREATE TABLE consent_records (
id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
user_id uuid NOT NULL REFERENCES auth.users(id),
consent_type text NOT NULL, -- 'marketing', 'analytics', 'cold_email'
granted boolean NOT NULL,
ip_address text,
user_agent text,
created_at timestamptz DEFAULT now()
-- NO UPDATE or DELETE — append only
);
Review Checklist
Sources
- FTC COPPA Rule (updated June 2025)
- CAN-SPAM Act requirements
- GDPR official text (Articles 15-20: data subject rights)
- Supabase GDPR compliance documentation
Changelog
- 2026-03-21: Initial skill — compliance and regulatory
1---2name: compliance-and-regulatory3description: COPPA (MathMind), CAN-SPAM (OUTBOUND), GDPR (Arena), and implementation patterns for account deletion, data export, consent tracking.4---56# Compliance & Regulatory78## Product-Specific Requirements910### MathMind → COPPA (Children Under 13)11| Requirement | Implementation |12|-------------|---------------|13| Verifiable parental consent | Parent email verification before child can create account |14| No third-party analytics | No Firebase, Mixpanel, Google Analytics — Apple will reject |15| Parental gate on purchases | Require parent password/PIN for any IAP |16| Data retention policy | Written policy, retain minimum necessary, auto-delete after inactivity |17| No behavioral advertising | No ad SDKs, no tracking pixels |18| **Penalty** | **$53,088 per violation** |1920**Updated June 2025, enforcement deadline April 2026.** MathMind MUST comply before App Store submission.2122### OUTBOUND → CAN-SPAM (Commercial Email)23| Requirement | Implementation |24|-------------|---------------|25| Physical address in every email | Footer: "Perlantir AI Studio, [address]" |26| Unsubscribe mechanism | One-click unsubscribe, honored within 10 business days |27| Accurate sender info | From name matches business, no spoofing |28| Accurate subject line | No deceptive subjects |29| **B2B cold email is legal** | But must comply with all requirements |30| **Penalty** | **$51,744 per email** |3132### Arena → GDPR (EU Users)33| Requirement | Implementation |34|-------------|---------------|35| Lawful basis | Consent for marketing, legitimate interest for core service |36| Right to access | Data export endpoint returning user's data as JSON |37| Right to erasure | Account deletion cascading to ALL related tables |38| Right to portability | Export in machine-readable format (JSON) |39| 72-hour breach notification | Incident response plan + contact procedure |40| DPAs with processors | Supabase, Vercel, Anthropic, Stripe all have DPAs |41| Cookie consent | Banner for non-essential cookies (analytics, marketing) |4243---4445## Implementation Patterns4647### Account Deletion (CASCADE)48```sql49-- Must delete ALL user data, not just the users row50-- Test this with a real account — missed foreign keys = GDPR violation5152-- Option 1: ON DELETE CASCADE on all foreign keys53ALTER TABLE entries ADD CONSTRAINT fk_entries_user54 FOREIGN KEY (user_id) REFERENCES auth.users(id) ON DELETE CASCADE;5556-- Option 2: Deletion function (more control, audit trail)57CREATE OR REPLACE FUNCTION delete_user_data(p_user_id uuid)58RETURNS void LANGUAGE plpgsql SECURITY DEFINER AS $$59BEGIN60 -- Log deletion for audit (keep 30 days)61 INSERT INTO deletion_log (user_id, deleted_at) VALUES (p_user_id, now());62 63 -- Delete in dependency order64 DELETE FROM votes WHERE user_id = p_user_id;65 DELETE FROM entries WHERE user_id = p_user_id;66 DELETE FROM agents WHERE user_id = p_user_id;67 DELETE FROM subscriptions WHERE user_id = p_user_id;68 DELETE FROM team_members WHERE user_id = p_user_id;69 70 -- Delete storage files71 -- (handled separately via Edge Function)72 73 -- Finally delete auth user74 -- (triggers Supabase cascade)75END; $$;76```7778### Data Export79```ts80// API route: GET /api/account/export81export async function GET() {82 const supabase = await createClient()83 const { data: { user } } = await supabase.auth.getUser()84 if (!user) return unauthorized()85 86 const [profile, agents, entries, votes] = await Promise.all([87 supabase.from('profiles').select('*').eq('user_id', user.id),88 supabase.from('agents').select('*').eq('user_id', user.id),89 supabase.from('entries').select('*').eq('user_id', user.id),90 supabase.from('votes').select('*').eq('user_id', user.id),91 ])92 93 return NextResponse.json({94 exported_at: new Date().toISOString(),95 profile: profile.data,96 agents: agents.data,97 entries: entries.data,98 votes: votes.data,99 })100}101```102103### Consent Tracking (Append-Only)104```sql105CREATE TABLE consent_records (106 id uuid PRIMARY KEY DEFAULT gen_random_uuid(),107 user_id uuid NOT NULL REFERENCES auth.users(id),108 consent_type text NOT NULL, -- 'marketing', 'analytics', 'cold_email'109 granted boolean NOT NULL,110 ip_address text,111 user_agent text,112 created_at timestamptz DEFAULT now()113 -- NO UPDATE or DELETE — append only114);115```116117## Review Checklist118119- [ ] Account deletion tested (deletes ALL user data across ALL tables)120- [ ] Data export endpoint exists and returns complete data121- [ ] Consent tracked in append-only table122- [ ] Unsubscribe link in every marketing/notification email123- [ ] No third-party analytics in children's app (COPPA)124- [ ] Privacy policy accessible from app + website125- [ ] DPAs signed with all data processors126127## Sources128- FTC COPPA Rule (updated June 2025)129- CAN-SPAM Act requirements130- GDPR official text (Articles 15-20: data subject rights)131- Supabase GDPR compliance documentation132133## Changelog134- 2026-03-21: Initial skill — compliance and regulatory