Skip to content

Wire Cedar into the cross-operator delegation example - #62

Open
carloshvp wants to merge 1 commit into
agentrust-io:mainfrom
carloshvp:wire-cedar-example
Open

Wire Cedar into the cross-operator delegation example#62
carloshvp wants to merge 1 commit into
agentrust-io:mainfrom
carloshvp:wire-cedar-example

Conversation

@carloshvp

Copy link
Copy Markdown
Member

Summary

  • Pin cedarpy to the verified 4.8.7 API.
  • Load policy.cedar into CedarPolicy in the cross-operator demo and test the shipped policy's allow and deny decisions.

Root cause

The demo treated policy.cedar as documentation and gave enforcement to a duplicate LocalPolicy allow-list. The cedarpy>=4.8 range also allowed the runtime and tests to resolve against a future incompatible API.

Impact

The example now evaluates the policy it ships. The delegated task:read capability passes the Cedar check, while Cedar denies task:write. The change keeps the existing software-asserted attestation labels.

Validation

  • pytest tests/unit/ tests/conformance/ -q --cov=src --cov-report=term-missing (202 passed, 93.82% coverage)
  • mypy src/ca2a_runtime/ src/ca2a_verify/
  • ruff check src/ tests/
  • bandit -q -r src/ -c pyproject.toml
  • pip-audit (no known vulnerabilities)
  • python examples/cross-operator-delegation/demo.py (12/12)

Closes #45

@carloshvp
carloshvp marked this pull request as ready for review July 28, 2026 06:07

@imran-siddique imran-siddique 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.

The change itself reads well and it is the right direction: loading policy.cedar into CedarPolicy and actually evaluating the rule, rather than mirroring it with a LocalPolicy allow-set, removes a stand-in that made the example weaker than it looked. The README and transcript updates match what the code now does, and CI is green on this branch.

Only blocker is a merge conflict in pyproject.toml, and it is my fault rather than yours. main moved under you twice today: #69 moved the extension URI and maintainer email off agentrust.io, and #71 bumped the agentrust-trace pins for the TRACE v0.2 cutover. Both touched the dependency block you are editing.

It should be a mechanical resolution: keep your Cedar dependency addition, take main's versions for agentrust-trace (>=0.5) and agentrust-trace-tests (>=0.4,<0.5). Happy to push the rebase for you if you would rather not deal with a conflict you did not cause, just say so.

One unrelated note in case you hit it: tests/unit/test_cedar.py can fail locally on around six tests while passing in CI. That is an environment difference rather than your code, and CI here is clean.

@carloshvp
carloshvp force-pushed the wire-cedar-example branch from 44dd2a4 to 3c3cdd7 Compare July 29, 2026 06:33
@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@carloshvp

Copy link
Copy Markdown
Member Author

@imran-siddique I rebased this onto current main and resolved the pyproject.toml conflict in 3c3cdd7. The branch keeps cedarpy==4.8.7 and takes the current TRACE constraints: agentrust-trace>=0.5 and agentrust-trace-tests>=0.4,<0.5.

Local validation completed with 212 passed and 3 skipped, plus mypy, Ruff, Bandit, pip-audit, and all 12 demo scenarios. GitHub reports the branch mergeable with all required checks green.

Could you re-review when available?

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.

Wire the real Cedar engine into the cross-operator-delegation example

3 participants