Repository navigation
Document what Cedar policies decide on - #1379
Merged
Merged
Conversation
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>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
There was a problem hiding this comment.
🟡 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
previously approved these changes
Nov 27, 2026
aponcedeleonch
left a comment
Member
There was a problem hiding this comment.
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>
aponcedeleonch
approved these changes
Nov 27, 2026
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

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/callresults 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.decimalvalues:<=/>=, which raise a type error on decimals, so the policy always denied. They now uselessThanOrEqual.reference/authz-policy-reference.mdxlisted integers asLongwithresource.arg_limit == 10(never matches) and floats with== 0.95(not valid Cedar). It now has a single Number → Decimal row with adecimal("10.0")example, plus a note on how to compare.Type of change
Related issues/PRs
docs/authz.mdin the main repo.Submitter checklist
Content and formatting
Checked the numeric claims against ToolHive's Cedar authorizer (
main, cedar-go v1.9.3) with a throwaway test.claim >= argfailed withtype error: expected comparable value, got decimal, whilelessThanOrEqualpermitted.arg_limit == 10with a JSON10was denied, while== decimal("10.0")permitted.== 0.95failed to parse. Prettier, ESLint andnpm run buildpass, with no broken links.🤖 Generated with Claude Code