Skip to content

[AuthZ: 3/N] enforce external authorizer on agent access - #586

Merged
chiragjn merged 8 commits into
mainfrom
cj/use-external-authorizer
Sep 4, 2026
Merged

[AuthZ: 3/N] enforce external authorizer on agent access#586
chiragjn merged 8 commits into
mainfrom
cj/use-external-authorizer

Conversation

@chiragjn

@chiragjn chiragjn commented Sep 4, 2026

Copy link
Copy Markdown
Member

Note

High Risk
Authorization behavior changes across agents, sessions, schedules, and turns—including 404 vs idempotent delete and schedule status codes—which can break clients and leak less information to unauthorized callers in TrueFoundry mode.

Overview
Enforces the process Authorizer on agent reads and management across list/get/snippets/update/delete, named-agent session creation, schedule create/run-now, and turn creation when the session references a stored agent. New agentAccess helpers filter or hide agents the caller cannot access, returning 404 for both missing and forbidden agents.

API contract tweaks: agent delete is no longer documented as idempotent (repeat delete → 404); schedule create returns 404 (not 400) when the named agent is missing or inaccessible; turn/create paths distinguish missing agent (422) vs unauthorized (404).

TrueFoundry / config: renames TrueForgeModeTrueForgeAuthMode; limits TrueFoundry ServiceFoundry integration to non-standalone distributed config; per-request model/MCP/agent stores now require a request Context (schedule manual runs resolve turn deps from the HTTP context for caller tokens). OpenAPI, Fern YAML quote style, SDK clients, and wire tests updated for new 404 responses.

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

@changeset-bot

changeset-bot Bot commented Sep 4, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 509b177

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

This PR includes changesets to release 1 package
Name Type
@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 force-pushed the cj/use-external-authorizer branch from e8b7088 to 85f62c3 Compare September 4, 2026 04:24
@chiragjn
chiragjn force-pushed the cj/add-external-authorizer branch 2 times, most recently from 68aa805 to 6277550 Compare September 4, 2026 09:15
Base automatically changed from cj/add-external-authorizer to main September 4, 2026 09:20
@chiragjn
chiragjn force-pushed the cj/use-external-authorizer branch from 372e8b3 to ee7dd0f Compare September 4, 2026 09:30
Comment thread packages/trueforge/src/truefoundry/TrueFoundryModelProviderStore.ts Outdated
@chiragjn
chiragjn force-pushed the cj/use-external-authorizer branch from bac8fd0 to fea0c5f Compare September 4, 2026 14:32
Comment thread packages/trueforge/src/apis/schedules.ts
chiragjn and others added 6 commits September 4, 2026 22:07
Gate agent list/get/manage and named-agent session, schedule, and turn use through ExternalAuthorizer so TrueFoundry revocation is not bypassed by created_by.

Co-authored-by: Cursor <cursoragent@cursor.com>
@chiragjn
chiragjn force-pushed the cj/use-external-authorizer branch from d58e898 to 209650e Compare September 4, 2026 16:37

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 209650e. Configure here.

Comment thread packages/trueforge/src/apis/agents.ts
Comment thread packages/trueforge/src/apis/schedules.ts
@chiragjn
chiragjn merged commit 4b1aa55 into main Sep 4, 2026
11 checks passed
@chiragjn
chiragjn deleted the cj/use-external-authorizer branch September 4, 2026 19:19
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.

2 participants