Skip to content

[Authz 4/N]: RBAC changes for listing agents, schedules, sessions - #600

Merged
chiragjn merged 2 commits into
mainfrom
authz/managed-session-schedule-reads
Sep 7, 2026
Merged

chiragjn merged 2 commits into
mainfrom
authz/managed-session-schedule-reads

Conversation

@chiragjn

@chiragjn chiragjn commented Sep 7, 2026 •

Copy link
Copy Markdown
Member

Summary

You can read a session, turn, events, metrics, schedule, or its runs if you created it, or if you manage the named agent it is bound to. Creating still requires permission to use that agent. Only the creator can update, delete, or cancel a session, create a turn, or download sandbox files. Only the creator can update, delete, pause, resume, or run a schedule. An OIDC settings admin can no longer see other users' schedules.

Checklist

  • I have read the contributing guidelines
  • pnpm build, pnpm test, pnpm typecheck, pnpm lint:ci, and pnpm format:check pass locally
  • Tests added/updated where it makes sense
  • No hand-edits to generated code (packages/trueforge-sdk, .github/fern/openapi/openapi.json, docs/openapi.json) — fork PRs omit SDK regen; maintainers regenerate after merge
  • Docs / .env.example updated if configuration or behavior changed

Note

Medium Risk
Authorization behavior changes across sessions, turns, schedules, and metrics APIs, including removing admin bypass for schedules; mistakes could leak or over-restrict tenant data.

Overview
Read access for sessions, turns, events, internal metrics, schedules, and schedule runs now follows a shared rule: the creator or someone with manage on the session/schedule’s named agent (via canReadAgentBoundResource / resolveManagedAgentIds). Writes stay creator-only—update/delete/cancel sessions, create turns, sandbox downloads, and schedule update/delete/manual run still require ownership.

Listing no longer uses OIDC admin to see every schedule or session. List handlers pass created_by_or_agent_ids (creator OR managed agent ids) into session/schedule stores; Postgres/SQLite gain shared whereCreatedByOrAgentIds. An authorizer all manage scope intentionally returns no extra agent ids so broad grants do not widen related-resource visibility.

Session metrics can aggregate all creators for an agent when the caller manages that agent. OpenAPI/SDK copy for listing schedule runs reflects the new read rule.

Reviewed by Cursor Bugbot for commit 246cf71. Bugbot is set up for automated code reviews on this repo. Configure here.

@changeset-bot

changeset-bot Bot commented Sep 7, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 246cf71

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@truefoundry/trueforge-core Minor
@truefoundry/trueforge Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@chiragjn
chiragjn merged commit a70543b into main Sep 7, 2026
12 checks passed
@chiragjn
chiragjn deleted the authz/managed-session-schedule-reads branch September 7, 2026 02:08
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