Repository navigation
docs: document how AI Gateway assigns a request's organization - #31925
Conversation
Add a Request organization page that explains how AI Gateway picks the organization for each request (workspace session token, then Coder Agents chat, then the effective group fallback), which requests are rejected, and how the organization drives budgets, overrides and spend. Update cost control, standalone gateway and Coder Agents spend pages that described budget resolution as deployment-wide. Refs AIGOV-753
…t-org-resolution # Conflicts: # docs/manifest/ai-governance/ai-gateway.yml
Docs previewLinks open this pull request's preview at https://pr-31925.docs.cdr-preview.dev, which updates with each push. Check off each page once it's been reviewed. If a page changes in a later push, its checkbox clears automatically so it gets a fresh look. Pages not yet wired into the docs navigation aren't listed here.
Preview sites for each built commit (1)Every built commit keeps its own preview, newest first. Previews aren't indexed by search engines and are deleted when this pull request is merged or closed. |
nickvigilante
left a comment
There was a problem hiding this comment.
A mix of my feedback and Coder Agents's feedback. Overall, the docs read well, and I only have a few nits.
|
|
||
| ### Model prices | ||
|
|
||
| The request's organization doesn't change the price, because the custom prices that you set with [`coder exp ai-model-prices`](./cost-controls.md#configure-model-prices) apply in every organization. |
There was a problem hiding this comment.
Optional: this statement depends on a current limitation (no API or CLI can set per-org prices yet, per the PR description) and will go stale when per-org prices ship. Consider linking the tracking ticket in the PR or a follow-up issue so the page gets updated with that change.
🤖 Review generated with Coder Agents on behalf of @nickvigilante.
- Keep the list of site-wide reports only on the request organization page. - Say the spend export aggregates spend and does not list requests. - Say where coderd rejects requests for older standalone replicas. - Apply suggested wording for the earlier-than-v2.40 section.
Documents how AI Gateway assigns every request to one organization, and how that organization now decides the effective group, budget, overrides, and spend. Adds a Request organization page and corrects pages that still described budget resolution as deployment-wide.
Refs AIGOV-753. Describes behavior merged in #30902, #31118, #31119, #31120, #31121, #31583, and #31584.
Changes
docs/ai-governance/ai-gateway/request-organization.md(sidebar, after Cost control): resolution order, the effective group fallback, rejected requests, what the organization controls, a multi-org worked example, reports that still resolve across all orgs, and the caveat for standalone gateways older than v2.40.cost-controls.md: removes "the effective group is deployment-wide", scopes overrides and effective group resolution to the request's organization, and adds the reporting caveat.standalone.md: older replicas check budgets across all organizations.coder-agents/platform-controls/{index,spend-management}.md: these said an override beats every group budget, which is no longer true for chats in another organization.For reviewers
coderd/exp_chats.go), chatd requests resolve to the chat's org even with a workspace, and no client request can carry both inputs. The page says the two always agree instead.release/2.39is on aibridged API v1.5 andmainis on v1.6, so v1.6 ships in v2.40. A 2.39.x backport would make this wrong.GET /api/v2/users/{user}/ai/spend, Members tab budget, Groups page combined limit, andblocked_usersmetric still resolve across all orgs (TODO(AIGOV-527)), so they can disagree with what was enforced.Release note draft
Validation
make pre-commit-light, Vale on the changed files, andmake lint/docs-manifestpass. Adoc-checkauthor self-check found 13 blocking findings, all fixed. Not applied: a suggested test pinning the site-wide spend endpoint (code change, out of scope for this docs PR).Decision log and verified behavior
Sources: AIGOV-753, epic AIGOV-749 and its delivered tickets (AIGOV-712 to 716), the canceled AIGOV-717, and the RFC "AI Gateway Model RBAC and Org-Scoping" (Phase 1).
Verified against
main(a3aab79775):coderd/aibridgedserver/orgresolver.goresolveOrganizationcoder_workspace_owner.session_tokenprovisionerdserver.WorkspaceSessionTokenName,workspaceAttribution(API tokens excluded)403 unauthorizedcoderd/aibridged/http.goIsAuthorized failure pathorgresolver.goErrUnknownWorkspace,ErrUnknownOrganizationMember,ErrNoOrganizationenterprise/aibridged_integration_test.go"delegated organization with workspace"coderd/aibridge/budget/budget.go, #31119GetUserEveryoneFallbackGroupGetUserAISpendSincekeyed oneffective_group_idcoderd/aibridgedserver/notifications.goUpsertOrganizationAIProviderModelConfighas no non-test callerrelease/2.39coderd/aibridged/http.go,aibridge/recorder/drpc_recorder.goPage vs. section: a dedicated explanation page, because
cost-controls.mdis already long and RFC Phases 3 and 4 (model RBAC, "require organization scope") will build on the same resolution rules.This PR was generated by Coder Agents on behalf of @SasSwart.