topoteretes/cognee

cognee-permissions

Use when working with cognee's users, permissions, and multi-tenancy — creating users, tenants and roles, sharing datasets (read/write/delete/share grants), acting as a specific user in the SDK or authenticating over HTTP (login, API keys), turning access control on or off, debugging PermissionDeniedError or missing datasets, or understanding where…

  • SKILL.md 已保存
  • 英文来源资料
  • 安装与运行未实测
先判断是否解决你的问题

cognee-permissions 是什么?

Use when working with cognee's users, permissions, and multi-tenancy — creating users, tenants and roles, sharing datasets (read/write/delete/share grants), acting as a specific user in the SDK or authenticating over HTTP (login, API keys), turning access control on or off, debugging PermissionDeniedError or missing datasets, or understanding where permissions are enforced and how datasets are isolated.

以上为来源原文,中文用途说明尚待整理。

按客户端选择安装入口

怎么接入你的 Agent?

  1. 定位完整 Skill 目录

    打开本项目来源,核对 SKILL.md 及其引用的脚本和资料。

  2. 交给你正在用的 Agent

    在下面选择客户端,展开并复制安装指令,让 Agent 读取来源后选择安装方式。

  3. 确认识别,再做具体任务

    让 Agent 回报安装目录和识别到的名称 cognee-permissions,然后告诉 Agent 你的任务和实际输入,让它先核对触发条件。

展开并复制给 Codex 的安装指令
发送给 Codex

安装并检查 cognee-permissions

请在 Codex 的当前工作环境中安装并检查 cognee-permissions 这个 Skill。

项目身份:topoteretes/cognee / cognee-permissions
来源:https://github.com/topoteretes/cognee/blob/1961133d0c68b450fe8e71941a756371e94f7c04/.agents/skills/cognee-permissions/SKILL.md
已定位的源文件:.agents/skills/cognee-permissions/SKILL.md

1. 先阅读真实 SKILL.md 和它引用的必要文件,确认触发条件、安装方式、依赖与权限;尊重源文件要求的审批步骤。
2. 按当前客户端支持的方式安装完整 Skill 目录,保留已有配置,不只复制一段提示词。涉及缺失凭证、目标目录或权限时先列出缺项并向我确认。
3. 安装后回读实际目录、Skill 名称和识别结果,说明哪些步骤已完成,哪些只是文档检查,不得把安装成功当作任务已经实测。
4. 如来源提供了可安全验证的示例,在我提供所需输入后做一个最小任务;创建、修改、删除、部署或发送内容前,按源文件和我的授权执行。
需要核对时再展开原文

来源原文与资料状态

源文件
已保存 SKILL.md,抓取于 2026-11-23T04:29:48.865Z
中文使用说明
尚待整理,保留英文来源内容
安装与任务测试
本站未执行安装或任务测试
来源复核
已保留来源记录;当前完整用法未逐项人工复核
展开 SKILL.md 原文、章节与历史收录资料

.agents/skills/cognee-permissions/SKILL.md · 抓取时间 2026-11-23T04:29:48.865Z

以下保留源文件的 description、章节及摘录,供核对中文说明;完整文件通过上方链接打开。

抓取成功不代表已完成安装或任务测试。

来源 description(原文)

Use when working with cognee's users, permissions, and multi-tenancy — creating users, tenants and roles, sharing datasets (read/write/delete/share grants), acting as a specific user in the SDK or authenticating over HTTP (login, API keys), turning access control on or off, debugging PermissionDeniedError or missing datasets, or understanding where permissions are enforced and how datasets are isolated.

查看源文件章节 / Source sections
  • 原文:Users, permissions, and multi-tenancy
  • 原文:Use it
  • 原文:Act as a user in the SDK
  • 原文:Share a dataset
  • 原文:Tenants and roles (organizations and groups)
  • 原文:Over HTTP
  • 原文:Turning access control off
  • 原文:Pitfalls
  • 原文:How it works
  • 原文:The model
  • 原文:Where it is enforced
  • 原文:Isolation
  • 原文:Seeing grants
  • 原文:Key files
  • 原文:Extending it
原文:Users, permissions, and multi-tenancy

Every dataset belongs to an owner, and every operation on it is checked against a **grant**: a principal (user, role, or tenant) holding a permission (`read`, `write`, `delete`, `share`) on a dataset. With access control on (the default), each user+dataset pair also gets its own graph and vector databases.

原文:Act as a user in the SDK

Without `user=`, SDK calls run as the default user (`default_user@example.com`, or `DEFAULT_USER_EMAIL`). To act as someone else, create or load them and pass `user=`: ```python import cognee from cognee.modules.users.methods import create_user, get_user alice = await create_user("alice@example.com", "password") bob = await create_user("bob@example.com", "password") res = await cognee.remember("Alice's notes", dataset_name="alice_notes", user=alice) await cognee.recall("What are the notes about?", user=alice, datasets=["alice_notes"]) ``` `remember`, `recall`, `search`, `forget`, `improve` and the dataset helpers all take `user=`.

原文:Share a dataset

The caller must hold `share` on the dataset. Share **by dataset id**: ```python from uuid import UUID from cognee.modules.users.permissions.methods import ( authorized_give_permission_on_datasets, authorized_revoke_permission_on_datasets, ) await authorized_give_permission_on_datasets( bob.id, # principal: a user, role, or tenant id [UUID(res.dataset_id)], # dataset ids (RememberResult.dataset_id is a str) "read", # "read" | "write" | "delete" | "share" alice.id, # the owner making the grant ) await cognee.recall("...", user=bob, dataset_ids=[UUID(res.dataset_id)]) # by id (must be a UUID) ``` Bob must address Alice's dataset by **id**: dataset *names* resolve only among the caller's own datasets.

原文:Tenants and roles (organizations and groups)

```python from cognee.modules.users.tenants.methods import add_user_to_tenant, create_tenant, select_tenant from cognee.modules.users.roles.methods import add_user_to_role, create_role tenant_id = await create_tenant("Acme", alice.id) # alice owns it await select_tenant(user_id=alice.id, tenant_id=tenant_id) role_id = await create_role(role_name="Researcher", owner_id=alice.id) await add_user_to_tenant(user_id=bob.id, tenant_id=tenant_id, owner_id=alice.id) await add_user_to_role(user_id=bob.id, role_id=role_id, owner_id=alice.id) await select_tenant(user_id=bob.id, tenant_id=tenant_id) alice = await get_user(alice.id) # reload after changing the active tenant res = await cognee.remember(text, dataset_name="acme_docs", user=alice) await authorized_give_permission_on_datasets(role_id, [UUID(res.dataset_id)], "read", alice.id) ``` - A user acts inside one **active tenant** (`select_tenant`; `None` is the personal space). Datasets are created in the active tenant. - The granter can only share datasets in **their current active tenant** (others raise `PermissionDeniedError`). The principal's tenant is not checked: a grant to a role on a personal dataset (or one from another tenant) succeeds, and its members see it only while their active tenant is the dataset's tenant (personal space for a personal dataset). To share inside a tenant, create the dataset with that tenant active. - Members of a role or tenant get its grants. A granted dataset is visible only while the member's active tenant is the dataset's tenant (`select_tenant`, then reload the user); a personal dataset is visible only in personal space. Full walkthrough: `examples/demos/permissions/user_permissions_and_access_control_example.py` (also `tenant_role_setup_example.py`, `tenant_role_constraints_example.py`).

原文:Over HTTP

- **Register / log in:** `POST /api/v1/auth/register`, then `POST /api/v1/auth/login` (form fields `username`, `password`). The response sets an auth cookie and returns `{"access_token", "token_type": "bearer"}`; send `Authorization: Bearer <token>`. - **API keys:** `POST /api/v1/auth/api-keys` creates one (`GET` lists, `DELETE /api-keys/{id}` removes); send it as `X-Api-Key: <key>`. - **Default user over HTTP:** it has no password unless `DEFAULT_USER_PASSWORD` is set (the server logs a warning at startup). - **Permissions routes** (`/api/v1/permissions`): | Endpoint | What it does | |---|---| | `POST /datasets/{principal_id}?permission_name=read` + JSON body `[dataset_ids]` | Grant (needs `share`) | | `DELETE /datasets/{principal_id}` | Revoke | | `GET /principals/{principal_id}/datasets?permission_name=read` | Datasets a principal holds a permission on | | `POST /tenants` · `POST /tenants/select` · `GET /tenants/me` | Create, switch, list your tenants | | `POST /users/{user_id}/tenants` · `DELETE /tenants/{tenant_id}/users/{user_id}` | Add/remove a tenant member | | `GET /tenants/{tenant_id}/users` | Tenant members | | `POST /roles` · `DELETE /roles/{role_id}` · `GET /tenants/{tenant_id}/roles` | Manage roles | | `POST` / `DELETE /users/{user_id}/roles` | Add/remove a role member | | `GET /tenants/{tenant_id}/roles/{role_id}/users` · `GET /tenants/{tenant_id}/roles/users/{user_id}` | Role members; a user's roles (404 if not a member) |

原文:Turning access control off

`ENABLE_BACKEND_ACCESS_CONTROL` is the master switch: - `true` (default): multi-tenant. API calls require auth, every dataset operation is permission-checked, and each user+dataset gets isolated graph and vector databases. - `false`: single-user storage. ACL checks still run, but they only gate which dataset ids may be named: retrieval runs over the shared graph and vector databases, so other users' content is not filtered out. **Every user reads and writes the same shared databases**. Use it only for a single-user deployment. Authentication follows the switch unless `REQUIRE_AUTHENTICATION` is set. `REQUIRE_AUTHENTICATION=true` with access control off keeps logins but not isolation; `REQUIRE_AUTHENTICATION=false` with access control on is ignored (auth is forced on with a warning). > **For production multi-tenant deployments** (managed isolation, the > production Postgres adapter, and horizontal scaling), contact > social@cognee.ai.

文件 SHA256:b845e039fd1e073fa4f042bdd90afc4efb9764cf67772434f4d03da80e86a16c

仓库许可证记录:Apache-2.0;repository-license-recorded-scope-unverified,查看来源。

SKILL.md原文description · 2026-11-23T04:29:48.865Z

Use when working with cognee's users, permissions, and multi-tenancy — creating users, tenants and roles, sharing datasets (read/write/delete/share grants), acting as a specific user in the SDK or authenticating over HTTP (login, API keys), turning access control on or off, debugging PermissionDeniedError or missing datasets, or understanding where permissions are enforced and how datasets are isolated.

查看历史简介来源

历史收录数据

来源仓库topoteretes/cognee
Skill源路径.agents/skills/cognee-permissions/SKILL.md

安装前请让使用的Agent先读取这个SKILL.md及其所在目录,确认依赖和所需权限。此页不生成未经来源验证的安装命令。

返回 Skills 目录,按任务继续筛选 · MCP与Skills教程与资源