Skip to content

feat(agents): add identity registration and dashboard controls - #43723

Merged
joshua-berri merged 5 commits into
mainfrom
litellm_agent_split_identity_registration
Sep 30, 2026
Merged

joshua-berri merged 5 commits into
mainfrom
litellm_agent_split_identity_registration

Conversation

@joshua-berri

@joshua-berri joshua-berri commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

TLDR

Problem this solves:

  • Administrators need explicit Entra agent identity registration
  • Identity-only edits must preserve existing runtime configuration
  • Cardless agents must remain cardless when edited

How it solves it:

  • Add identity controls to existing agent registration and settings
  • Reuse partial-update handling when PUT omits the card
  • Preserve untouched cards, save deliberate edits, clear recovered errors

Identity history keeps retired or deleted clients owned by their original agent. The owner can reactivate its binding; another agent cannot claim it

User Flow

Before: at merge base 657bb777fa, administrators cannot configure Entra identity through the dashboard

  1. Open http://localhost:3000/agents/ and click Add New Agent
  2. Select Custom / Other and look for Identity Provider
  3. The form offers name and description, with no identity fields

Before: registration lacks identity controls

After: at d6c1a9210b, administrators can register and edit an Entra identity without creating a runtime card

  1. Open http://localhost:3000/agents/ and click Add New Agent
  2. Select Custom / Other, then Microsoft Entra ID under Identity Provider
  3. Choose the trusted tenant; enter client ID, Enterprise Application Object ID, and agent name
  4. Click Next three times, select Use Entra JWT authentication, then Create Agent
  5. Open its ID, then Settings > Edit Settings; change roles or execution and save

After: registration exposes identity controls

The unfixed PR at a4492b9b3c also exposed identity controls, but step 5 synthesized an A2A card. Matching edits on the same agent now leave its display name and runtime card empty

Unfixed PR: identity edit creates a card
Fixed PR: identity edit preserves cardless registration

Relevant issues

Part of the approved split of #43149. The complete stack replaces #43149, #43229, #43230 and #43459; this PR covers registration and dashboard identity controls only

PRs #43720, #43721 and #43722 are merged. This PR targets main, head litellm_agent_split_identity_registration. Open descendants remain ordered: #43724 budgets, #43725 SCIM contracts, #43726 SCIM operations, #43727 SCIM activation, #43728 SCIM dashboard, each targeting its immediate predecessor. A trial replay of #43724 has budget/authorization conflicts, so its remote branch was left unchanged pending its own repair. Descendant verification is separate

Linear ticket

Resolves LIT-8959

Pre-Submission checklist

  • Meaningful regressions for all three confirmed findings
  • Affected backend and dashboard tests pass locally
  • Current-tip CI, completed coverage and independent verification checked
  • Scope isolated to registration and identity editing
  • Current-tip Greptile confidence at least 4/5

Verification

Candidate d6c1a9210b78cba182980edacc349e77f35db317, merge base 657bb777fa557f7089c56fedb42f3056d7b55847. Only this PR's two commits were replayed; the final diff contains 28 files

Local checks: 200 backend tests; 187 dashboard tests across 18 files; production dashboard build; full-source and test-tree Ruff, formatting, strict-rule, test-quality, basedpyright, circular/import checks, API schema generation and lazy snapshot sync. No new or worsened dashboard lint/build warnings

Changed executable-line coverage: Python 142/142 (100%); measured UI statement-start lines 90/93 (96.8%). Touched-function branches: Python 115/140 (82.1%), UI 579/788 (73.5%). These are affected-test measurements, not repository-wide coverage; existing broader branches and three UI handlers remain uncovered. The repaired preservation and recovery paths are covered

The latest follow-up replaces the identity-history lookup with its existing Prisma input type and freezes the filtered return mapping. This removes three LIT002 constructions, bringing the PR back to the merge-base count without changing budgets or adding suppressions. All canonical local lint/type gates and 200 affected backend tests passed; live registration, foreign-claim rejection, and original-owner PATCH/PUT reactivation passed

All 10 required GitHub checks pass at d6c1a9210b, including lint. Greptile is 5/5, Veria reports no security findings, and all four review threads remain resolved. Independent Devin verification passed at this candidate, including 247 backend tests, the type-discipline gate, dashboard flows, real Entra authentication and original-owner reactivation through PATCH and both PUT forms

Completed current-tip Codecov and the uploaded CI XML both cover 142/142 changed Python lines. Local touched-function branch coverage remains 115/140; measured UI changed lines are 90/93 and touched-function branches 579/788. Repository-wide coverage at this snapshot is 81.65% and can change as unrelated uploads finish

Bugbot is unavailable because its on-demand spend limit was reached; the author plans human review. Unrelated non-required failures concern ClickHouse environment-variable documentation, tracing API schema/route allowlists, batch metadata validation, and the previously identified vendor OpenAPI tests. They are unchanged by this PR. Non-required MCP integration and benchmark checks were still running at the last snapshot

The final-candidate screenshots below were refreshed at d6c1a9210b with headless Chromium. Registration, identity-only edits, deliberate card edits and provider recovery all passed against the source proxy

Devin independently reproduced the original defects against the unfixed PR and refreshed final-candidate execution. It verified intentional card edits, full-PUT clearing, normal A2A updates, and retired/deleted identity ownership controls. The final run reused the byte-identical dashboard build from a168eaa98b; its backend source/process was freshly started at d6c1a9210b. Local screenshots use the final checkout. Dashboard registration with a real Entra application produced a working identity: its token received 200 on GET /v1/agents, and persisted authentication time changed from null. The same token received 403 after disabling execution through the dashboard. This verifies discovery authentication, without an LLM call or SQL-seeded registration

Screenshots / Proof of Fix

Shared setup: source proxy http://localhost:4019, dashboard dev server http://localhost:3000, disposable PostgreSQL, STORE_MODEL_IN_DB=True, and configured JWT issuer/audience. Browser execution was headless. UUIDs shown are synthetic registration inputs; no actual Entra authentication is claimed by these local screenshots

Use tenant 11111111-1111-4111-8111-111111111111, an unused client UUID and Enterprise Application Object ID. Final registration/edit captures use client bbbbbbbb-bbbb-4bbb-8bbb-bbbbbbbbbbbb and principal cccccccc-cccc-4ccc-8ccc-cccccccccccc. Historical unfixed captures use client 22222222-2222-4222-8222-222222222222 and principal 33333333-3333-4333-8333-333333333333; fresh fixture IDs avoid the intentional ownership-reuse rejection

Before (657bb77)

Dashboard registration and identity edit

  1. Follow the registration steps in User Flow: the merge-base form has no identity fields, as shown above
  2. For the repair comparison, run unfixed rebased PR a4492b9b3c85cf201d39c0a01435f7b5c9c944e8; register Custom / Other with Entra and no key
  3. Edit only Required Application Roles to Agent.Invoke and Execution to Disabled, then save
  4. PATCH returns 200 but adds an A2A card with url: "", generated skills and version; the screenshot above shows the new display name

Identity-only PUT preservation

  1. POST /v1/agents with an A2A card, litellm_params.model, static_headers and extra_headers
  2. PUT /v1/agents/{id} with only {"agent_name":"<same name>","enabled":false}
  3. Main rejects the missing card with 422; unfixed rebased PR accepts it with 200 but GET returns empty card, parameters and headers

Provider recovery

  1. On the unfixed rebased PR, interrupt one GET /v1/agents/identity/providers while selecting Microsoft Entra ID
  2. Select No explicit identity binding, wait for the fields to disappear, then reselect Microsoft Entra ID
  3. The actual proxy returns 200 and a valid tenant, while the stale error remains

Unfixed PR: recovered tenants with stale error

Intentional card editing

  1. On regression baseline 1cdc43665c130af8fe0f74e3a453c4381e20b5dc, open the same cardless agent's Settings > Edit Settings
  2. Set Display Name to Configured runtime and URL to https://runtime.example/a2a, then save
  3. PATCH returns 200 but discards the explicit card edits

Before: explicit runtime card edit is discarded

After (d6c1a92)

Dashboard registration and identity edit

  1. Follow the same dashboard registration steps; POST returns 200 and the agent has an empty card
  2. Open Settings > Edit Settings, set Required Application Roles to Agent.Invoke and Execution to Disabled
  3. Save: PATCH returns 200, omits the card from its request, and persisted readback retains {}; see the matching User Flow screenshot

Identity-only PUT preservation

  1. POST the same A2A card, runtime model and header settings
  2. PUT /v1/agents/{id} with only the same name and enabled:false
  3. PUT returns 200; GET confirms the card, model, static/extra headers, access groups and kill switch are unchanged

Provider recovery

  1. Interrupt one provider-list GET, then select no binding and reselect Entra as above
  2. The actual retry returns 200; the trusted tenant appears and the error disappears

Fixed PR: recovered tenants without stale error

Intentional card editing

  1. Open the same cardless agent's Settings > Edit Settings
  2. Set Display Name to Configured runtime and URL to https://runtime.example/a2a, then save
  3. PATCH returns 200 and persists the supplied card; the identity-only control still creates no card

After: explicit runtime card edit is saved

Type

New Feature and Bug Fix

Final Attestation

  • Final independent verification and current-tip review gates complete

@greptile-apps

greptile-apps Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

[High risk] Adds identity binding and authentication modes to agent configuration.

The PR appears safe to merge based on the reviewed changes and resolved findings.

Summary

This PR adds Entra agent identity registration and dashboard controls while preserving runtime configuration during identity-only edits.

  • Adds identity validation, ownership-history checks, and administrative status endpoints.
  • Adds dashboard registration, editing, and authentication-evidence views.
  • The latest change types the existing history lookup and freezes its filtered return mapping.

Reviews (4) · Last reviewed commit: "fix: remove mutable agent identity regis..."

Comment thread litellm/types/agents.py
@codecov

codecov Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@joshua-berri
joshua-berri force-pushed the litellm_agent_split_entra_runtime branch from 5b10f6b to 0fd4e93 Compare September 30, 2026 18:49
Base automatically changed from litellm_agent_split_entra_runtime to main September 30, 2026 20:05
@joshua-berri
joshua-berri requested a review from a team September 30, 2026 20:05
@joshua-berri
joshua-berri force-pushed the litellm_agent_split_identity_registration branch from 60915a7 to 1cdc436 Compare September 30, 2026 20:49
@joshua-berri

Copy link
Copy Markdown
Contributor Author

@greptileai @cursor review Please review 1cdc436: configuration preservation, cardless editing, and provider recovery. Local tests and screenshots pass; independent verification is pending.

@codspeed

codspeed Bot commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

✅ 31 untouched benchmarks


Comparing litellm_agent_split_identity_registration (d6c1a92) with main (b41715b)

Open in CodSpeed

@joshua-berri

Copy link
Copy Markdown
Contributor Author

@greptileai Please review a168eaa: deliberate card edits now persist while identity-only edits remain cardless. Regression, live screenshots, build and lint comparison pass.

@joshua-berri

Copy link
Copy Markdown
Contributor Author

@cursor review Please review a168eaa, covering omitted configuration preservation, identity-only cardless edits, deliberate card edits, and provider recovery. Local verification passes.

@cursor

cursor Bot commented Sep 30, 2026

Copy link
Copy Markdown
Contributor

Bugbot is paused — on-demand spend limit reached

Bugbot uses usage-based billing for this team and has hit its on-demand spend limit.

A team admin can raise the spend limit in the Cursor dashboard, or wait for the next billing cycle to continue.

@joshua-berri

Copy link
Copy Markdown
Contributor Author

bugbot run. Please review a168eaa for configuration preservation, intentional card edits, and tenant-provider recovery; local regression and live checks pass.

@cursor

cursor Bot commented Sep 30, 2026

Copy link
Copy Markdown
Contributor

Bugbot is paused — on-demand spend limit reached

Bugbot uses usage-based billing for this team and has hit its on-demand spend limit.

A team admin can raise the spend limit in the Cursor dashboard, or wait for the next billing cycle to continue.

@ryan-crabbe-berri ryan-crabbe-berri left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

lgtm; thanks!

@joshua-berri

Copy link
Copy Markdown
Contributor Author

@greptileai Please review d6c1a92: the focused registry typing change removes the LIT002 increase; canonical local gates and ownership checks pass.

@joshua-berri
joshua-berri merged commit 52b9fa2 into main Sep 30, 2026
97 of 103 checks passed
@joshua-berri
joshua-berri deleted the litellm_agent_split_identity_registration branch September 30, 2026 22:21
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.

3 participants