feat: scope middleman inference to workload permissions - #1965
Draft
rasmusfaber wants to merge 24 commits into
Draft
rasmusfaber wants to merge 24 commits into
rasmusfaber wants to merge 24 commits into
Conversation
5 tasks done
rasmusfaber
force-pushed
the
feat/sec-374-middleman-enforcement
branch
2 times, most recently
from
October 1, 2026 09:35
f4e7cf6 to
adbb1a0
Compare
4 of 5 tasks
rasmusfaber
force-pushed
the
feat/sec-374-credential-authority
branch
from
October 1, 2026 10:52
cc0f241 to
d34b0d5
Compare
rasmusfaber
force-pushed
the
feat/sec-374-middleman-enforcement
branch
2 times, most recently
from
October 2, 2026 17:43
b2598f3 to
e64b48a
Compare
rasmusfaber
force-pushed
the
feat/sec-374-credential-authority
branch
from
October 2, 2026 17:43
d34b0d5 to
d25022e
Compare
rasmusfaber
force-pushed
the
feat/sec-374-middleman-enforcement
branch
from
October 2, 2026 18:57
e64b48a to
3bc8a79
Compare
rasmusfaber
force-pushed
the
feat/sec-374-middleman-enforcement
branch
from
October 2, 2026 19:07
3bc8a79 to
4771412
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
Workload inference must respect exact model approvals while charging usage and fair sharing to the submitting person. This adds workload authentication and model enforcement to Middleman, stacked on #1896.
Approach
Compare signed approvals with the exact registry entry dispatched, including opaque secret-model bindings. Read the shared issuer/audience/JWKS settings directly and validate the same string audience as the broker. Keep JWKS fetching and human issuer separation; invalid workload tokens never fall back to human authentication.
Authentication and traffic logs retain execution identity separately from accounting fields. Usage metrics and both priority paths require signed person/team attribution, so direct requests and executions share the person’s allocation. Dashboard queries retain legacy-log fallback and distinguish unknown from verified empty teams. New workload tokens reject missing/null attribution or teams; explicit empty teams remain valid. Preserve human email logging and metrics.
Risks
Testing & validation
All 2,087 Middleman tests and 180 affected Hawk tests passed. Coverage retains every provider route, real accounting/priority dispatch and malformed-attribution rejection. Full Hawk/Middleman types, Ruff/format, applicable hooks and independent spec/quality review passed. No deployment performed; live Logs Insights validation remains deployment acceptance.
Code quality
pre-commit run --all-filespasses (ruff, basedpyright/mypy, eslint/prettier/tsc, shellcheck — what CI's Lint job runs)Before merging