PII Firewall Boundary Map
Which services actually screen user-supplied text for PII before acting on it — and which ones don't?
§1 What this answers
COPPA compliance requires that PII from under-13 users not reach downstream vendors (LLMs, image generators, sound generators, etc.) without parental consent. The PII firewall is the code-level gate. This diagram shows, for every user-facing service, whether that gate is wired in and where.
moderation_core/pii_firewall/ (Bedrock-backed, 2184-line executor.py). Each service decides independently whether to call it and when. That's why the coverage is uneven.
§2 Coverage by service
FuzzyCode ON
SoundBuddy ON
ImageBuddy ON
SpriteBuddy ON
UploaderBuddy NONE
Pages NO FIREWALL
SimpleGPT ADMIN-ONLY
ModerationBuddy N/A
moderation-pipeline diagramCDNBuddy · S3BucketBuddy N/A
§3 Where the gate runs
The gate sits between "user submits text" and "any vendor call or persistence." Fail-closed semantics: on ambiguous result or error, the firewall raises — the handler must translate to a 400/503 to the user, never proceed silently.
and mode=under13_only?} AGE -->|yes| SKIP[skip firewall]:::bypass AGE -->|no / mode=all| SCAN[PII firewall
Bedrock classifier]:::gate SCAN -->|result=clean| OK[proceed to vendor]:::ok SCAN -->|result=PII detected| X1[400 · pii_detected]:::gate SCAN -->|result=ambiguous| X2[403 · pii_approval_required]:::gate SCAN -->|error / unavailable| X3[503 · pii_firewall_error]:::gate OK --> Vendor[OpenAI / FAL / ElevenLabs / Groq / Bedrock]:::ext SKIP --> Vendor style AGE fill:#fff4d6,stroke:#a47a3a,color:#111
§4 Feature flags
| Env var | Default | Effect | Evidence |
|---|---|---|---|
PII_FIREWALL_MODE | "all" | all scans every prompt; under13_only skips for users 13+; off disables the gate entirely | executor.py:56, 531-539 |
PII_FIREWALL_MODEL_ID | openai.gpt-oss-20b-1:0 | Bedrock model used for classification | executor.py:30 |
PII_FIREWALL_PROVIDER_MODE | groq (UAT) | Provider selector | docker-compose.yml:45 |
PII_FIREWALL_LINE_ID_OUTPUT_MODE | idonly | Prompt variant | docker-compose.yml:46 |
PII_FIREWALL_SPLIT_TARGET_LINES | 20 | Chunk large payloads | docker-compose.yml:47 |
PAGES_CLEAN_ATTESTATION_SECRET | required | HMAC secret for FuzzyCode → Pages publish attestation | html_cleanliness.py:267-289 |
PII_FIREWALL_MODE=off disables the firewall everywhere with no service restart interlock. Any incident playbook touching this env var needs sign-off.
§5 The HTML path — a specialized PII flow
Beyond prompts, FuzzyCode also checks the HTML being published for PII leakage. The state of that check is persisted on the page row so Pages can verify it without re-scanning.
preflight/]:::step V --> S[PII firewall scan] S -->|clean| C1[persist html_clean_state=
verified_clean + hash]:::ok S -->|dirty| C2[persist html_clean_state=
dirty_unverified]:::fail C1 --> P[/api/pages/attest-publish/]:::step P --> H[HMAC-sign attestation
html_hash · clean_state · clean_basis · title_hash] H --> PS[Pages /submit]:::step PS --> VF[verify HMAC +
clean_state==verified_clean] VF -->|ok| STORE[INSERT / UPDATE page row]:::ok VF -->|mismatch| R400[400 attestation mismatch]:::fail
Three states in code (verified_clean · dirty_unverified · blocked), not the five-state machine described in PII_FIREWALL_SHARED_ARCHITECTURE.md's "Proposed" section. The two are often cited interchangeably — they shouldn't be.
§6 Verification pointers
- Classifier core
FuzzyCode/moderation_core/pii_firewall/executor.py - Age gate
FuzzyCode/moderation_core/pii_firewall/executor.py:531-539 - FuzzyCode wrapper (fail-closed)
FuzzyCode/quart_server/services/pii_firewall.py:40-106 - SoundBuddy wrapper
SoundBuddyFastAPI2/pii_firewall.py:1-136 - ImageBuddy wrapper
ImageBuddyRobustFastAPI/pii_firewall.py:1-288 - SpriteBuddy wrapper
SpriteBuddy/pii_firewall.py - UploaderBuddy absence (gap)
grep -l pii_firewall UploaderBuddy/ → 0 - SimpleGPT admin-only
simplegpt-fastapi/main2.py:158-280 - HTML cleanliness constants
FuzzyCode/quart_server/services/html_cleanliness.py:12-14 - HTML scan payload builder
html_cleanliness.py:304-310, 343 - Publish attestation HMAC
html_cleanliness.py:267-289 - Pages attestation verify
FuzzycodePagesFlaskServer/main.py:2202-2234