Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 27 additions & 25 deletions products/access_control/mcp/tools.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,13 @@ tools:
description: >
Sets the level everyone in the project gets for one scope when they have no member rule or role rule of
their own there. Use it to change the project baseline (`resource: project` with the project id as
`resource_id`, level `member` or `admin`), the default for a whole tool (`resource: dashboard`, level
`none`, `viewer`, `editor` or `manager`), one object (add `resource_id`), or one person or event property
(`resource: property_definition` with the property definition id as `resource_id`, level `none`, `read` or
`read_write`). A null `access_level` removes the rule, so the scope falls back to its inherited level. An
empty result means the rule is cleared. Read access-control-defaults-get first and tell the user the current
and the new level before you ask for confirmation. Requires human typed confirmation.
`resource_id`, level `none`, `member` or `admin`), the default for a whole tool (`resource: dashboard`,
level `none`, `viewer`, `editor` or `manager`), one object (add `resource_id`), or one person or event
property (`resource: property_definition` with the property definition id as `resource_id`, level `none`,
`read` or `read_write`). A project level of `none` blocks access to the project and its resources. A null
`access_level` removes the rule, so the scope falls back to its inherited level. An empty result means the
rule is cleared. Read access-control-defaults-get first and tell the user the current and new level before
asking for confirmation. Requires human typed confirmation.
agent_note: >
A member rule or a role rule on the same scope still wins over this default. Verify the result with
access-control-defaults-get or access-control-members-list.
Expand Down Expand Up @@ -96,8 +97,8 @@ tools:
confirmed_action:
message: >
About to set the default {resource} access rule in project {id} to {access_level}, for object
{resource_id} (null means the whole tool; a null level clears the rule). This changes what every member
without a rule of their own gets. Reply 'confirm' to proceed.
{resource_id} (null means the whole tool; a null level clears the rule). A project level of `none`
blocks access to the project and its resources. Reply 'confirm' to proceed.
action_label: change the default access rule
access-control-defaults-get:
operation: organizations_projects_access_control_defaults_retrieve
Expand All @@ -110,11 +111,11 @@ tools:
idempotent: true
title: Get the project's default access
description: >
The access everyone in the project gets unless a rule of their own, or a role's rule, says otherwise: the
default project level (member or admin) and the default level per tool (none, viewer, editor, manager), with
the lowest and highest level each tool allows. Also lists which tools accept rules on single objects, such
as one dashboard or one notebook. Start here to understand a project's baseline before checking a member or
a role.
The access everyone in the project gets unless a member or role rule says otherwise: the default project
level (none, member or admin) and the default level per tool (none, viewer, editor or manager), with the
lowest and highest level each tool allows. A project level of `none` blocks access to the project and its
resources. Also lists which tools accept rules on single objects, such as one dashboard or one notebook.
Start here to understand a project's baseline before checking a member or role.
agent_note: >
access-control-members-list or access-control-roles-list show who deviates from this baseline.
access-control-default-objects-list and access-control-default-properties-list show defaults set on single
Expand Down Expand Up @@ -200,13 +201,13 @@ tools:
description: >
Sets the level one organization member gets for one scope. A member rule applies to that person only and
wins over their role rules and the default. The scope is the project (`resource: project` with the project
id as `resource_id`, level `member` or `admin`), a whole tool (`resource: dashboard`, level `none`,
id as `resource_id`, level `none`, `member` or `admin`), a whole tool (`resource: dashboard`, level `none`,
`viewer`, `editor` or `manager`), one object (add `resource_id`), or one property (`resource:
property_definition`, level `none`, `read` or `read_write`). A null `access_level` removes the member's
rule, so they fall back to their role rules or the default. An empty result means the rule is cleared. When
several people need the same change, prefer a role rule. Read access-control-members-list with `member_id`
first and tell the user the current and the new level before you ask for confirmation. Requires human typed
confirmation.
property_definition`, level `none`, `read` or `read_write`). A project level of `none` blocks access to the
project and its resources. A null `access_level` removes the member's rule, so they fall back to their role
rules or the default. An empty result means the rule is cleared. When several people need the same change,
prefer a role rule. Read access-control-members-list with `member_id` first and tell the user the current
and new level before asking for confirmation. Requires human typed confirmation.
agent_note: >
Organization admins and owners have full access regardless of rules. Verify the result with
access-control-members-list and `member_id`.
Expand Down Expand Up @@ -343,12 +344,13 @@ tools:
description: >
Sets the level every member of one role gets for one scope. A role rule wins over the default, and a
member's own rule wins over it. The scope is the project (`resource: project` with the project id as
`resource_id`, level `member` or `admin`), a whole tool (`resource: dashboard`, level `none`, `viewer`,
`editor` or `manager`), one object (add `resource_id`), or one property (`resource: property_definition`,
level `none`, `read` or `read_write`). A null `access_level` removes the role's rule. An empty result means
the rule is cleared. Role rules are enforced only on plans with role-based access. Read
access-control-roles-list with `role_id` first and tell the user the current and the new level before you
ask for confirmation. Requires human typed confirmation.
`resource_id`, level `none`, `member` or `admin`), a whole tool (`resource: dashboard`, level `none`,
`viewer`, `editor` or `manager`), one object (add `resource_id`), or one property (`resource:
property_definition`, level `none`, `read` or `read_write`). A project level of `none` blocks access to the
project and its resources. A null `access_level` removes the role's rule. An empty result means the rule is
cleared. Role rules are enforced only on plans with role-based access. Read access-control-roles-list with
`role_id` first and tell the user the current and new level before asking for confirmation. Requires human
typed confirmation.
agent_note: |
Who is in the role is on role-members-list. Verify the result with access-control-roles-list and `role_id`.
param_overrides:
Expand Down
38 changes: 22 additions & 16 deletions products/access_control/skills/checking-member-access/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ the enforced level and where it comes from. This skill is for reading them corre
- "Which properties are hidden from the support role?"
- "What does the `analyst` role grant?" / "What is the default access in this project?"

Not for changing rules. The read tools cannot write, and the settings page is where rules are edited.
Access rules can also be changed with MCP write tools. Read the current rule first, explain the change, then use the prepare/execute flow and call execute only after the user confirms.

## Plan availability

Expand All @@ -44,8 +44,9 @@ Not for changing rules. The read tools cannot write, and the settings page is wh
- **Scopes.** The project itself, then each tool (`dashboard`, `insight`, `feature_flag`, `notebook`,
`experiment`, `warehouse_objects`, and so on), then single objects inside a tool, then person and event
properties. The tool names are the keys of `resources` in a members-list entry.
- **Project levels.** `member` can view and edit the resources their other rules permit. `admin` can also
edit project settings, manage the project's access rules, and delete the project.
- **Project levels.** `none` blocks access to the project and its resources. `member` can view and edit the
resources their other rules permit. `admin` can also edit project settings, manage the project's access rules,
and delete the project.
- **Tool and object levels.** `none` cannot view. `viewer` can view but not change. `editor` can view and
change. `manager` can also manage the access rules of the tool or object. Order: `none` < `viewer` <
`editor` < `manager`.
Expand All @@ -66,19 +67,22 @@ Not for changing rules. The read tools cannot write, and the settings page is wh

## Available tools

| Tool | Returns |
| ------------------------------------------------- | ------------------------------------------------------------------------------------------------ |
| `posthog:access-control-members-list` | Every member's enforced access to the project and to each tool. `member_id` narrows to a member. |
| `posthog:access-control-roles-list` | The same per role. `role_id` narrows to a role. |
| `posthog:access-control-defaults-get` | The project baseline, and which tools accept rules on single objects. |
| `posthog:access-control-member-objects-list` | The object rules set for a member: every object with a rule for that member. |
| `posthog:access-control-member-properties-list` | The property rules set for a member. |
| `posthog:access-control-role-objects-list` | The object rules set for a role. |
| `posthog:access-control-role-properties-list` | The property rules set for a role. |
| `posthog:access-control-default-objects-list` | The object rules that apply to everyone in the project. |
| `posthog:access-control-default-properties-list` | The property rules that apply to everyone in the project. |
| `posthog:org-members-list` | Membership ids, names and organization levels. No project access details. |
| `posthog:roles-list`, `posthog:role-members-list` | Role names by id, and who is in a role. |
| Tool | Returns |
| ----------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------ |
| `posthog:access-control-members-list` | Every member's enforced access to the project and to each tool. `member_id` narrows to a member. |
| `posthog:access-control-roles-list` | The same per role. `role_id` narrows to a role. |
| `posthog:access-control-defaults-get` | The project baseline, and which tools accept rules on single objects. |
| `posthog:access-control-default-rule-set-prepare` / `posthog:access-control-default-rule-set-execute` | Set or clear a default rule for a scope. |
| `posthog:access-control-member-rule-set-prepare` / `posthog:access-control-member-rule-set-execute` | Set or clear one member's rule for a scope. |
| `posthog:access-control-role-rule-set-prepare` / `posthog:access-control-role-rule-set-execute` | Set or clear one role's rule for a scope. |
| `posthog:access-control-member-objects-list` | The object rules set for a member: every object with a rule for that member. |
| `posthog:access-control-member-properties-list` | The property rules set for a member. |
| `posthog:access-control-role-objects-list` | The object rules set for a role. |
| `posthog:access-control-role-properties-list` | The property rules set for a role. |
| `posthog:access-control-default-objects-list` | The object rules that apply to everyone in the project. |
| `posthog:access-control-default-properties-list` | The property rules that apply to everyone in the project. |
| `posthog:org-members-list` | Membership ids, names and organization levels. No project access details. |
| `posthog:roles-list`, `posthog:role-members-list` | Role names by id, and who is in a role. |

All access control tools take an optional project id and default to the active project.

Expand Down Expand Up @@ -139,6 +143,8 @@ How to phrase the answer:

- An empty object or property list means no rules of that kind, not no access. The tool-level entry
still applies.
- A project default of `none` does not remove explicit member or role grants. Check the members and roles
lists to find those grants. Organization admins and owners always bypass project rules.
- A member missing from `members-list` is not proof of no access. A caller who is not an organization
admin, in an organization where members cannot see each other, only sees members with project-scoped
access.
Expand Down
Loading
Loading