Security & Privacy

Privacy is the foundation of MindCradle. Because you trust our application with your daily thoughts and reflections, we design our database and AI architecture around data segregation and cryptographic validation.

Supabase JWT Verification

All requests are validated in the backend using the project's Supabase JWT Secret.
- The token contains your user UUID (`sub` claim) along with expiry and audience constraints.
- Every database query in our FastAPI router enforces strict isolation by filtering queries using this verified user UUID, preventing cross-tenant data leaks.
- We never log raw token payloads or store credentials in cleartext.

Row Level Security (RLS)

Our PostgreSQL database on Supabase enforces Row Level Security at the database level. Even if a backend query is written incorrectly, the database itself rejects operations that attempt to read or write rows belonging to other users.

CREATE POLICY "Users can manage their own journal entries" 
ON public.journal_entries
FOR ALL USING (auth.uid() = user_id) 
WITH CHECK (auth.uid() = user_id);

AI Data Safeguards

When we send context to our language models via the OpenRouter API:
- We do not transmit your email, real name, or billing details.
- Context is structured as anonymized nodes (e.g. "User experiences work fatigue").
- Data transmitted is subject to zero data retention policies of the endpoint providers. Your reflections are never stored on external AI servers and are never used to train public language models.

User Control & GDPR Compliance

We support full GDPR compliance and data sovereignty:
- Data Export: Export your complete timeline, mood logs, and knowledge graph in a structured JSON format at any time.
- Account Deletion: Delete your account in one click. Doing so triggers a database cascade that completely wipes your user history, credentials, vector embeddings, and knowledge graph nodes from our database.