Skip to content

docs(cloud): the org role matrix, and sessions and MCP sign-ins follow it - #1138

Closed
nc9 wants to merge 3 commits into
mainfrom
docs/role-matrix-3293
Closed

nc9 wants to merge 3 commits into
mainfrom
docs/role-matrix-3293

Conversation

@nc9

@nc9 nc9 commented Oct 26, 2026

Copy link
Copy Markdown
Contributor

Documents the organization role matrix that the API now enforces (squirrelscan/repo#3293). These docs go live when the private changes behind them ship, so hold the merge until those land: PR1a (REST API) and PR1b (MCP and OAuth). The lead coordinates the timing.

  • cloud/team.mdx:
    • the role table now matches what each role can do;
    • new action-by-role grid: read, run, manage websites, header values, credits and billing state, billing actions, org settings, members, role changes, API keys;
    • where roles apply (dashboard, CLI, MCP);
    • the 403 forbidden_role answer;
    • a billing member reads no websites or audits;
    • API keys follow their scopes;
    • an MCP sign-in ends when the role narrows.
    • Two lines that were wrong are fixed: "org deletion" (there is no such action) and "set roles from Settings → Team" (only the owner changes roles).
  • developers/authentication.mdx: login sessions hold their role's scopes. They are no longer "unscoped (full access)", and each role's scopes are listed.
  • developers/mcp.mdx: an OAuth sign-in follows the role, a refused tool answers FORBIDDEN with role and missing_scope, and a demotion ends the sign-in.
  • cli/keys.mdx: "plain member" now says "editor, viewer or billing member".

Checks: tangly check --strict passes all checks over 503 pages, and scripts/check-links.ts finds every internal link, anchor and Options table good. No em-dashes.

Skill: squirrelscan/repo#3378 covers the agent skill explaining a forbidden_role.

…w it

- cloud/team.mdx: what each role can do, the forbidden_role answer, keys are their scopes, sign-ins end on a demotion
- authentication.mdx: login sessions hold their role's scopes (no longer full access)
- mcp.mdx: an OAuth sign-in follows the role
- cli/keys.mdx: plain member -> editor, viewer or billing member

Signed-off-by: Nik Cubrilovic <[email protected]>
@claude

claude Bot commented Oct 26, 2026

Copy link
Copy Markdown

Review of the docs-only change. The role matrix reads consistently across the four files, apart from the stale statement and the owner/admin gap below. I did not check it against the API.

  • (medium) docs/cli/auth.mdx:107 still says "Login sessions are unscoped (full access). Scopes only apply to API keys." This PR removes the same claim from developers/authentication.mdx, so the two pages now contradict each other. Update it to match, ideally with a link to /cloud/team#roles.
  • (low) docs/developers/authentication.mdx: the new text lists the editor, viewer and billing scopes but not the owner and admin ones. A reader can't tell what a login session holds for those roles. Either list them or say they hold every scope their role allows.
  • (low) docs/cloud/team.mdx roles table says Admin can do "everything except changing roles", and the grid agrees. Reading it, the keys:write note in developers/mcp.mdx (OAuth grants it to owners and admins) matches too. The table is therefore fine, but Editor is described as able to read "the member list" in the grid and not in the table. Consider adding that to the table row for consistency.
  • (nit) docs/cli/keys.mdx: the reflowed paragraph has one short line and one overlong line (not be read, rather than failing the whole command. Under --json that reason is written to). Rewrap it to keep diffs tidy.
  • (nit) The PR body says to hold the merge until the private PRs (PR1a, PR1b) land. Since this is a live-from-main docs site, a maintainer should keep that in mind. There is no CHANGELOG bullet; AGENTS.md has a ### Docs block for user-visible doc changes, so you may want one.

Docs: updated. Skill: tracked in squirrelscan/repo#3378.

…ation feed needs audits:read

Signed-off-by: Nik Cubrilovic <[email protected]>
@github-actions

Copy link
Copy Markdown
Contributor

Auto-review did not complete

The claude-review job failed before posting a review. This PR has not been auto-reviewed. Run a review manually (/review) before merging.

  • Result: success / is_error=true after 1 turns, 0 permission denial(s), $0.00
  • Job log

Partial findings recovered from the session (incomplete, unverified, and NOT a merge signal):

Show partial review

You've hit your session limit · resets 7:40am (UTC)

@github-actions

Copy link
Copy Markdown
Contributor

Auto-review did not complete

The claude-review job failed before posting a review. This PR has not been auto-reviewed. Run a review manually (/review) before merging.

  • Result: success / is_error=true after 1 turns, 0 permission denial(s), $0.00
  • Job log

Partial findings recovered from the session (incomplete, unverified, and NOT a merge signal):

Show partial review

You've hit your session limit · resets 7:40am (UTC)

nc9 added a commit that referenced this pull request Oct 26, 2026
…ole and why (#1146)

The cloud now enforces the organization role matrix (squirrelscan/repo#3293, and #1138 here documents it). A viewer or billing member signed in to the CLI cannot run audits in that organization, so the server refuses two calls with `403`:
- the run register (`POST /v1/agent-runs/register`);
- the auto-publish (`POST /v1/reports`).

Both refusals come in the bare shape `{ error: "forbidden_role", message, role, missing_scope }`.

The CLI did not handle that shape:
- **Run register:** the run was silently left untracked. The warning path reads only a typed `error.code` from an allowlist.
- **Publish:** the code read `error.code` and `error.message` off a string, so it returned a command error with no code and no message.

Now:
- **Register:** a bare `forbidden_role` is a definitive failure. The audit prints "⚠ Run not tracked in your dashboard: Your role (viewer) in this organization does not include audits:write". Other bare-string errors, such as a 429 rate limit, still stay quiet.
- **Publish:** a bare `forbidden_role` returns the command error `forbidden_role` with the server's reason, plus "Ask an owner or admin for a role that runs audits, or run with --no-publish to keep the report local". Any other bare-string error returns `API_ERROR` naming the status and the error.
- The local audit and its results are unchanged.

Tests:
- `tests/lib/run-tracker.test.ts`: a new case for the bare `forbidden_role` warning. The existing 429-stays-quiet case still passes.
- `tests/cont
@nc9 nc9 mentioned this pull request Oct 26, 2026
@nc9

nc9 commented Oct 26, 2026

Copy link
Copy Markdown
Contributor Author

Landed in the v0.0.134 batch (#1149), main commits fd7a44f..13b9715.

@nc9 nc9 closed this Oct 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant