Skip to content

Privacy & Safety Controls

SisterShield handles sensitive subject matter (technology-facilitated violence against women and girls) and serves a potentially vulnerable audience. Privacy and safety are core design priorities, not afterthoughts.

Data Lifecycle

What Data Is Collected

Data TypePurposeStorage Location
User profile (name, email, hashed password, role, locale)Authentication and personalizationPostgreSQL User table
Course progress (visited passages, time spent, quiz scores)Learning tracking and completionPostgreSQL Progress table
Submissions (uploaded Twine files, metadata)Student work submission and reviewPostgreSQL Submission table + local filesystem
Course content (Twee source, built HTML, images)Educational content deliveryPostgreSQL Course table + local filesystem
Pilot requests (email, organization, name)Program interest trackingPostgreSQL PilotRequest table
Teacher access logs (action, resource, timestamp)Audit trailPostgreSQL TeacherAccessLog table
Analytics events (quick_exit_used, resources_opened)Safety feature usage trackingClient-side only (via trackEvent())

Where Data Is Stored

  • Database: PostgreSQL, accessed exclusively through Prisma ORM. No raw SQL queries.
  • Files: Local filesystem under a storage directory. The storage abstraction in src/lib/storage/ is designed for future migration to S3 or MinIO.
  • Client-side: sessionStorage is used for temporary UI state. It is cleared on Quick Exit.

Data Retention

  • User data persists until the account is deleted (TODO: implement account deletion API).
  • Progress data is retained indefinitely for learning analytics.
  • Session tokens (JWT) expire after 30 days.
  • No data is shared with third parties beyond the LLM API calls described in the AI section.

Authentication

JWT Strategy

SisterShield uses NextAuth 4.24.11 with a JWT session strategy (not database sessions for request authentication).

  • Provider: Credentials (email + password).
  • Password hashing: bcrypt with cost factor 10 (bcryptjs).
  • JWT payload: id, role (STUDENT/TEACHER/ADMIN), preferredLocale.
  • Token lifespan: 30 days.
  • Cookie: next-auth.session-token, HttpOnly, SameSite=Lax. Automatically Secure on HTTPS.

Role-Based Access

API routes check session.user.role before executing sensitive operations:

  • Public: Registration, login, landing page, hero evidence (read), pilot requests.
  • Authenticated: Course browsing, course play, progress tracking, submission creation.
  • Teacher+: Course creation, editing, publishing, AI generation, translation, submission review.
  • Admin: All teacher capabilities, evidence management, user management (TODO).

Privacy Controls

Quick Exit

The QuickExit component (src/components/safety/quick-exit.tsx) provides an emergency escape mechanism.

Behavior:

  1. Triggered by clicking the exit button or pressing Escape (when no dialog is open).
  2. Calls trackEvent('quick_exit_used') for analytics.
  3. Clears sessionStorage to remove any sensitive UI state.
  4. Calls window.location.replace('https://weather.com'), which navigates away and replaces the current history entry so the back button does not return to SisterShield.

Limitations:

  • JWT cookie is not cleared (this is intentional — clearing it would require a server round-trip, which delays the exit). The cookie is HttpOnly, so it is not accessible to JavaScript.
  • Browser tabs or windows showing SisterShield content are not closed (the Quick Exit operates within its own tab).

Security Headers

Configured in next.config.js, applied to all routes:

HeaderValuePurpose
X-Frame-OptionsSAMEORIGINPrevents clickjacking by blocking cross-origin iframe embedding
X-Content-Type-OptionsnosniffPrevents MIME-type sniffing
Referrer-Policystrict-origin-when-cross-originLimits referrer information leaked to external sites

HTTPS

In production, the application should be served over HTTPS. NextAuth automatically sets the Secure cookie flag when the NEXTAUTH_URL uses https://.

AI Safety

Image Generation Constraints

The image generation system (src/lib/llm/generate-image-prompts.ts) enforces strict safety rules in the LLM prompt:

  1. No minors: All characters must be depicted as young adults (18-22 years old), even if the story describes younger characters. The prompt explicitly states: “NEVER depict minors, children, or teenagers.”
  2. No violence: Images must not contain violence, weapons, nudity, drugs, horror, or inappropriate content.
  3. No threatening content: When illustrating cyberbullying or online threats, the prompt requires showing the character’s emotional response or safe action, never the threatening content itself.
  4. Modest clothing: Characters wear casual, modest clothing appropriate for a college campus.
  5. No text in images: Prompts specify that images must not contain text, words, letters, or UI elements.

Content Generation Safety

The story generation prompt (src/lib/llm/generate-story.ts) includes:

  • Structured output format (Twee 3) that constrains the LLM’s output.
  • Mandatory safety passages: every story ends with real crisis resources (Korean hotlines, international organizations).
  • No victim-blaming: dangerous choices lead to educational Risk Analysis passages, not punishment.
  • Recovery paths: every wrong choice includes a “Let me think about this again” retry link.

Data Sent to LLM Providers

  • Course content (Twee source) is sent to the configured LLM provider for generation, translation, and error fixing.
  • No user PII (names, emails, passwords) is sent to LLM providers.
  • Image prompts are sent to OpenAI for DALL-E 3 generation.

Data Minimization

  • Minimal PII: Only email, name, and hashed password are stored. No phone numbers, addresses, or demographic data.
  • No unnecessary tracking: Progress tracking captures passage visits and time for educational purposes only.
  • Audit logging: Teacher access logs record only the action type, resource ID, and timestamp — not the content viewed.

GDPR/Privacy Considerations

RequirementCurrent Status
Right to access personal dataTODO: Implement data export endpoint
Right to deletionTODO: Implement account deletion with cascade
Data processing consentTODO: Add consent flow during registration
Privacy policyTODO: Draft and publish privacy policy page
Cookie consent bannerTODO: Implement for non-essential cookies (currently only session cookie)
Data breach notificationTODO: Define incident response procedure

Digital Ethics Audit: TF-VAWG-Specific Risk Assessment

SisterShield operates in a high-stakes domain where standard privacy practices are insufficient. This section documents a TF-VAWG-specific risk assessment that goes beyond conventional data protection to address the unique threats faced by users who may be experiencing technology-facilitated violence.

Risk Matrix

#RiskSeverityLikelihoodMitigation FeatureStatus
1Data leak reveals victim is learning about abuseCriticalMediumMinimal PII, no demographic data, neutral app titleImplemented
2Re-traumatization through contentHighMediumTrauma-informed design, calm color system, supportive language, content warningsImplemented
3Abuser discovers victim is using the platformCriticalHighQuick Exit (Escape key), browser history replacement, neutral redirect destinationImplemented
4Victim-blaming in AI-generated contentHighLowDangerous Choice Architecture with mandatory recovery paths, no punishment framingImplemented
5Harmful or inappropriate AI-generated contentHighLowStructured output format, image safety constraints, teacher review before publicationImplemented
6Progress data exposes sensitive topic engagementMediumMediumProgress tracks passage visits only (no choice content), no exportable reports for studentsImplemented
7Browser history reveals platform usageHighHighQuick Exit replaces history entry; neutral destination (weather.com)Implemented
8Push notifications reveal sensitive contentHighLowNo push notifications implemented; no email notifications about course contentBy design
9Shared device exposes sessionMediumMediumsessionStorage cleared on Quick Exit; JWT cookie is HttpOnly (not accessible to scripts)Implemented
10LLM provider retains generated contentMediumMediumNo user PII sent to LLM; only course content (Twee source) and translation requestsImplemented

Quick Exit as Digital Safety Feature

The Quick Exit feature is not merely a convenience — it is a digital safety feature designed for users in potentially dangerous situations. The design reflects six specific considerations:

  1. Sub-second exit: The window.location.replace() call executes immediately. No confirmation dialog, no animation, no delay. When a user needs to leave, milliseconds matter.
  2. History replacement: Using replace() instead of assign() ensures the back button does not return to SisterShield. An abuser checking the victim’s browser cannot use the back button to discover what they were viewing.
  3. Neutral destination: The redirect target (weather.com) is a plausible, innocuous website. It does not suggest the user was doing anything sensitive.
  4. State clearing: sessionStorage is cleared before navigation to remove any cached UI state (open dialogs, form inputs, navigation history within the app).
  5. Keyboard trigger: The Escape key binding ensures users can exit without moving the mouse to a specific button — useful if someone enters the room unexpectedly.
  6. Dialog guard: The Quick Exit does not trigger when a dialog, menu, or listbox overlay is open (checked via [data-state="open"]). This prevents accidental exits during normal interaction while ensuring intentional exits always work.

Trauma-Informed Content Safety

AI-generated educational content passes through five safety layers before reaching students:

  1. Prompt-level constraints: The story generation prompt prohibits graphic violence, victim-blaming language, and content that depicts the threatening behavior itself (only emotional responses and safe actions).
  2. Structured output format: Twee 3 format constrains the LLM to produce navigable, link-based content rather than free-form text that could contain harmful passages.
  3. Programmatic validation: The Twee parser checks for structural integrity (no dead links, no orphan passages, no duplicate passage names) before content is stored.
  4. Teacher review gate: All AI-generated stories are saved as drafts. A teacher must explicitly review and publish before any student can access the content.
  5. Mandatory safety passages: Every generated story must include crisis resources (Korean Women’s Emergency Hotline 1366, international organizations) and recovery paths from dangerous choices.

Data Minimization as Protection

For TF-VAWG platform users, data minimization is not just a privacy best practice — it is a safety measure:

  • No demographic data collected: The platform stores only email, name, hashed password, role, and locale preference. No age, gender, location, or relationship status is requested. An abuser who gains access to the database learns nothing about the victim beyond their email.
  • No social features: There are no friend lists, group chats, forums, or shared progress features. A user’s presence on the platform is invisible to other users. This prevents abusers from discovering victims through the platform itself.
  • No choice content tracking: Progress data records which passages were visited and time spent, but does not record which choices the user made within a story. This means even with database access, no one can determine whether a user identified with a victim scenario or which coping strategies they practiced.

Safety Component Reference

QuickExit (src/components/safety/quick-exit.tsx)

  • Trigger: Button click or Escape key.
  • Guard: Does not trigger if a dialog, menu, or listbox overlay is open (checks [data-state="open"]).
  • Styling: Uses safety-exit and safety-exit-border design tokens (red).
  • Accessibility: aria-label, title tooltip, minimum touch target (44x44px).

GetHelp (src/components/safety/get-help.tsx)

  • Trigger: Button click opens a Dialog.
  • Content: Region-selectable resources (Korea / International).
  • Korea resources: Women’s Emergency Hotline (1366), Digital Sexual Violence Counseling (02-735-8994), Police (112).
  • International resources: Cyber Civil Rights Initiative, UN Women, Internet Watch Foundation.
  • Accessibility: Emergency warning banner, phone links (tel:), external links with noopener noreferrer.
  • Analytics: Tracks resources_opened event when dialog opens.