Repository navigation
fix(agent): annotated Blueprint Cedar rules fail task start - #1005
Merged
Merged
Conversation
Every repo cedar_policies entry went to PolicyEngine's legacy extra_policies path, which rejects @tier/@rule_id. Following the Cedar policy guide (annotated hard/soft rules) therefore failed every task on that repo at start; blueprint_soft_policies/blueprint_hard_policies were only ever used in unit tests. Registry Cedar modules share the field. - split_blueprint_policies routes @tier("hard") entries to the hard input, @tier("soft") to the soft input, and leaves unannotated entries on the legacy path. An entry declaring both tiers, or @rule_id without a tier, fails with a clear error instead of being guessed. - Tests: the guide's verbatim example rules build an engine through the runner's bootstrap and enforce as documented (hard deny, soft gate with min-wins timeout); fails with the original ValueError on the old wiring. - CEDAR_POLICY_GUIDE described a blueprint.yaml {hard, soft, disable} format and maxPreApprovalScope that do not exist; it now documents the Blueprint construct's array form and says which options are not implemented yet.
isadeks
force-pushed
the
fix/995-blueprint-annotated-cedar-rules
branch
from
November 5, 2026 14:37
6b83896 to
544c64e
Compare
5 tasks done
krokoko
previously requested changes
Nov 20, 2026
krokoko
left a comment
Contributor
There was a problem hiding this comment.
I’d hold this for two fixes. A valid Cedar rule can still stop every task on a repository, and the production-write example covers only one of the two path forms the agent receives. Both need a regression test. The full build passed locally with this branch merged with main.
krokoko
dismissed
their stale review
November 20, 2026 23:11
7e78a50 addresses all four findings. I pushed the fixes and verified the full build. The updated code is ready for an independent review.
krokoko
self-requested a review
November 20, 2026 23:26
krokoko
approved these changes
Nov 20, 2026
krokoko
enabled auto-merge
November 20, 2026 23:27
ayushtr-aws
approved these changes
Nov 20, 2026
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.
Closes #995.
The agent used to reject annotated rules from a Blueprint at task startup. That meant copying the example from the Cedar policy guide could stop every task on a repository.
The runner now reads each rule’s tier from Cedar’s parsed annotations. Hard rules deny the action, soft rules ask for approval, and a legacy rule keeps its generated
legacy_extra_<n>ID. The same handling applies to registry rules loaded at task startup. An entry that mixes tiers or supplies a rule ID without a tier fails at startup and identifies the invalid entry.bgagent policies listuses Cedar’s parser for inline rules too. It shows the built-ins and inline Blueprint rules. The guide explains where to find the registry modules that the agent also enforces.The guide now uses the
Blueprintconstruct’scedarPoliciesarray. Its production-write example covers relative and absolute paths. Its approval example explains how the task’s window and the rule’s 900-second cap interact. It also identifies the proposeddisableandmaxPreApprovalScopesettings as unimplemented.Tests