Repository navigation
feat(agents): integrate Entra identity registration and authorization - #43149
joshua-berri wants to merge 8 commits into
Conversation
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
|
@greptileai @veria-ai @cursor review Please review bbf7e15 for Entra identity isolation, SCIM lifecycle, permission intersections, budgets, and compatibility after CI repairs |
|
|
@greptileai @veria-ai Please review c5d3ad3: three confirmed findings repaired, regressions passing, and the cardinality finding withdrawn after checking Microsoft documentation |
PR overviewThis pull request integrates Microsoft Entra identity registration and authorization for agents, including delegated team permissions and JWT-based agent authentication. Six issues have been addressed, but two authorization and budget-enforcement gaps remain. A multi-team user may bypass the granting team’s model and budget restrictions, while holders of keyless agent credentials can generate paid inference without a spend ceiling. These issues should be resolved before production use of autonomous agent identities. Open issues (2)
Fixed/addressed: 6 · PR risk: 7/10 |
|
@greptileai @veria-ai Please review f254d22, including current main, repaired database-free JWT authentication, and fail-closed invocation for binding-only config targets |
|
@greptileai Please review 00429f6: managed identities now use explicit inference, MCP, A2A and discovery routes; provider-resource endpoints are denied |
|
@veria-ai Please verify 00429f6 closes provider-resource access for managed Entra tokens and persisted agent keys; regression tests cover both paths |
|
@greptileai Please review 28e187f: configured model defaults now undergo managed-agent authorization and budget reservation. Previously withdrawn findings remain documented limitations. |
|
@veria-ai Please verify 28e187f closes the configured-default model bypass. Four live requests reproduced it; 35 additional authorization and reservation regressions pass. |
| human: Final = await MCPRequestHandler.reload_admitted_user(user_id, requires_fresh_policy=True) | ||
| sources: Final = await MCPRequestHandler.admitted_subject_sources(human) | ||
| human_access: Final = await asyncio.gather(*(_strict_agent_access(source) for source in sources)) | ||
| return frozenset().union(*(_granted_ids(access) for access in human_access)) |
There was a problem hiding this comment.
Medium: Preserve the team that grants delegated access
This union discards which team authorized the agent. A multi-team user with an unrestricted direct model list can use a grant from a model-restricted team to invoke any model allowed by the agent, because JWT authorization does not attach a team for multi-team users and therefore skips that team's model and budget enforcement. Return source-aware grants and carry a qualifying team into the request authorization context.
|
@greptileai @veria-ai Please review current tip 1b0162b. The stack now has four PRs; delegated-team authorization is isolated in #43459. Focused remote verification runs alongside CI. Please check prior findings and current diff |
|
@greptileai @veria-ai Please review the current tip. The optional team-selector cleanup is absent from all four merge-base diffs; those six UI files match the original main merge-base, so incomplete group discovery is pre-existing and deferred. Identity now retains authoritative target rate policy; budgets bind explicit A2A billing to the path; PR4 preserves grant-team authority and consumes JWT verification once. Focused tests/live checks run in parallel with CI |
|
@greptileai @veria-ai Please review the current tip and confirm resolution of the focused findings. Actor/target token settlement now reuses recorded reservation scopes; delegated tests use module-boundary isolation. No unrelated features or selector cleanup were added. Fresh verification runs in parallel with CI |
|
@greptileai @veria-ai Current tip 485bc29 applies the exact Ruff formatting correction only; behavioral patches are unchanged. Focused delegated tests168pass, rate settlement2pass, and actual Entra before/after confirm grant-team model, route and budget denial. Please confirm current-tip review outcomes; remaining live controls and CI are pending |
| if isinstance(evidence, AgentIdentityFailure): | ||
| raise_identity_failure(evidence) | ||
| if managed.mode == "autonomous": | ||
| return JWTAuthBuilderResult( |
There was a problem hiding this comment.
Medium: Keyless agents bypass spend limits
This principal has no key, user, team, organization, or end-user budget, and agents expose spend tracking but no maximum budget. Consequently, _get_budget_counters() returns no counters and reserve_budget_for_request() exits before enforcing the new fail-closed setting, allowing anyone holding this agent credential to generate paid inference without a spend ceiling. Require a budget-bearing principal for autonomous identities or add an agent maximum-budget counter to reservation and enforcement.
|
@greptileai @veria-ai Please review 080de40: type-only rate fix verified. Agent budgets and delegated authorization remain in dependent #43229 and #43459. |
TLDR
Problem this solves:
How it solves it:
Base of the four-PR stack; followed by #43229, #43230 and #43459. Reconciles existing implementation and review fixes; no additional feature scope
Diff sizes are being refreshed after the reviewed repairs
User Flow
Before: the complete workflow below is unavailable at this PR's parent
After: this PR provides the workflow through the existing gateway surfaces
Relevant issues
Original complete implementation: #43149
Affected release
Linear ticket
Pre-Submission checklist
Screenshots / Proof of Fix
The existing Entra application, agent-user, delegated user, MCP authorization and attribution flows were exercised on the combined stack in Devin. Latest repairs add actor-and-target rate accounting; two focused cases pass, including settlement to actual usage. Applying the same regression to the earlier implementation exposes the missing target charge and actor reconciliation
The current repair removes a loop-local Final declaration rejected by basedpyright without changing the policy expression. Two rate regressions pass and the specific type diagnostic is gone. The restored selector UI passes 611 tests with two expected failures, unchanged type diagnostics and fewer lint warnings than the baseline. The production build and final hosted CI remain pending
Previous-tip Greptile scored 5/5. Veria's agent budget and delegated-team concerns are implemented in dependent #43229 and #43459; this prerequisite alone is not the complete feature
Type
New Feature
Caveats
Final Attestation