[
 {
  "schema": "public",
  "table": "agent_todos",
  "policy": "Agents can create own todos",
  "cmd": "INSERT",
  "roles": "{public}",
  "using": null,
  "check": "(agent_id = auth.uid())"
 },
 {
  "schema": "public",
  "table": "agent_todos",
  "policy": "Agents can delete own todos",
  "cmd": "DELETE",
  "roles": "{public}",
  "using": "(agent_id = auth.uid())",
  "check": null
 },
 {
  "schema": "public",
  "table": "agent_todos",
  "policy": "Agents can read own todos",
  "cmd": "SELECT",
  "roles": "{public}",
  "using": "(agent_id = auth.uid())",
  "check": null
 },
 {
  "schema": "public",
  "table": "agent_todos",
  "policy": "Agents can update own todos",
  "cmd": "UPDATE",
  "roles": "{public}",
  "using": "(agent_id = auth.uid())",
  "check": null
 },
 {
  "schema": "public",
  "table": "ai_config",
  "policy": "System admins can manage ai_config",
  "cmd": "ALL",
  "roles": "{authenticated}",
  "using": "has_role(auth.uid(), 'system_admin'::app_role)",
  "check": "has_role(auth.uid(), 'system_admin'::app_role)"
 },
 {
  "schema": "public",
  "table": "community_comments",
  "policy": "Anyone authenticated can read comments",
  "cmd": "SELECT",
  "roles": "{authenticated}",
  "using": "true",
  "check": null
 },
 {
  "schema": "public",
  "table": "community_comments",
  "policy": "System admins can delete any comment",
  "cmd": "DELETE",
  "roles": "{authenticated}",
  "using": "has_role(auth.uid(), 'system_admin'::app_role)",
  "check": null
 },
 {
  "schema": "public",
  "table": "community_comments",
  "policy": "Users can create comments",
  "cmd": "INSERT",
  "roles": "{authenticated}",
  "using": null,
  "check": "(auth.uid() = user_id)"
 },
 {
  "schema": "public",
  "table": "community_comments",
  "policy": "Users can delete own comments",
  "cmd": "DELETE",
  "roles": "{authenticated}",
  "using": "(auth.uid() = user_id)",
  "check": null
 },
 {
  "schema": "public",
  "table": "community_comments",
  "policy": "Users can update own comments",
  "cmd": "UPDATE",
  "roles": "{authenticated}",
  "using": "(auth.uid() = user_id)",
  "check": null
 },
 {
  "schema": "public",
  "table": "community_posts",
  "policy": "Anyone authenticated can read posts",
  "cmd": "SELECT",
  "roles": "{authenticated}",
  "using": "true",
  "check": null
 },
 {
  "schema": "public",
  "table": "community_posts",
  "policy": "System admins can delete any post",
  "cmd": "DELETE",
  "roles": "{authenticated}",
  "using": "has_role(auth.uid(), 'system_admin'::app_role)",
  "check": null
 },
 {
  "schema": "public",
  "table": "community_posts",
  "policy": "System admins can update any post",
  "cmd": "UPDATE",
  "roles": "{authenticated}",
  "using": "has_role(auth.uid(), 'system_admin'::app_role)",
  "check": null
 },
 {
  "schema": "public",
  "table": "community_posts",
  "policy": "Users can create posts",
  "cmd": "INSERT",
  "roles": "{authenticated}",
  "using": null,
  "check": "(auth.uid() = user_id)"
 },
 {
  "schema": "public",
  "table": "community_posts",
  "policy": "Users can delete own posts",
  "cmd": "DELETE",
  "roles": "{authenticated}",
  "using": "(auth.uid() = user_id)",
  "check": null
 },
 {
  "schema": "public",
  "table": "community_posts",
  "policy": "Users can update own posts",
  "cmd": "UPDATE",
  "roles": "{authenticated}",
  "using": "(auth.uid() = user_id)",
  "check": null
 },
 {
  "schema": "public",
  "table": "compliance_consents",
  "policy": "Users can insert own consents",
  "cmd": "INSERT",
  "roles": "{public}",
  "using": null,
  "check": "(auth.uid() = user_id)"
 },
 {
  "schema": "public",
  "table": "compliance_consents",
  "policy": "Users can view own consents",
  "cmd": "SELECT",
  "roles": "{public}",
  "using": "(auth.uid() = user_id)",
  "check": null
 },
 {
  "schema": "public",
  "table": "compliance_versions",
  "policy": "Authenticated users can view versions",
  "cmd": "SELECT",
  "roles": "{authenticated}",
  "using": "true",
  "check": null
 },
 {
  "schema": "public",
  "table": "content_metrics",
  "policy": "Users can create own metrics",
  "cmd": "INSERT",
  "roles": "{authenticated}",
  "using": null,
  "check": "(auth.uid() = user_id)"
 },
 {
  "schema": "public",
  "table": "content_metrics",
  "policy": "Users can delete own metrics",
  "cmd": "DELETE",
  "roles": "{authenticated}",
  "using": "(auth.uid() = user_id)",
  "check": null
 },
 {
  "schema": "public",
  "table": "content_metrics",
  "policy": "Users can update own metrics",
  "cmd": "UPDATE",
  "roles": "{authenticated}",
  "using": "(auth.uid() = user_id)",
  "check": null
 },
 {
  "schema": "public",
  "table": "content_metrics",
  "policy": "Users can view own metrics",
  "cmd": "SELECT",
  "roles": "{authenticated}",
  "using": "(auth.uid() = user_id)",
  "check": null
 },
 {
  "schema": "public",
  "table": "content_schedules",
  "policy": "Users can create own schedules",
  "cmd": "INSERT",
  "roles": "{authenticated}",
  "using": null,
  "check": "(auth.uid() = user_id)"
 },
 {
  "schema": "public",
  "table": "content_schedules",
  "policy": "Users can delete own schedules",
  "cmd": "DELETE",
  "roles": "{authenticated}",
  "using": "(auth.uid() = user_id)",
  "check": null
 },
 {
  "schema": "public",
  "table": "content_schedules",
  "policy": "Users can update own schedules",
  "cmd": "UPDATE",
  "roles": "{authenticated}",
  "using": "(auth.uid() = user_id)",
  "check": null
 },
 {
  "schema": "public",
  "table": "content_schedules",
  "policy": "Users can view own schedules",
  "cmd": "SELECT",
  "roles": "{authenticated}",
  "using": "(auth.uid() = user_id)",
  "check": null
 },
 {
  "schema": "public",
  "table": "contents",
  "policy": "Users can create their own contents",
  "cmd": "INSERT",
  "roles": "{public}",
  "using": null,
  "check": "(auth.uid() = user_id)"
 },
 {
  "schema": "public",
  "table": "contents",
  "policy": "Users can delete their own contents",
  "cmd": "DELETE",
  "roles": "{public}",
  "using": "(auth.uid() = user_id)",
  "check": null
 },
 {
  "schema": "public",
  "table": "contents",
  "policy": "Users can update their own contents",
  "cmd": "UPDATE",
  "roles": "{public}",
  "using": "(auth.uid() = user_id)",
  "check": null
 },
 {
  "schema": "public",
  "table": "contents",
  "policy": "Users can view their own contents",
  "cmd": "SELECT",
  "roles": "{public}",
  "using": "(auth.uid() = user_id)",
  "check": null
 },
 {
  "schema": "public",
  "table": "conversation_messages",
  "policy": "Agents can create own conversation messages",
  "cmd": "INSERT",
  "roles": "{public}",
  "using": null,
  "check": "(conversation_id IN ( SELECT conversations.id\n   FROM conversations\n  WHERE (conversations.agent_id = auth.uid())))"
 },
 {
  "schema": "public",
  "table": "conversation_messages",
  "policy": "Agents can read own conversation messages",
  "cmd": "SELECT",
  "roles": "{public}",
  "using": "(conversation_id IN ( SELECT conversations.id\n   FROM conversations\n  WHERE (conversations.agent_id = auth.uid())))",
  "check": null
 },
 {
  "schema": "public",
  "table": "conversation_summaries",
  "policy": "Agents can create summaries",
  "cmd": "INSERT",
  "roles": "{public}",
  "using": null,
  "check": "(agent_id = auth.uid())"
 },
 {
  "schema": "public",
  "table": "conversation_summaries",
  "policy": "Agents can read own summaries",
  "cmd": "SELECT",
  "roles": "{public}",
  "using": "(agent_id = auth.uid())",
  "check": null
 },
 {
  "schema": "public",
  "table": "conversations",
  "policy": "Agents can create own conversations",
  "cmd": "INSERT",
  "roles": "{public}",
  "using": null,
  "check": "(agent_id = auth.uid())"
 },
 {
  "schema": "public",
  "table": "conversations",
  "policy": "Agents can read own conversations",
  "cmd": "SELECT",
  "roles": "{public}",
  "using": "(agent_id = auth.uid())",
  "check": null
 },
 {
  "schema": "public",
  "table": "conversations",
  "policy": "Agents can update own conversations",
  "cmd": "UPDATE",
  "roles": "{public}",
  "using": "(agent_id = auth.uid())",
  "check": null
 },
 {
  "schema": "public",
  "table": "coverage_clause",
  "policy": "Authenticated can read coverage_clause",
  "cmd": "SELECT",
  "roles": "{authenticated}",
  "using": "true",
  "check": null
 },
 {
  "schema": "public",
  "table": "coverage_group_map",
  "policy": "Authenticated can read coverage_group_map",
  "cmd": "SELECT",
  "roles": "{authenticated}",
  "using": "true",
  "check": null
 },
 {
  "schema": "public",
  "table": "coverage_product",
  "policy": "Authenticated can read coverage_product",
  "cmd": "SELECT",
  "roles": "{authenticated}",
  "using": "true",
  "check": null
 },
 {
  "schema": "public",
  "table": "customer_activities",
  "policy": "Agents can create own customer activities",
  "cmd": "INSERT",
  "roles": "{authenticated}",
  "using": null,
  "check": "(agent_id = auth.uid())"
 },
 {
  "schema": "public",
  "table": "customer_activities",
  "policy": "Agents can delete own customer activities",
  "cmd": "DELETE",
  "roles": "{authenticated}",
  "using": "(agent_id = auth.uid())",
  "check": null
 },
 {
  "schema": "public",
  "table": "customer_activities",
  "policy": "Agents can read own customer activities",
  "cmd": "SELECT",
  "roles": "{authenticated}",
  "using": "(agent_id = auth.uid())",
  "check": null
 },
 {
  "schema": "public",
  "table": "customer_activities",
  "policy": "Agents can update own customer activities",
  "cmd": "UPDATE",
  "roles": "{authenticated}",
  "using": "(agent_id = auth.uid())",
  "check": null
 },
 {
  "schema": "public",
  "table": "customer_ai_summaries",
  "policy": "Agents can create own ai summaries",
  "cmd": "INSERT",
  "roles": "{public}",
  "using": null,
  "check": "(agent_id = auth.uid())"
 },
 {
  "schema": "public",
  "table": "customer_ai_summaries",
  "policy": "Agents can read own ai summaries",
  "cmd": "SELECT",
  "roles": "{public}",
  "using": "(agent_id = auth.uid())",
  "check": null
 },
 {
  "schema": "public",
  "table": "customer_call_logs",
  "policy": "Agents can create own call logs",
  "cmd": "INSERT",
  "roles": "{authenticated}",
  "using": null,
  "check": "(agent_id = auth.uid())"
 },
 {
  "schema": "public",
  "table": "customer_call_logs",
  "policy": "Agents can delete own call logs",
  "cmd": "DELETE",
  "roles": "{authenticated}",
  "using": "(agent_id = auth.uid())",
  "check": null
 },
 {
  "schema": "public",
  "table": "customer_call_logs",
  "policy": "Agents can read own call logs",
  "cmd": "SELECT",
  "roles": "{authenticated}",
  "using": "(agent_id = auth.uid())",
  "check": null
 },
 {
  "schema": "public",
  "table": "customer_chat_tokens",
  "policy": "Agents can create own chat tokens",
  "cmd": "INSERT",
  "roles": "{public}",
  "using": null,
  "check": "(agent_id = auth.uid())"
 },
 {
  "schema": "public",
  "table": "customer_chat_tokens",
  "policy": "Agents can delete own chat tokens",
  "cmd": "DELETE",
  "roles": "{public}",
  "using": "(agent_id = auth.uid())",
  "check": null
 },
 {
  "schema": "public",
  "table": "customer_chat_tokens",
  "policy": "Agents can read own chat tokens",
  "cmd": "SELECT",
  "roles": "{public}",
  "using": "(agent_id = auth.uid())",
  "check": null
 },
 {
  "schema": "public",
  "table": "customer_insurance",
  "policy": "Agents can create customer insurance",
  "cmd": "INSERT",
  "roles": "{public}",
  "using": null,
  "check": "(customer_id IN ( SELECT customers.id\n   FROM customers\n  WHERE (customers.agent_id = auth.uid())))"
 },
 {
  "schema": "public",
  "table": "customer_insurance",
  "policy": "Agents can delete customer insurance",
  "cmd": "DELETE",
  "roles": "{public}",
  "using": "(customer_id IN ( SELECT customers.id\n   FROM customers\n  WHERE (customers.agent_id = auth.uid())))",
  "check": null
 },
 {
  "schema": "public",
  "table": "customer_insurance",
  "policy": "Agents can read customer insurance",
  "cmd": "SELECT",
  "roles": "{public}",
  "using": "(customer_id IN ( SELECT customers.id\n   FROM customers\n  WHERE (customers.agent_id = auth.uid())))",
  "check": null
 },
 {
  "schema": "public",
  "table": "customer_insurance",
  "policy": "Agents can update customer insurance",
  "cmd": "UPDATE",
  "roles": "{public}",
  "using": "(customer_id IN ( SELECT customers.id\n   FROM customers\n  WHERE (customers.agent_id = auth.uid())))",
  "check": null
 },
 {
  "schema": "public",
  "table": "customer_notes",
  "policy": "Agents can create own customer notes",
  "cmd": "INSERT",
  "roles": "{public}",
  "using": null,
  "check": "(agent_id = auth.uid())"
 },
 {
  "schema": "public",
  "table": "customer_notes",
  "policy": "Agents can delete own customer notes",
  "cmd": "DELETE",
  "roles": "{public}",
  "using": "(agent_id = auth.uid())",
  "check": null
 },
 {
  "schema": "public",
  "table": "customer_notes",
  "policy": "Agents can read own customer notes",
  "cmd": "SELECT",
  "roles": "{public}",
  "using": "(agent_id = auth.uid())",
  "check": null
 },
 {
  "schema": "public",
  "table": "customers",
  "policy": "Agents can create own customers",
  "cmd": "INSERT",
  "roles": "{public}",
  "using": null,
  "check": "(auth.uid() = agent_id)"
 },
 {
  "schema": "public",
  "table": "customers",
  "policy": "Agents can delete own customers",
  "cmd": "DELETE",
  "roles": "{public}",
  "using": "(auth.uid() = agent_id)",
  "check": null
 },
 {
  "schema": "public",
  "table": "customers",
  "policy": "Agents can read own customers",
  "cmd": "SELECT",
  "roles": "{public}",
  "using": "(auth.uid() = agent_id)",
  "check": null
 },
 {
  "schema": "public",
  "table": "customers",
  "policy": "Agents can update own customers",
  "cmd": "UPDATE",
  "roles": "{public}",
  "using": "(auth.uid() = agent_id)",
  "check": null
 },
 {
  "schema": "public",
  "table": "fcpa_config",
  "policy": "Anyone authenticated can read fcpa_config",
  "cmd": "SELECT",
  "roles": "{authenticated}",
  "using": "true",
  "check": null
 },
 {
  "schema": "public",
  "table": "fcpa_config",
  "policy": "System admins can delete fcpa_config",
  "cmd": "DELETE",
  "roles": "{authenticated}",
  "using": "has_role(auth.uid(), 'system_admin'::app_role)",
  "check": null
 },
 {
  "schema": "public",
  "table": "fcpa_config",
  "policy": "System admins can insert fcpa_config",
  "cmd": "INSERT",
  "roles": "{authenticated}",
  "using": null,
  "check": "has_role(auth.uid(), 'system_admin'::app_role)"
 },
 {
  "schema": "public",
  "table": "fcpa_config",
  "policy": "System admins can update fcpa_config",
  "cmd": "UPDATE",
  "roles": "{authenticated}",
  "using": "has_role(auth.uid(), 'system_admin'::app_role)",
  "check": null
 },
 {
  "schema": "public",
  "table": "feature_definitions",
  "policy": "Anyone authenticated can read feature_definitions",
  "cmd": "SELECT",
  "roles": "{authenticated}",
  "using": "true",
  "check": null
 },
 {
  "schema": "public",
  "table": "feature_definitions",
  "policy": "System admins can manage feature_definitions",
  "cmd": "ALL",
  "roles": "{authenticated}",
  "using": "has_role(auth.uid(), 'system_admin'::app_role)",
  "check": "has_role(auth.uid(), 'system_admin'::app_role)"
 },
 {
  "schema": "public",
  "table": "feature_token_costs",
  "policy": "Authenticated users can read feature_token_costs",
  "cmd": "SELECT",
  "roles": "{authenticated}",
  "using": "true",
  "check": null
 },
 {
  "schema": "public",
  "table": "feature_token_costs",
  "policy": "System admins can manage feature_token_costs",
  "cmd": "ALL",
  "roles": "{authenticated}",
  "using": "has_role(auth.uid(), 'system_admin'::app_role)",
  "check": "has_role(auth.uid(), 'system_admin'::app_role)"
 },
 {
  "schema": "public",
  "table": "grouping_hitl_question",
  "policy": "Authenticated can read grouping_hitl_question",
  "cmd": "SELECT",
  "roles": "{authenticated}",
  "using": "true",
  "check": null
 },
 {
  "schema": "public",
  "table": "grouping_rule",
  "policy": "Authenticated can read grouping_rule",
  "cmd": "SELECT",
  "roles": "{authenticated}",
  "using": "true",
  "check": null
 },
 {
  "schema": "public",
  "table": "guide_categories",
  "policy": "Anyone authenticated can read guide_categories",
  "cmd": "SELECT",
  "roles": "{authenticated}",
  "using": "true",
  "check": null
 },
 {
  "schema": "public",
  "table": "guide_categories",
  "policy": "System admins can manage guide_categories",
  "cmd": "ALL",
  "roles": "{authenticated}",
  "using": "has_role(auth.uid(), 'system_admin'::app_role)",
  "check": "has_role(auth.uid(), 'system_admin'::app_role)"
 },
 {
  "schema": "public",
  "table": "guide_sections",
  "policy": "Anyone authenticated can read guide_sections",
  "cmd": "SELECT",
  "roles": "{authenticated}",
  "using": "true",
  "check": null
 },
 {
  "schema": "public",
  "table": "guide_sections",
  "policy": "System admins can manage guide_sections",
  "cmd": "ALL",
  "roles": "{authenticated}",
  "using": "has_role(auth.uid(), 'system_admin'::app_role)",
  "check": "has_role(auth.uid(), 'system_admin'::app_role)"
 },
 {
  "schema": "public",
  "table": "image_generation_usage",
  "policy": "Users can insert own usage",
  "cmd": "INSERT",
  "roles": "{authenticated}",
  "using": null,
  "check": "(auth.uid() = user_id)"
 },
 {
  "schema": "public",
  "table": "image_generation_usage",
  "policy": "Users can read own usage",
  "cmd": "SELECT",
  "roles": "{authenticated}",
  "using": "(auth.uid() = user_id)",
  "check": null
 },
 {
  "schema": "public",
  "table": "image_regeneration_feedback",
  "policy": "System admins can manage all feedback",
  "cmd": "ALL",
  "roles": "{authenticated}",
  "using": "has_role(auth.uid(), 'system_admin'::app_role)",
  "check": "has_role(auth.uid(), 'system_admin'::app_role)"
 },
 {
  "schema": "public",
  "table": "image_regeneration_feedback",
  "policy": "Users can insert own feedback",
  "cmd": "INSERT",
  "roles": "{authenticated}",
  "using": null,
  "check": "(auth.uid() = user_id)"
 },
 {
  "schema": "public",
  "table": "image_regeneration_feedback",
  "policy": "Users can read own feedback",
  "cmd": "SELECT",
  "roles": "{authenticated}",
  "using": "(auth.uid() = user_id)",
  "check": null
 },
 {
  "schema": "public",
  "table": "infokeyword_analyses",
  "policy": "Users can insert own analyses",
  "cmd": "INSERT",
  "roles": "{public}",
  "using": null,
  "check": "(auth.uid() = user_id)"
 },
 {
  "schema": "public",
  "table": "infokeyword_analyses",
  "policy": "Users can view own analyses",
  "cmd": "SELECT",
  "roles": "{public}",
  "using": "(auth.uid() = user_id)",
  "check": null
 },
 {
  "schema": "public",
  "table": "keyword_jobs",
  "policy": "Service role can update",
  "cmd": "UPDATE",
  "roles": "{public}",
  "using": "true",
  "check": null
 },
 {
  "schema": "public",
  "table": "keyword_jobs",
  "policy": "Users can insert own jobs",
  "cmd": "INSERT",
  "roles": "{public}",
  "using": null,
  "check": "(auth.uid() = user_id)"
 },
 {
  "schema": "public",
  "table": "keyword_jobs",
  "policy": "Users can view own jobs",
  "cmd": "SELECT",
  "roles": "{public}",
  "using": "(auth.uid() = user_id)",
  "check": null
 },
 {
  "schema": "public",
  "table": "mediscan_jobs",
  "policy": "Users can manage own jobs",
  "cmd": "ALL",
  "roles": "{public}",
  "using": "(auth.uid() = user_id)",
  "check": null
 },
 {
  "schema": "public",
  "table": "newsletters",
  "policy": "Anyone authenticated can read newsletters",
  "cmd": "SELECT",
  "roles": "{authenticated}",
  "using": "true",
  "check": null
 },
 {
  "schema": "public",
  "table": "newsletters",
  "policy": "System admins can manage newsletters",
  "cmd": "ALL",
  "roles": "{authenticated}",
  "using": "has_role(auth.uid(), 'system_admin'::app_role)",
  "check": "has_role(auth.uid(), 'system_admin'::app_role)"
 },
 {
  "schema": "public",
  "table": "notices",
  "policy": "Anyone authenticated can read notices",
  "cmd": "SELECT",
  "roles": "{authenticated}",
  "using": "true",
  "check": null
 },
 {
  "schema": "public",
  "table": "notices",
  "policy": "System admins can delete notices",
  "cmd": "DELETE",
  "roles": "{authenticated}",
  "using": "has_role(auth.uid(), 'system_admin'::app_role)",
  "check": null
 },
 {
  "schema": "public",
  "table": "notices",
  "policy": "System admins can insert notices",
  "cmd": "INSERT",
  "roles": "{authenticated}",
  "using": null,
  "check": "has_role(auth.uid(), 'system_admin'::app_role)"
 },
 {
  "schema": "public",
  "table": "notices",
  "policy": "System admins can update notices",
  "cmd": "UPDATE",
  "roles": "{authenticated}",
  "using": "has_role(auth.uid(), 'system_admin'::app_role)",
  "check": null
 },
 {
  "schema": "public",
  "table": "ohmy_capture_history",
  "policy": "Agents can delete own ohmy capture history",
  "cmd": "DELETE",
  "roles": "{public}",
  "using": "(auth.uid() = user_id)",
  "check": null
 },
 {
  "schema": "public",
  "table": "ohmy_capture_history",
  "policy": "Agents can insert own ohmy capture history",
  "cmd": "INSERT",
  "roles": "{public}",
  "using": null,
  "check": "(auth.uid() = user_id)"
 },
 {
  "schema": "public",
  "table": "ohmy_capture_history",
  "policy": "Agents can read own ohmy capture history",
  "cmd": "SELECT",
  "roles": "{public}",
  "using": "(auth.uid() = user_id)",
  "check": null
 },
 {
  "schema": "public",
  "table": "onboarding_reminds",
  "policy": "Users can insert own onboarding reminds",
  "cmd": "INSERT",
  "roles": "{public}",
  "using": null,
  "check": "(auth.uid() = user_id)"
 },
 {
  "schema": "public",
  "table": "onboarding_reminds",
  "policy": "Users can view own onboarding reminds",
  "cmd": "SELECT",
  "roles": "{public}",
  "using": "(auth.uid() = user_id)",
  "check": null
 },
 {
  "schema": "public",
  "table": "organization_subscriptions",
  "policy": "Org members can read own subscription",
  "cmd": "SELECT",
  "roles": "{authenticated}",
  "using": "(organization_id IN ( SELECT profiles.organization_id\n   FROM profiles\n  WHERE (profiles.id = auth.uid())))",
  "check": null
 },
 {
  "schema": "public",
  "table": "organization_subscriptions",
  "policy": "System admins can manage org subscriptions",
  "cmd": "ALL",
  "roles": "{authenticated}",
  "using": "has_role(auth.uid(), 'system_admin'::app_role)",
  "check": "has_role(auth.uid(), 'system_admin'::app_role)"
 },
 {
  "schema": "public",
  "table": "organizations",
  "policy": "Agents can read own organization",
  "cmd": "SELECT",
  "roles": "{authenticated}",
  "using": "(id IN ( SELECT profiles.organization_id\n   FROM profiles\n  WHERE (profiles.id = auth.uid())))",
  "check": null
 },
 {
  "schema": "public",
  "table": "organizations",
  "policy": "Org admins can read own organization",
  "cmd": "SELECT",
  "roles": "{authenticated}",
  "using": "(id IN ( SELECT profiles.organization_id\n   FROM profiles\n  WHERE (profiles.id = auth.uid())))",
  "check": null
 },
 {
  "schema": "public",
  "table": "organizations",
  "policy": "Org admins can update own organization",
  "cmd": "UPDATE",
  "roles": "{authenticated}",
  "using": "(has_role(auth.uid(), 'org_admin'::app_role) AND (id IN ( SELECT profiles.organization_id\n   FROM profiles\n  WHERE (profiles.id = auth.uid()))))",
  "check": null
 },
 {
  "schema": "public",
  "table": "organizations",
  "policy": "System admins can manage organizations",
  "cmd": "ALL",
  "roles": "{authenticated}",
  "using": "has_role(auth.uid(), 'system_admin'::app_role)",
  "check": "has_role(auth.uid(), 'system_admin'::app_role)"
 },
 {
  "schema": "public",
  "table": "pipeline_runs",
  "policy": "Service role full access",
  "cmd": "ALL",
  "roles": "{public}",
  "using": "true",
  "check": null
 },
 {
  "schema": "public",
  "table": "pipeline_runs",
  "policy": "Users can view own pipeline runs",
  "cmd": "SELECT",
  "roles": "{public}",
  "using": "(auth.uid() = user_id)",
  "check": null
 },
 {
  "schema": "public",
  "table": "plan_ai_models",
  "policy": "Authenticated users can read plan_ai_models",
  "cmd": "SELECT",
  "roles": "{authenticated}",
  "using": "true",
  "check": null
 },
 {
  "schema": "public",
  "table": "plan_ai_models",
  "policy": "System admins can manage plan_ai_models",
  "cmd": "ALL",
  "roles": "{authenticated}",
  "using": "has_role(auth.uid(), 'system_admin'::app_role)",
  "check": "has_role(auth.uid(), 'system_admin'::app_role)"
 },
 {
  "schema": "public",
  "table": "plan_token_config",
  "policy": "Authenticated users can read plan_token_config",
  "cmd": "SELECT",
  "roles": "{authenticated}",
  "using": "true",
  "check": null
 },
 {
  "schema": "public",
  "table": "plan_token_config",
  "policy": "System admins can manage plan_token_config",
  "cmd": "ALL",
  "roles": "{authenticated}",
  "using": "has_role(auth.uid(), 'system_admin'::app_role)",
  "check": "has_role(auth.uid(), 'system_admin'::app_role)"
 },
 {
  "schema": "public",
  "table": "policy_analyses",
  "policy": "Users can delete own policy analyses",
  "cmd": "DELETE",
  "roles": "{public}",
  "using": "(auth.uid() = user_id)",
  "check": null
 },
 {
  "schema": "public",
  "table": "policy_analyses",
  "policy": "Users can insert own policy analyses",
  "cmd": "INSERT",
  "roles": "{public}",
  "using": null,
  "check": "(auth.uid() = user_id)"
 },
 {
  "schema": "public",
  "table": "policy_analyses",
  "policy": "Users can update own policy analyses",
  "cmd": "UPDATE",
  "roles": "{public}",
  "using": "(auth.uid() = user_id)",
  "check": "(auth.uid() = user_id)"
 },
 {
  "schema": "public",
  "table": "policy_analyses",
  "policy": "Users can view own policy analyses",
  "cmd": "SELECT",
  "roles": "{public}",
  "using": "(auth.uid() = user_id)",
  "check": null
 },
 {
  "schema": "public",
  "table": "premium_data",
  "policy": "System admins can manage premium_data",
  "cmd": "ALL",
  "roles": "{authenticated}",
  "using": "has_role(auth.uid(), 'system_admin'::app_role)",
  "check": "has_role(auth.uid(), 'system_admin'::app_role)"
 },
 {
  "schema": "public",
  "table": "premium_data",
  "policy": "Users can read own org premium_data",
  "cmd": "SELECT",
  "roles": "{authenticated}",
  "using": "((organization_id IN ( SELECT profiles.organization_id\n   FROM profiles\n  WHERE (profiles.id = auth.uid()))) OR has_role(auth.uid(), 'system_admin'::app_role))",
  "check": null
 },
 {
  "schema": "public",
  "table": "profiles",
  "policy": "Users can insert own profile",
  "cmd": "INSERT",
  "roles": "{authenticated}",
  "using": null,
  "check": "(auth.uid() = id)"
 },
 {
  "schema": "public",
  "table": "profiles",
  "policy": "Users can read all profiles",
  "cmd": "SELECT",
  "roles": "{authenticated}",
  "using": "true",
  "check": null
 },
 {
  "schema": "public",
  "table": "profiles",
  "policy": "Users can update own profile",
  "cmd": "UPDATE",
  "roles": "{authenticated}",
  "using": "(auth.uid() = id)",
  "check": null
 },
 {
  "schema": "public",
  "table": "publish_log",
  "policy": "Users can insert own publish log",
  "cmd": "INSERT",
  "roles": "{public}",
  "using": null,
  "check": "(auth.uid() = user_id)"
 },
 {
  "schema": "public",
  "table": "publish_log",
  "policy": "Users can view own publish log",
  "cmd": "SELECT",
  "roles": "{public}",
  "using": "(auth.uid() = user_id)",
  "check": null
 },
 {
  "schema": "public",
  "table": "push_subscriptions",
  "policy": "Agents can insert push subs",
  "cmd": "INSERT",
  "roles": "{authenticated}",
  "using": null,
  "check": "(conversation_id IN ( SELECT conversations.id\n   FROM conversations\n  WHERE (conversations.agent_id = auth.uid())))"
 },
 {
  "schema": "public",
  "table": "push_subscriptions",
  "policy": "Agents can read own push subs",
  "cmd": "SELECT",
  "roles": "{authenticated}",
  "using": "(conversation_id IN ( SELECT conversations.id\n   FROM conversations\n  WHERE (conversations.agent_id = auth.uid())))",
  "check": null
 },
 {
  "schema": "public",
  "table": "push_subscriptions",
  "policy": "Agents can update own push subs",
  "cmd": "UPDATE",
  "roles": "{authenticated}",
  "using": "(conversation_id IN ( SELECT conversations.id\n   FROM conversations\n  WHERE (conversations.agent_id = auth.uid())))",
  "check": null
 },
 {
  "schema": "public",
  "table": "push_subscriptions",
  "policy": "Anon can insert push subs",
  "cmd": "INSERT",
  "roles": "{anon}",
  "using": null,
  "check": "(subscriber_type = 'customer'::text)"
 },
 {
  "schema": "public",
  "table": "push_subscriptions",
  "policy": "Anon can read push subs",
  "cmd": "SELECT",
  "roles": "{anon}",
  "using": "(subscriber_type = 'customer'::text)",
  "check": null
 },
 {
  "schema": "public",
  "table": "push_subscriptions",
  "policy": "Anon can update push subs",
  "cmd": "UPDATE",
  "roles": "{anon}",
  "using": "(subscriber_type = 'customer'::text)",
  "check": "(subscriber_type = 'customer'::text)"
 },
 {
  "schema": "public",
  "table": "recruiting_inquiry",
  "policy": "Service role can update recruiting_inquiry",
  "cmd": "UPDATE",
  "roles": "{public}",
  "using": "true",
  "check": null
 },
 {
  "schema": "public",
  "table": "recruiting_inquiry",
  "policy": "Users can insert own recruiting_inquiry",
  "cmd": "INSERT",
  "roles": "{public}",
  "using": null,
  "check": "(auth.uid() = user_id)"
 },
 {
  "schema": "public",
  "table": "recruiting_inquiry",
  "policy": "Users can view own recruiting_inquiry",
  "cmd": "SELECT",
  "roles": "{public}",
  "using": "(auth.uid() = user_id)",
  "check": null
 },
 {
  "schema": "public",
  "table": "roadmap_items",
  "policy": "Anyone authenticated can read roadmap_items",
  "cmd": "SELECT",
  "roles": "{authenticated}",
  "using": "true",
  "check": null
 },
 {
  "schema": "public",
  "table": "roadmap_items",
  "policy": "System admins can manage roadmap_items",
  "cmd": "ALL",
  "roles": "{authenticated}",
  "using": "has_role(auth.uid(), 'system_admin'::app_role)",
  "check": "has_role(auth.uid(), 'system_admin'::app_role)"
 },
 {
  "schema": "public",
  "table": "roadmap_phases",
  "policy": "Anyone authenticated can read roadmap_phases",
  "cmd": "SELECT",
  "roles": "{authenticated}",
  "using": "true",
  "check": null
 },
 {
  "schema": "public",
  "table": "roadmap_phases",
  "policy": "System admins can manage roadmap_phases",
  "cmd": "ALL",
  "roles": "{authenticated}",
  "using": "has_role(auth.uid(), 'system_admin'::app_role)",
  "check": "has_role(auth.uid(), 'system_admin'::app_role)"
 },
 {
  "schema": "public",
  "table": "setting_presets",
  "policy": "Users can create own presets",
  "cmd": "INSERT",
  "roles": "{authenticated}",
  "using": null,
  "check": "(auth.uid() = user_id)"
 },
 {
  "schema": "public",
  "table": "setting_presets",
  "policy": "Users can delete own presets",
  "cmd": "DELETE",
  "roles": "{authenticated}",
  "using": "(auth.uid() = user_id)",
  "check": null
 },
 {
  "schema": "public",
  "table": "setting_presets",
  "policy": "Users can read own presets",
  "cmd": "SELECT",
  "roles": "{authenticated}",
  "using": "(auth.uid() = user_id)",
  "check": null
 },
 {
  "schema": "public",
  "table": "setting_presets",
  "policy": "Users can update own presets",
  "cmd": "UPDATE",
  "roles": "{authenticated}",
  "using": "(auth.uid() = user_id)",
  "check": null
 },
 {
  "schema": "public",
  "table": "subscription_plans",
  "policy": "Anyone authenticated can read active plans",
  "cmd": "SELECT",
  "roles": "{authenticated}",
  "using": "(is_active = true)",
  "check": null
 },
 {
  "schema": "public",
  "table": "subscription_plans",
  "policy": "System admins can manage plans",
  "cmd": "ALL",
  "roles": "{authenticated}",
  "using": "has_role(auth.uid(), 'system_admin'::app_role)",
  "check": "has_role(auth.uid(), 'system_admin'::app_role)"
 },
 {
  "schema": "public",
  "table": "summary_topics",
  "policy": "Agents can create topics",
  "cmd": "INSERT",
  "roles": "{public}",
  "using": null,
  "check": "(customer_id IN ( SELECT cs.customer_id\n   FROM conversation_summaries cs\n  WHERE ((cs.id = summary_topics.summary_id) AND (cs.agent_id = auth.uid()))))"
 },
 {
  "schema": "public",
  "table": "summary_topics",
  "policy": "Agents can read own topics",
  "cmd": "SELECT",
  "roles": "{public}",
  "using": "(customer_id IN ( SELECT conversation_summaries.customer_id\n   FROM conversation_summaries\n  WHERE (conversation_summaries.agent_id = auth.uid())))",
  "check": null
 },
 {
  "schema": "public",
  "table": "token_usage_log",
  "policy": "System admins can manage token_usage_log",
  "cmd": "ALL",
  "roles": "{authenticated}",
  "using": "has_role(auth.uid(), 'system_admin'::app_role)",
  "check": "has_role(auth.uid(), 'system_admin'::app_role)"
 },
 {
  "schema": "public",
  "table": "token_usage_log",
  "policy": "Users can insert own token usage",
  "cmd": "INSERT",
  "roles": "{authenticated}",
  "using": null,
  "check": "(auth.uid() = user_id)"
 },
 {
  "schema": "public",
  "table": "token_usage_log",
  "policy": "Users can read own token usage log",
  "cmd": "SELECT",
  "roles": "{authenticated}",
  "using": "(auth.uid() = user_id)",
  "check": null
 },
 {
  "schema": "public",
  "table": "trend_collection_runs",
  "policy": "trend_collection_runs_public_read",
  "cmd": "SELECT",
  "roles": "{public}",
  "using": "true",
  "check": null
 },
 {
  "schema": "public",
  "table": "trend_data",
  "policy": "trend_data_public_read",
  "cmd": "SELECT",
  "roles": "{public}",
  "using": "true",
  "check": null
 },
 {
  "schema": "public",
  "table": "trend_keywords",
  "policy": "trend_keywords_public_read",
  "cmd": "SELECT",
  "roles": "{public}",
  "using": "true",
  "check": null
 },
 {
  "schema": "public",
  "table": "user_api_keys",
  "policy": "Users can create own api keys",
  "cmd": "INSERT",
  "roles": "{authenticated}",
  "using": null,
  "check": "(auth.uid() = user_id)"
 },
 {
  "schema": "public",
  "table": "user_api_keys",
  "policy": "Users can delete own api keys",
  "cmd": "DELETE",
  "roles": "{authenticated}",
  "using": "(auth.uid() = user_id)",
  "check": null
 },
 {
  "schema": "public",
  "table": "user_api_keys",
  "policy": "Users can update own api keys",
  "cmd": "UPDATE",
  "roles": "{authenticated}",
  "using": "(auth.uid() = user_id)",
  "check": null
 },
 {
  "schema": "public",
  "table": "user_api_keys",
  "policy": "Users can view own api keys",
  "cmd": "SELECT",
  "roles": "{authenticated}",
  "using": "(auth.uid() = user_id)",
  "check": null
 },
 {
  "schema": "public",
  "table": "user_cpa_links",
  "policy": "Users can create own cpa links",
  "cmd": "INSERT",
  "roles": "{public}",
  "using": null,
  "check": "(auth.uid() = user_id)"
 },
 {
  "schema": "public",
  "table": "user_cpa_links",
  "policy": "Users can delete own cpa links",
  "cmd": "DELETE",
  "roles": "{public}",
  "using": "(auth.uid() = user_id)",
  "check": null
 },
 {
  "schema": "public",
  "table": "user_cpa_links",
  "policy": "Users can view own cpa links",
  "cmd": "SELECT",
  "roles": "{public}",
  "using": "(auth.uid() = user_id)",
  "check": null
 },
 {
  "schema": "public",
  "table": "user_custom_prompts",
  "policy": "Users can create own prompts",
  "cmd": "INSERT",
  "roles": "{public}",
  "using": null,
  "check": "(auth.uid() = user_id)"
 },
 {
  "schema": "public",
  "table": "user_custom_prompts",
  "policy": "Users can delete own prompts",
  "cmd": "DELETE",
  "roles": "{public}",
  "using": "(auth.uid() = user_id)",
  "check": null
 },
 {
  "schema": "public",
  "table": "user_custom_prompts",
  "policy": "Users can update own prompts",
  "cmd": "UPDATE",
  "roles": "{public}",
  "using": "(auth.uid() = user_id)",
  "check": null
 },
 {
  "schema": "public",
  "table": "user_custom_prompts",
  "policy": "Users can view own prompts",
  "cmd": "SELECT",
  "roles": "{public}",
  "using": "(auth.uid() = user_id)",
  "check": null
 },
 {
  "schema": "public",
  "table": "user_naver_keys",
  "policy": "Users can delete own naver keys",
  "cmd": "DELETE",
  "roles": "{authenticated}",
  "using": "(auth.uid() = user_id)",
  "check": null
 },
 {
  "schema": "public",
  "table": "user_naver_keys",
  "policy": "Users can manage own naver keys",
  "cmd": "INSERT",
  "roles": "{authenticated}",
  "using": null,
  "check": "(auth.uid() = user_id)"
 },
 {
  "schema": "public",
  "table": "user_naver_keys",
  "policy": "Users can update own naver keys",
  "cmd": "UPDATE",
  "roles": "{authenticated}",
  "using": "(auth.uid() = user_id)",
  "check": null
 },
 {
  "schema": "public",
  "table": "user_naver_keys",
  "policy": "Users can view own naver keys",
  "cmd": "SELECT",
  "roles": "{authenticated}",
  "using": "(auth.uid() = user_id)",
  "check": null
 },
 {
  "schema": "public",
  "table": "user_policy_settings",
  "policy": "Users can insert own policy settings",
  "cmd": "INSERT",
  "roles": "{public}",
  "using": null,
  "check": "(auth.uid() = user_id)"
 },
 {
  "schema": "public",
  "table": "user_policy_settings",
  "policy": "Users can view own policy settings",
  "cmd": "SELECT",
  "roles": "{public}",
  "using": "(auth.uid() = user_id)",
  "check": null
 },
 {
  "schema": "public",
  "table": "user_roles",
  "policy": "System admins can manage all roles",
  "cmd": "ALL",
  "roles": "{authenticated}",
  "using": "has_role(auth.uid(), 'system_admin'::app_role)",
  "check": "has_role(auth.uid(), 'system_admin'::app_role)"
 },
 {
  "schema": "public",
  "table": "user_roles",
  "policy": "Users can read own roles",
  "cmd": "SELECT",
  "roles": "{authenticated}",
  "using": "(auth.uid() = user_id)",
  "check": null
 },
 {
  "schema": "public",
  "table": "user_subscriptions",
  "policy": "System admins can manage user subscriptions",
  "cmd": "ALL",
  "roles": "{authenticated}",
  "using": "has_role(auth.uid(), 'system_admin'::app_role)",
  "check": "has_role(auth.uid(), 'system_admin'::app_role)"
 },
 {
  "schema": "public",
  "table": "user_subscriptions",
  "policy": "Users can read own subscription",
  "cmd": "SELECT",
  "roles": "{authenticated}",
  "using": "(auth.uid() = user_id)",
  "check": null
 },
 {
  "schema": "public",
  "table": "user_tokens",
  "policy": "System admins can manage user_tokens",
  "cmd": "ALL",
  "roles": "{authenticated}",
  "using": "has_role(auth.uid(), 'system_admin'::app_role)",
  "check": "has_role(auth.uid(), 'system_admin'::app_role)"
 },
 {
  "schema": "public",
  "table": "user_tokens",
  "policy": "Users can read own token balance",
  "cmd": "SELECT",
  "roles": "{authenticated}",
  "using": "(auth.uid() = user_id)",
  "check": null
 },
 {
  "schema": "public",
  "table": "wiki_contributions",
  "policy": "Users can insert own wiki contributions",
  "cmd": "INSERT",
  "roles": "{public}",
  "using": null,
  "check": "(auth.uid() = user_id)"
 },
 {
  "schema": "public",
  "table": "wiki_contributions",
  "policy": "Users can view own wiki contributions",
  "cmd": "SELECT",
  "roles": "{public}",
  "using": "(auth.uid() = user_id)",
  "check": null
 }
]