Supabase Policy Guardrails
Enforces Supabase Row Level Security (RLS) policies and custom guardrails to prevent unauthorized data access.
Install on your platform
We auto-selected Claude Code based on this skill’s supported platforms.
Run in terminal (recommended)
claude mcp add supabase-policy-guardrails npx -- -y @trustedskills/supabase-policy-guardrails
Or manually add to ~/.claude/settings.json
{
"mcpServers": {
"supabase-policy-guardrails": {
"command": "npx",
"args": [
"-y",
"@trustedskills/supabase-policy-guardrails"
]
}
}
}Requires Claude Code (claude CLI). Run claude --version to verify your install.
About This Skill
What it does
This skill allows AI agents to generate and apply Row Level Security (RLS) policies within a Supabase database. It can create complex RLS rules based on user roles, data attributes, and other contextual factors, ensuring secure and granular access control. The skill streamlines the process of defining and enforcing these policies directly from natural language instructions.
When to use it
- Enforcing User-Specific Data Access: You need to restrict a user's ability to view or modify specific rows in a table based on their role (e.g., only managers can see salary information).
- Implementing Regional Restrictions: You want to ensure that data is accessible only within certain geographic regions, using IP address checks in RLS policies.
- Automating Policy Updates: You need to dynamically adjust access controls as your application evolves and new security requirements arise.
- Creating Secure APIs: Generate RLS policies to protect API endpoints from unauthorized data access.
Key capabilities
- Generates Row Level Security (RLS) policies.
- Supports user role-based access control.
- Can incorporate data attributes into policy rules.
- Allows for dynamic policy creation based on context.
Example prompts
- "Create an RLS policy for the
orderstable that only allows users with the 'admin' role to see all orders." - "Generate a policy so users can only view their own profile data in the
userstable." - “Write a policy restricting access to the
productstable based on the user’s region.”
Tips & gotchas
- Requires familiarity with Supabase and Row Level Security concepts. The AI agent will generate SQL, but you'll need to understand how RLS works in Supabase to validate and deploy it correctly.
Tags
TrustedSkills Verification
Unlike other registries that point to live repositories, TrustedSkills pins every skill to a verified commit hash. This protects you from malicious updates — what you install today is exactly what was reviewed and verified.
Security Audits
| Gen Agent Trust Hub | Pass |
| Socket | Pass |
| Snyk | Pass |
🌐 Community
Passed automated security scans.