PO

posthog-enterprise-rbac

Guides on setting up organization roles, SSO/SAML, and project-level access controls.

Install

mkdir -p .claude/skills/posthog-enterprise-rbac && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/3833" && unzip -o skill.zip -d .claude/skills/posthog-enterprise-rbac && rm skill.zip

Installs to .claude/skills/posthog-enterprise-rbac

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

PostHog enterprise access control: organization/project hierarchy, member
73 charsno explicit “when” trigger
Intermediate

Key capabilities

  • Create PostHog projects with access control
  • Add members to specific projects with assigned roles
  • Generate scoped API keys for various operations
  • Configure SAML 2.0 SSO for organization authentication
  • Query activity logs for permission and feature flag changes
  • Document access matrices for engineering and product teams

How it works

The skill uses PostHog API calls to manage organization and project access, create API keys with specific scopes, and configure SSO settings.

Inputs & outputs

You give it
organization ID, project ID, user UUID, API key scopes
You get back
configured project access, scoped API keys, SSO status, or activity log entries

When to use posthog-enterprise-rbac

  • Setting up SSO/SAML
  • Configuring RBAC roles
  • Managing project access

About this skill

PostHog Enterprise RBAC

Overview

PostHog access control uses a three-level hierarchy: Organization > Project > Resource. Organizations contain multiple projects (e.g., production, staging), and each project has its own data, feature flags, and dashboards. Members are assigned roles at the organization level and can be restricted to specific projects.

Prerequisites

  • PostHog Cloud or self-hosted with enterprise license
  • Organization admin role
  • Multiple projects configured (one per environment)

Access Control Model

LevelScopeControls
OrganizationAll projectsMember management, billing, SSO enforcement
ProjectSingle projectFeature flags, insights, dashboards, session recordings
API KeyScoped operationsPersonal API key with specific scopes

Member Roles:

RoleLevelPermissions
Owner15Full admin, billing, delete org
Admin8Manage members, all project settings
Member1View/create insights, flags, recordings

Instructions

Step 1: Set Up Project-Level Access

set -euo pipefail
# Create a production project with access control
curl -X POST "https://app.posthog.com/api/organizations/$ORG_ID/projects/" \
  -H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name": "Production", "access_control": true}'

# Add a member to a specific project (level 1 = Member, 8 = Admin)
curl -X POST "https://app.posthog.com/api/projects/$PROD_PROJECT_ID/members/" \
  -H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"user_id": "USER_UUID", "level": 1}'

# List current project members
curl "https://app.posthog.com/api/projects/$PROD_PROJECT_ID/members/" \
  -H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" | \
  jq '.results[] | {email: .user.email, level, joined_at}'

Step 2: Create Scoped API Keys

set -euo pipefail
# Read-only key for BI dashboard integration
curl -X POST "https://app.posthog.com/api/personal_api_keys/" \
  -H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "label": "bi-dashboard-readonly",
    "scopes": ["insight:read", "dashboard:read", "query:read"]
  }'

# Feature flag service key (read + write flags only)
curl -X POST "https://app.posthog.com/api/personal_api_keys/" \
  -H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "label": "flag-service",
    "scopes": ["feature_flag:read", "feature_flag:write"]
  }'

# Event export key (read events only)
curl -X POST "https://app.posthog.com/api/personal_api_keys/" \
  -H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "label": "data-export-readonly",
    "scopes": ["event:read", "query:read"]
  }'

# List all personal API keys
curl "https://app.posthog.com/api/personal_api_keys/" \
  -H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" | \
  jq '.[] | {id, label, scopes, created_at}'

Step 3: Configure SSO (Enterprise)

PostHog enterprise supports SAML 2.0 SSO. Configuration is in Organization Settings > Authentication:

  1. Enable SAML: Add your IdP metadata URL (e.g., Okta, Azure AD, Google Workspace)
  2. Enforce SSO: Toggle "Enforce SSO" to require all members to authenticate via IdP
  3. Auto-provisioning: New IdP users are automatically created in PostHog with Member role
  4. Group mapping: Map IdP groups to PostHog organization roles
set -euo pipefail
# Check SSO configuration status
curl "https://app.posthog.com/api/organizations/$ORG_ID/" \
  -H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" | \
  jq '{
    enforce_sso: .enforce_sso,
    saml_configured: (.saml_enforcement != null),
    member_count: .membership_count
  }'

Step 4: Audit Access and Changes

set -euo pipefail
# View recent activity log for permission changes
curl "https://app.posthog.com/api/projects/$POSTHOG_PROJECT_ID/activity_log/?scope=Organization" \
  -H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" | \
  jq '[.results[] | select(.activity | contains("member") or contains("role") or contains("api_key")) | {
    user: .user.email,
    activity,
    detail: .detail,
    created_at
  }] | .[:10]'

# View feature flag changes (who changed what)
curl "https://app.posthog.com/api/projects/$POSTHOG_PROJECT_ID/activity_log/?scope=FeatureFlag" \
  -H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" | \
  jq '[.results[:10][] | {
    user: .user.email,
    activity,
    item_id: .item_id,
    created_at
  }]'

Step 5: Access Matrix

# Recommended access matrix
access_matrix:
  engineering:
    staging_project:
      role: admin           # Full control in staging
      can_create_flags: true
      can_delete_flags: true
    production_project:
      role: member           # Read + create, no delete in prod
      can_create_flags: true
      can_delete_flags: false  # Require admin approval for flag deletion

  product:
    staging_project:
      role: member
      can_view_recordings: true
      can_create_insights: true
    production_project:
      role: member
      can_view_recordings: true
      can_create_insights: true

  bi_service_account:
    production_project:
      api_key_scopes: [insight:read, dashboard:read, query:read]
      # No write access

  flag_service_account:
    production_project:
      api_key_scopes: [feature_flag:read, feature_flag:write]
      # Only flag operations

Error Handling

IssueCauseSolution
403 on feature flag endpointKey missing required scopeCreate key with feature_flag:read scope
Member sees prod dataProject access not restrictedRemove from prod project, add to staging only
SSO bypass possibleSSO not enforcedEnable "Enforce SSO" in org settings
Can't create scoped keyNot org adminOnly admins can create API keys
Activity log gapsSelf-hosted log rotationIncrease log retention in PostHog config

Output

  • Project-level member access configured
  • Scoped API keys for services (BI, flag service, export)
  • SSO/SAML enforcement enabled
  • Activity audit log queries
  • Access matrix documented

Resources

Next Steps

For migration strategies, see posthog-migration-deep-dive.

Prerequisites

PostHog Cloud or self-hosted with enterprise licenseOrganization admin roleMultiple projects configured

Limitations

  • Requires an enterprise license for SSO functionality
  • Only organization admins can create API keys
  • Activity log gaps can occur with self-hosted log rotation

How it compares

This skill provides programmatic configuration and auditing of PostHog enterprise access controls, unlike manual UI-based setup.

Compared to similar skills

posthog-enterprise-rbac side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
posthog-enterprise-rbac (this skill)127dReviewIntermediate
windows-ui-automation178moReviewAdvanced
linux-production-shell-scripts76moReviewIntermediate
cursor-prod-checklist427dReviewIntermediate

Try saying

Example prompts that trigger this skill in your AI assistant.

More by jeremylongshore

View all by jeremylongshore

analyzing-logs

jeremylongshore

Analyze application logs to detect performance issues, identify error patterns, and improve stability by extracting key insights.

14123

ollama-setup

jeremylongshore

Configure auto-configure Ollama when user needs local LLM deployment, free AI alternatives, or wants to eliminate hosted API costs. Trigger phrases: "install ollama", "local AI", "free LLM", "self-hosted AI", "replace OpenAI", "no API costs". Use when appropriate context detected. Trigger with relevant phrases based on skill purpose.

1167

backtesting-trading-strategies

jeremylongshore

Backtest crypto and traditional trading strategies against historical data. Calculates performance metrics (Sharpe, Sortino, max drawdown), generates equity curves, and optimizes strategy parameters. Use when user wants to test a trading strategy, validate signals, or compare approaches. Trigger with phrases like "backtest strategy", "test trading strategy", "historical performance", "simulate trades", "optimize parameters", or "validate signals".

1071

generating-database-seed-data

jeremylongshore

Process this skill enables AI assistant to generate realistic test data and database seed scripts for development and testing environments. it uses faker libraries to create realistic data, maintains relational integrity, and allows configurable data volumes. u... Use when working with databases or data models. Trigger with phrases like 'database', 'query', or 'schema'.

1033

cursor-codebase-indexing

jeremylongshore

Execute set up and optimize Cursor codebase indexing. Triggers on "cursor index setup", "codebase indexing", "index codebase", "cursor semantic search". Use when working with cursor codebase indexing functionality. Trigger with phrases like "cursor codebase indexing", "cursor indexing", "cursor".

885

testing-mobile-apps

jeremylongshore

Execute mobile app testing on iOS and Android devices/simulators. Use when performing specialized testing. Trigger with phrases like "test mobile app", "run iOS tests", or "validate Android functionality".

810

You might also like

windows-ui-automation

martinholovsky

Expert in Windows UI Automation (UIA) and Win32 APIs for desktop automation. Specializes in accessible, secure automation of Windows applications including element discovery, input simulation, and process interaction. HIGH-RISK skill requiring strict security controls for system access.

17126

linux-production-shell-scripts

davila7

This skill should be used when the user asks to "create bash scripts", "automate Linux tasks", "monitor system resources", "backup files", "manage users", or "write production shell scripts". It provides ready-to-use shell script templates for system administration.

746

cursor-prod-checklist

jeremylongshore

Execute production readiness checklist for Cursor IDE setup. Triggers on "cursor production", "cursor ready", "cursor checklist", "optimize cursor setup". Use when working with cursor prod checklist functionality. Trigger with phrases like "cursor prod checklist", "cursor checklist", "cursor".

434

openevidence-prod-checklist

jeremylongshore

Production readiness checklist for OpenEvidence clinical AI deployments. Use when preparing for production launch, conducting pre-deployment reviews, or auditing OpenEvidence integration for compliance. Trigger with phrases like "openevidence production", "openevidence go-live", "openevidence checklist", "deploy openevidence", "openevidence readiness".

13

prowler-provider

prowler-cloud

Creates new Prowler cloud providers or adds services to existing providers. Trigger: When extending Prowler SDK provider architecture (adding a new provider or a new service to an existing provider).

13

custom-workers

ruvnet

Create and run custom background analysis workers with composable phases. Use when you need automated code analysis, security scanning, pattern learning, or API documentation generation.

12

Search skills

Search the agent skills registry