Enables Row Level Security (RLS) on both tables and creates permissive policies to allow full access (perfect for MVP/testing).
- Go to https://app.supabase.com
- Select your DailyOS project
- Click SQL Editor (left sidebar)
- Click New Query
- Open file:
/SUPABASE_RLS_SETUP.sql - Copy ALL the code (everything)
- Paste into Supabase SQL Editor
- Click Run button
- Wait for green checkmark ✅
ALTER TABLE conversations ENABLE ROW LEVEL SECURITY;
ALTER TABLE messages ENABLE ROW LEVEL SECURITY;CREATE POLICY "Allow all conversations"
ON conversations
FOR ALL
USING (true)
WITH CHECK (true);
CREATE POLICY "Allow all messages"
ON messages
FOR ALL
USING (true)
WITH CHECK (true);| Setting | Before | After |
|---|---|---|
| conversations table | No RLS | RLS enabled + policy allows all |
| messages table | No RLS | RLS enabled + policy allows all |
| Inserts | ✓ Works | ✓ Works (policy: true) |
| Selects | ✓ Works | ✓ Works (policy: true) |
| Updates | ✓ Works | ✓ Works (policy: true) |
| Deletes | ✓ Works | ✓ Works (policy: true) |
- Go to
/aipage in DailyOS - Send a message
- Check browser console - should see:
✓ User message saved to DB ✓ AI message saved to DB - Refresh page - messages should load
- Check Supabase > SQL Editor and run:
Should show your messages ✓
SELECT COUNT(*) as msg_count FROM messages; SELECT * FROM messages LIMIT 5;
- This is permissive for MVP/testing - all users have full access
- For production, you'd restrict policies to authenticated users or specific user IDs
- RLS doesn't prevent access if policy is
true- it just ensures checks are in place - No schema changes - only enabling RLS and creating policies
After running, you should see:
VERIFY RLS IS ENABLED AND POLICIES EXIST
schemaname │ tablename │ rowsecurity
────────────┼──────────────┼─────────────
public │ conversations│ t
public │ messages │ t
schemaname │ tablename │ policyname │ cmd
────────────┼──────────────┼──────────────────────┼─────
public │ conversations│ Allow all │ ALL
public │ messages │ Allow all messages │ ALL
If you see rowsecurity = t (true) for both, you're good! ✓
"Policy already exists"
- ✓ Script handles this with DROP IF EXISTS
"Permission denied"
- You need Supabase account with proper permissions
- Make sure you're logged in as project owner
"Still can't save messages"
- Check console for exact error message
- Verify tables exist:
SELECT * FROM conversations LIMIT 1; - Verify policies were created: Run verification query