Skip to content

[AuthZ: 2/N] Add external agent authorizer - #585

Merged
chiragjn merged 6 commits into
mainfrom
cj/add-external-authorizer
Sep 4, 2026
Merged

chiragjn merged 6 commits into
mainfrom
cj/add-external-authorizer

Conversation

@chiragjn

@chiragjn chiragjn commented Sep 4, 2026 •

Copy link
Copy Markdown
Member

Note

Medium Risk
Adds authorization plumbing and a new ServiceFoundry permissions dependency; behavior is not yet enforced on routes, but mistakes in permission mapping will affect agent access once hooked up.

Overview
Introduces an Authorizer dependency on the server for agent read vs manage decisions, selected at startup by deployment mode.

TrueForgeAuthorizer (standalone/OIDC) treats list as unrestricted and allows manage only when the caller is the agent creator. TrueFoundryAuthorizer calls ServiceFoundry GET v1/authorize/permissions (via new getAgentPermissions on TrueFoundryServiceFoundryServerClient) to resolve allowed agent external IDs or per-agent grants (READ_AGENT / MANAGE_AGENT), requiring a bearer token on those checks.

main.ts shares one ServiceFoundry client for auth + authorizer in TrueFoundry mode; write-openapi.ts supplies a stand-in authorizer when building the OpenAPI app. The authorizer is on ServerDeps but is not yet wired into agent HTTP handlers in this diff (AuthZ 2/N).

Reviewed by Cursor Bugbot for commit 6277550. 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

⚠️ No Changeset found

Latest commit: 6277550

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@chiragjn
chiragjn force-pushed the cj/remove-truefoundry-global-admin branch from d652eb9 to 92e4ed3 Compare September 4, 2026 07:10
Base automatically changed from cj/remove-truefoundry-global-admin to main September 4, 2026 07:41
@chiragjn
chiragjn force-pushed the cj/add-external-authorizer branch from 95e23a9 to 5c9e9f4 Compare September 4, 2026 07:42

@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 1 potential issue.

There are 2 total unresolved issues (including 1 from previous review).

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 466aeeb. Configure here.

@chiragjn
chiragjn force-pushed the cj/add-external-authorizer branch from 68aa805 to 6277550 Compare September 4, 2026 09:15
@chiragjn
chiragjn enabled auto-merge (squash) September 4, 2026 09:15
@chiragjn
chiragjn merged commit 1672aed into main Sep 4, 2026
9 checks passed
@chiragjn
chiragjn deleted the cj/add-external-authorizer branch September 4, 2026 09:20
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