db-impersonate

Set PostgreSQL session claims to impersonate users for testing RLS policies.

3|Updated Feb 7, 2026
One-click install
npx skills add https://github.com/GDSDN/kord-aios --skill db-impersonate
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: db-impersonate
Source: https://github.com/GDSDN/kord-aios/tree/main/src/features/builtin-skills/kord-aios/database/db-impersonate
Command: npx skills add https://github.com/GDSDN/kord-aios --skill db-impersonate

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill allows developers to test Row Level Security (RLS) policies by temporarily emulating authenticated users within a database session, ensuring data access controls function as expected.

Core Features & Use Cases

  • RLS Testing: Simulate different user roles and permissions to validate RLS policies.
  • Session Emulation: Set session claims (like user_id and role) to mimic authenticated users.
  • Use Case: Before deploying a new RLS policy that restricts access to user-specific data, use this Skill to impersonate various users and confirm they can only access their own records and not others'.

Quick Start

Use the db-impersonate skill to emulate user with ID 'a1b2c3d4-e5f6-7890-1234-567890abcdef'.

Frequently Asked Questions about db-impersonate

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I test Row Level Security policies for different users in PostgreSQL?

Test Row Level Security policies in PostgreSQL by setting session claims to impersonate authenticated users. This approach validates data access controls by mimicking different user roles and permissions within interactive SQL sessions.

Can I simulate authenticated users to validate Supabase data access controls?

Yes, you can simulate authenticated users to validate Supabase data access controls by setting session claims like user_id and role. This emulates user-specific permissions to confirm RLS policies restrict access correctly.

What is the best way to check if my RLS policies restrict access to user-specific data?

The best way to check if RLS policies restrict access to user-specific data is by impersonating various users in a database session. You can confirm they access only their own records and not others' records.

How does setting session claims help with RLS testing?

Setting session claims helps with RLS testing by temporarily emulating authenticated users within a database session. This mechanism mimics user roles and permissions to ensure data access controls function as expected before deployment.

What should I do if database connection or query issues occur during RLS validation?

If database connection or query issues occur during RLS validation, refer to detailed error handling strategies provided for common database problems. These strategies help troubleshoot issues during interactive SQL sessions.

Do I need a specific database environment to emulate users for RLS testing?

You need a PostgreSQL database environment with Row Level Security policies configured to emulate users for RLS testing. The process sets session claims within interactive SQL sessions to validate access controls for different roles.