memstack-security-rls-guardian

memstack-security-rls-guardian is a skill for Claude Code from cwinvestments/memstack. It costs 84 tokens per session (3,300 once invoked), scanned A, original, MIT.

A database-security helper for Supabase and PostgreSQL projects that enforces Row Level Security whenever tables are created or changed. Row Level Security controls which users can see or modify individual database rows.

In plain words
What is it for?
Use it while creating or altering tables, editing migration files, or designing a database schema, with policy patterns, migration templates, pre-commit checks, and audit queries.
Why use it?
It helps prevent a new table from being deployed without access policies. It keeps protection alongside table-creation and migration work instead of relying on a later audit.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the memstack plugin — 87 skills, 2 commands, 6 hooks shipped together

Good fit Use it while creating or altering tables, editing migration files, or designing a database schema, with policy patterns, migration templates, pre-commit checks, and audit queries.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/cwinvestments/memstack/rls-guardian
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add cwinvestments/memstack --skill rls-guardian
Clone the repo
git clone --depth 1 https://github.com/cwinvestments/memstack

Made for: Claude Code.

Or install memstack, the plugin that ships this one along with the rest of its 87 skills, 2 commands, 6 hooks.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for memstack-security-rls-guardian

README.md
[![agentmods](https://agentmods.dev/badge/skills/cwinvestments/memstack/rls-guardian/github.svg)](https://agentmods.dev/skills/cwinvestments/memstack/rls-guardian)
Your own site
<a href="https://agentmods.dev/skills/cwinvestments/memstack/rls-guardian"><img src="https://agentmods.dev/badge/skills/cwinvestments/memstack/rls-guardian/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for memstack-security-rls-guardian

Your own site · 80×15
<a href="https://agentmods.dev/skills/cwinvestments/memstack/rls-guardian"><img src="https://agentmods.dev/badge/skills/cwinvestments/memstack/rls-guardian.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 84 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,300 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 1 finding, up to medium

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • medium Tool Misuse · line 37
    Tool defaults are unsafe or overly permissive (e.g. disabled TLS verification, no authentication, world-writable permissions). Unsafe defaults widen the attack surface.
    Fix: Override unsafe defaults with secure settings (verify=True, auth required, restrictive permissions). Review and harden all tool configurations.
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00084 $0.03300
Opus 5.5 $0.00034 $0.01320
Sonnet 5.5 $0.00017 $0.00660
Haiku 4.5 $0.00008 $0.00330

Measured 1mo ago against content hash a588d5777cba, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

memstack-security-rls-guardian scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/security/rls-guardian/SKILL.md · 431 lines

How it starts

The opening of the file, as written. The whole thing — 431 lines — stays where its author put it; the contents beside it link to each section on GitHub.

RLS Guardian: Enforcing Row Level Security...

Enforces Row Level Security on every Supabase table creation, ensuring no table goes live without proper access policies. Provides 4 policy patterns, migration templates, pre-commit checks, and audit queries to find unprotected tables.

Activation

When this skill activates, output:

RLS Guardian: Enforcing Row Level Security...

Then execute the protocol below.

Context Guard

Context Status
User writes CREATE TABLE or ALTER TABLE SQL ACTIVE
User creates or edits a migration file ACTIVE
User says "new table", "database schema", "add table" ACTIVE
User says "RLS", "row level security", "table policies" ACTIVE
User asks for a general RLS audit of existing tables DORMANT: use RLS Checker
User asks a general SQL query unrelated to schema DORMANT: do not activate

Common Mistakes

Mistake Why It's Wrong
"Create table now, add RLS later" Every minute without RLS is a window where all rows are accessible to any authenticated user. RLS must be in the same migration.
"Enable RLS but no policies" ALTER TABLE ENABLE ROW LEVEL SECURITY with no policies blocks ALL access including the service role via API. Users get empty results, devs panic.
"Only add a SELECT policy" SELECT-only leaves INSERT, UPDATE, DELETE wide open. All 4 operations need explicit policies.
"Use true as the policy expression" USING (true) makes the table world-readable. Only valid for genuinely public data (e.g. blog posts). Never for user data.
"Forget the service role" Supabase service role bypasses RLS by design. But if you switch to anon key on the frontend, every table without policies is exposed.

Protocol

Step 1: Classify the Table

Before writing any policy, classify the table's access pattern:

Pattern Description Example Tables
User-scoped Each row belongs to one user via user_id profiles, settings, api_keys, notifications
Org-scoped Rows belong to an organization; users access via membership projects, invoices, team_settings
Public-read Anyone can read, only owners can write blog_posts, public_profiles, product_listings
Junction Many-to-many relationship linking two entities team_members, project_collaborators
System Internal tables not accessed by end users migrations, cron_jobs, audit_logs

Read the full file on GitHub · 431 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago Changed a588d5777cba
  2. 1mo ago First seen · 431 lines · 84 tokens per session scan A 66c18b462b89

Subscribe to this mod's changes

memstack-security-rls-guardian is a skill published in the GitHub repository cwinvestments/memstack (425 stars, last pushed 2d ago), licensed MIT. It adds 84 tokens to every session and 3,300 once invoked, about $0.0003 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.