Skip to content

Document what Cedar policies decide on - #1379

Merged
rdimitrov merged 2 commits into
mainfrom
rdimitrov/cedar-request-scope
Nov 27, 2026
Merged

rdimitrov merged 2 commits into
mainfrom
rdimitrov/cedar-request-scope

Conversation

@rdimitrov

Copy link
Copy Markdown
Member

Description

Why: the Cedar policy pages explain how policies decide, but never say what they can't see. A Cedar policy decides on the request (claims, tool, arguments). ToolHive doesn't inspect tools/call results or the backend's side effects. When an MCP server uses one shared backend credential, a policy pinned to one object can still permit a call that returns, or makes the backend change, other users' objects. Two examples also overstated what a policy guarantees. While checking them, several numeric examples turned out not to work as written.

What changed:

  • concepts/cedar-policies.mdx: new "What policies decide on" section. It states the request-only scope, gives a shared-credential example, and points to per-user backend credentials. The multi-tenant and data-sensitivity examples now say they gate the call, not the data the backend returns.
  • concepts/backend-auth.mdx: shared credentials now also list weak user isolation as a cost, linking to the new section.
  • Numeric examples fixed. JSON numbers, whole numbers included, become Cedar decimal values:
    • The ABAC and data-sensitivity examples used <= / >=, which raise a type error on decimals, so the policy always denied. They now use lessThanOrEqual.
    • reference/authz-policy-reference.mdx listed integers as Long with resource.arg_limit == 10 (never matches) and floats with == 0.95 (not valid Cedar). It now has a single Number → Decimal row with a decimal("10.0") example, plus a note on how to compare.

Type of change

  • Documentation update

Related issues/PRs

Submitter checklist

Content and formatting

  • I have reviewed the content for technical accuracy
  • I have reviewed the content for spelling, grammar, and style

Checked the numeric claims against ToolHive's Cedar authorizer (main, cedar-go v1.9.3) with a throwaway test. claim >= arg failed with type error: expected comparable value, got decimal, while lessThanOrEqual permitted. arg_limit == 10 with a JSON 10 was denied, while == decimal("10.0") permitted. == 0.95 failed to parse. Prettier, ESLint and npm run build pass, with no broken links.

🤖 Generated with Claude Code

Cedar policies decide on the request and never see what the backend
resolves or writes while serving a permitted call. Say so, and point
shared-credential deployments to per-user backend credentials.

Fix numeric examples that never match: JSON numbers, whole numbers
included, become Cedar decimals, so `<=`/`>=` raise an error and
`== 10` is always false.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Radoslav Dimitrov <radoslav@stacklok.com>
Copilot AI balanced review requested due to automatic review settings November 27, 2026 09:54
@vercel

vercel Bot commented Nov 27, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
docs-website Ready Ready Preview Nov 27, 2026 10:19am UTC

Request Review

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The documentation still misstates authorization inputs after webhook mutation, overpromises response preservation, and omits decimal limits that can cause evaluation errors and request denial.

3 open issues
What changed in this PR

Clarifies the boundary between Cedar request authorization and backend data access in ToolHive’s documentation, and corrects numeric policy examples.

Changes:

  • Explain request-based authorization and the isolation risks of shared backend credentials.
  • Clarify that tenant and sensitivity policies gate calls rather than enforce backend data isolation.
  • Update numeric examples and comparison guidance to use Cedar decimals.
File Description
docs/​toolhive/​reference/​authz-policy-reference.mdx Updates numeric argument conversion and comparison guidance.
docs/​toolhive/​concepts/​cedar-policies.mdx Adds policy-scope guidance and corrects authorization examples.
docs/​toolhive/​concepts/​backend-auth.mdx Explains shared-credential isolation limits and links to policy-scope guidance.

Review effort: Balanced

aponcedeleonch
aponcedeleonch previously approved these changes Nov 27, 2026

@aponcedeleonch aponcedeleonch left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for fixing the numeric examples too. I checked them against toolhive main and they hold up.

The Copilot review seems accurate to me though, so it'd be good to address those three threads before merging.

Cedar evaluates the request after mutating webhooks, and vMCP
composite tools reshape outputs, so say what Cedar itself does
rather than what reaches the client. Document the decimal range
and precision limits for numeric arguments.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Radoslav Dimitrov <radoslav@stacklok.com>
@rdimitrov
rdimitrov merged commit f2a1952 into main Nov 27, 2026
18 checks passed
@rdimitrov
rdimitrov deleted the rdimitrov/cedar-request-scope branch November 27, 2026 10:31

This branch was successfully deployed

1 active deployment
Preview — 6605d45f Deployed Nov 27, 2026 by vercel[bot]
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.

3 participants