Repository navigation
Boundaries on Cedar (fused): the contract, docs, screens and Activity words - #2880
Draft
davidmckayv wants to merge 11 commits into
Draft
davidmckayv wants to merge 11 commits into
davidmckayv wants to merge 11 commits into
Conversation
Boundaries move from CEL to Cedar. This is the API every slice of that move codes against, all additive: - Boundaries, BoundariesInput and BoundariesDraft gain an optional `rules` array: each rule with an id, its effect (forbid or permit), the language that decides it now, its Cedar, its CEL form, its name and description, the English it was written from and where that came from, and how it was moved from CEL (exact, model or none; converted or needs_rewrite; actions checked; mismatches; when). - A request with `rules` is authoritative. A request without it, as every released app sends, keeps today's meaning on the CEL view. - `deny`, `allow` and `labels` are deprecated, sunset 2027-12-02. - translateBoundary takes an optional `language` (cel when absent, as today) and answers with the language it wrote in. - A replay change names the deciding rule's id. Clients regenerated with `bun run api:generate`.
…y day this can merge
The configuration and architecture docs described boundary rules as CEL. They now say what the server does once rules move to Cedar: - docs/architecture.md: rules are Cedar policies (the Bot the principal, the intent the action, the facts in context, text facts lowercased), checked against OpenBot's schema when saved; CEL rules keep applying as written until a Cedar rule is proven to decide the same; how the saved list keeps deny and allow as every rule's CEL form, so the previous release enforces the same rules during a rolling upgrade or after a rollback; LISTEN/NOTIFY as before. - docs/configuration.md and .env.example: AGENT_COMPUTER_POLICY takes a Cedar policy anywhere it takes CEL, and a Cedar rule that doesn't validate, or sits in the wrong list, stops the start. - README.md: the governance bullet says Cedar.
…rsion rows The Boundaries screens read and save the rule records (`rules`) instead of the CEL lists. Each rule shows its English first and its Cedar second, never its Cedar in the list. A rule OpenBot couldn't move to Cedar is marked "Rewrite this", and one press rewrites it from its English, replays it and saves it in Cedar under the same id. A moved rule says it was moved and checked. New rules and templates are written in Cedar, and a description is translated with `language: "cedar"`. Activity reads a `computer.policy_converted` row in words, with the old and new text stacked. A real-browser test covers the list, the rewrite, a moved rule, Add rule and Activity in Chromium and WebKit, light and dark, wide and phone. It also catches words running past their card, which the old two-column "What a rule can check" did at a phone's width with the Cedar names.
The server records `computer.policy_converted` each time it tries to move a boundary rule from CEL to Cedar (openbot-backend, the conversion on upgrade). Every registered audit event has words here, so this one reads "Move a boundary rule to Cedar" in Activity and Audit. How the row itself reads (old and new rule, the outcome) is the Activity slice's.
# Conflicts: # release-policy.json
# Conflicts: # shared/audit-words.ts
… inside the per-test time
This branch has not been 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.
What this changes
The public side of BUILD C10 (boundaries move from CEL to Cedar), fused into one branch from
main. The server side is CopilotKit/openbot-backend#1139, which pins this branch.Supersedes (each merged here as it stood):
rules/BoundaryRule, translatelanguage, replayruleId,deny/allow/labelsdeprecated.env.example, README say Cedar; CEL kept for 12 monthscomputer.policy_convertedFusion notes
release-policy.json:database.tois0218_action_policy_rules. Main had0217_audit_intents(the trail, Activity: every action leaves a trace (fused) #2869 / backend Keep a person's message that arrives while a Claude Agent SDK tool call waits #1129); Cedar's migration is the next one.shared/audit-words.ts: Boundaries and Activity on Cedar: rules in words, Rewrite this, conversion rows #2863 and Activity words for a boundary rule moved to Cedar #2864 both namedcomputer.policy_converted. Kept Boundaries and Activity on Cedar: rules in words, Rewrite this, conversion rows #2863's "Move a boundary to the new rule language", since Activity says "the old/new rule language" and names Cedar only beside the rule's text.bun run api:generateafter the merge: no change, so the bundle and clients are what the sources say.Where it runs
Boundary and audit
computer.policy_converted; this names it).API and database
release-policy.jsonnames the newdatabase.to.Changelog
Before upgrading.
deny,allowandlabelson the boundaries endpoints (read, save, replay): send and readrulesinstead. Each still works, answers withDeprecationandSunsetheaders, sunset 2028-01-03.Admin.
Configuration.
AGENT_COMPUTER_POLICYtakes Cedar. Any rule indenyorallowmay be a Cedar policy instead of a CEL expression; one that doesn't validate against OpenBot's schema, or sits in the wrong list, stops the start. CEL rules keep working.API.
ruleslist, each rule in Cedar or, until it is moved, in CEL.translateBoundarycan write a rule in Cedar.Proof
bun run format:check,bun run lint,bun run api:lint,bun run typecheck,bun run build: clean.bun teston the boundaries screens, describe, read-failure and composing tests, API deprecations, the tolerant reader, release policy and manifest, and Activity's words: 121 pass.app/tests/boundaries-screens-layout.test.tsx, Chromium and WebKit, light and dark, 1440 and 390) runs in CI's real-browser job.