Skip to content

Boundaries on Cedar (fused): the contract, docs, screens and Activity words - #2880

Draft
davidmckayv wants to merge 15 commits into
mainfrom
david/cedar-fused
Draft

davidmckayv wants to merge 15 commits into
mainfrom
david/cedar-fused

Conversation

@davidmckayv

@davidmckayv davidmckayv commented Dec 3, 2026 •

Copy link
Copy Markdown
Contributor

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):

Fusion notes

Where it runs

  • New state that outlives a request? None here (spec, docs and screens).
  • What happens on the second replica? Nothing new.
  • Anything serialised? No.
  • Anything fanned out to a browser? No.
  • New listener, port, or schedule? No.

Boundary and audit

  • Every acting call still goes through the gateway: resolve, decide, audit, then act.
  • New refusals and new failures each write a row (the server writes computer.policy_converted; this names it).
  • Nothing new is trusted from the client that the server can resolve itself.

API and database

  • Additive only, as Cedar policy engine: shared contract #2848 describes: new inputs optional with today's behaviour when absent, deprecations with a sunset 365 days out, release-policy.json names the new database.to.

Changelog

Before upgrading.

  • Deprecated. Each still works, answers with Deprecation and Sunset headers, and is removed no earlier than its sunset, and only once nothing uses it.
    • PUT /api/v2/organizations/{organizationId}/boundaries body deny: send rules instead. Sunset 2028-01-03.
    • PUT /api/v2/organizations/{organizationId}/boundaries body allow: send rules instead. Sunset 2028-01-03.
    • PUT /api/v2/organizations/{organizationId}/boundaries body labels: send rules instead. Sunset 2028-01-03.
    • POST /api/v2/organizations/{organizationId}/boundaries/replay body boundaries.deny: send boundaries.rules instead. Sunset 2028-01-03.
    • POST /api/v2/organizations/{organizationId}/boundaries/replay body boundaries.allow: send boundaries.rules instead. Sunset 2028-01-03.
    • POST /api/v2/organizations/{organizationId}/boundaries/replay body boundaries.labels: send boundaries.rules instead. Sunset 2028-01-03.
    • GET /api/v2/organizations/{organizationId}/boundaries response deny: read rules instead. Sunset 2028-01-03.
    • GET /api/v2/organizations/{organizationId}/boundaries response allow: read rules instead. Sunset 2028-01-03.
    • GET /api/v2/organizations/{organizationId}/boundaries response labels: read rules instead. Sunset 2028-01-03.
    • PUT /api/v2/organizations/{organizationId}/boundaries response deny: read rules instead. Sunset 2028-01-03.
    • PUT /api/v2/organizations/{organizationId}/boundaries response allow: read rules instead. Sunset 2028-01-03.
    • PUT /api/v2/organizations/{organizationId}/boundaries response labels: read rules instead. Sunset 2028-01-03.

Admin.

  • Boundaries read in words, and say which rules still need rewriting. Each rule shows the English it was written from first and its Cedar second. A rule OpenBot couldn't move to Cedar with the same result is marked "Rewrite this", and one press rewrites it from its English, replays it and saves it in Cedar. New rules and templates are written in Cedar. A rule typed in CEL is still accepted and moved on save.
  • Activity records each rule moved to Cedar. Each row says whether the rule moved and how it was checked, with the old and new text.

Configuration.

  • AGENT_COMPUTER_POLICY takes Cedar. Any rule in deny or allow may 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.

  • Added: Boundaries rules in Cedar. Boundaries carry a rules list, each rule in Cedar or, until it is moved, in CEL. translateBoundary can 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 test on the boundaries screens, describe, read-failure and composing tests, API deprecations, the tolerant reader, release policy and manifest, and Activity's words: 121 pass.
  • The real-browser layout test (app/tests/boundaries-screens-layout.test.tsx, Chromium and WebKit, light and dark, 1440 and 390) runs in CI's real-browser job.

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`.
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
… its first sentence

Seen in the end-to-end run of the move to Cedar:

- A rule named by the sentence it was written from showed that sentence twice, as its name and
  again under it. Its English goes under its name only when it says something else.
- A rule nobody described, which OpenBot read, was listed by its whole reading, two sentences
  wrapping over three lines. Its first sentence, which says what it stops, is the name now, and
  the rest goes under it.
- Activity said a rule moved exactly was "Written from" OpenBot's reading of it. Only a rule the
  model wrote from words says what it was written from.
- "stops 1 test actions" is "stops 1 test action".

The new test fails on the code before this change.

This branch has not been deployed

No deployments
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.

1 participant