cognee-permissions

Explains cognee's ACL-based permission system for datasets, roles, and tenants.

30.4k|3.0k|Updated Aug 16, 2023
One-click install
npx skills add https://github.com/topoteretes/cognee --skill cognee-permissions
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cognee-permissions
Source: https://github.com/topoteretes/cognee/tree/main/.claude/skills/cognee-permissions
Command: npx skills add https://github.com/topoteretes/cognee --skill cognee-permissions

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Working with cognee's multi-tenant access control is confusing: grants are spread across users, roles, and tenants, enforcement is hidden behind a single dataset-resolution chokepoint, and denied reads silently return empty results. This Skill gives you a complete mental model of how permissions work so you can debug access issues and modify the system correctly.

Core Features & Use Cases

  • Permission model reference: Explains principals (User, Role, Tenant), the four permissions (read, write, delete, share), and how ACL grant rows combine through membership.
  • Enforcement map: Shows exactly where each operation (add, cognify, search, delete, share) checks permissions via get_authorized_existing_datasets, including the empty-results-instead-of-403 behavior.
  • Configuration guidance: Covers the ENABLE_BACKEND_ACCESS_CONTROL and REQUIRE_AUTHENTICATION switches and their multi-tenant vs single-user implications.
  • Use Case: A user's search returns nothing and you need to determine whether it is a missing read grant, a tenant isolation issue, or a data problem — this Skill tells you to check ACL grants before inspecting the graph.

Quick Start

Explain why a cognee search against a dataset returns empty results for a specific user and how to grant them read access.

Frequently Asked Questions about cognee-permissions

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

FAQPage Schema
How do I grant a user access to a dataset in cognee?

Grant access by calling POST /permissions/datasets/{principal_id} with the permission and dataset list, which requires the caller to hold the share permission on those datasets. Principals can be users, roles, or tenants, and dataset creators automatically receive all four permissions.

Why does cognee search return empty results for some users?

Denied reads return empty results instead of a 403 error, deliberately hiding which datasets exist. When search returns nothing, check the user's ACL grants and role or tenant memberships before investigating the knowledge graph itself.

What permissions exist in cognee's access control system?

Cognee defines exactly four permissions: read, write, delete, and share. Read gates search and visualization, write gates add and cognify, delete gates dataset deletion, and share gates granting or revoking access for other principals.

What does ENABLE_BACKEND_ACCESS_CONTROL do in cognee?

ENABLE_BACKEND_ACCESS_CONTROL toggles multi-tenant mode: when true, every dataset operation is permission-checked with isolated per-user databases; when false, checks short-circuit to allowed and all users share the same databases. Authentication is controlled separately by REQUIRE_AUTHENTICATION.

How do roles and tenants affect dataset permissions in cognee?

Roles and tenants are principals that can hold ACL grants, so one grant row covers every member. A user's effective access is the union of their personal grants plus all grants of every role and tenant they belong to.