Repository navigation
Conversation
Contributor
Author
|
Picked tnsardesai to review these related PRs (#36, kernel/kernel#5359, kernel/hypeman#550, kernel/infra#2088, kernel/kernel-images-private#584): touched the changed code in |
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.
Summary
The reusable PR risk workflow no longer needs
ANTHROPIC_API_KEYorOPENAI_API_KEY. The classify job exchanges its GitHub OIDC token for short-lived provider credentials through workload identity federation, so no long-lived model key is stored in or passed between repos.kernel/security-workflows/.github/actions/llm-credentials. It takesmodel(provider/id) and the six federation IDs. It fetches credentials once, then refreshes them every minute in the background for the rest of the job. GitHub OIDC tokens last about five minutes, and each provider credential expires no later than the token it was exchanged for.ANTHROPIC_FEDERATION_RULE_ID,ANTHROPIC_ORGANIZATION_ID,ANTHROPIC_SERVICE_ACCOUNT_IDandANTHROPIC_IDENTITY_TOKEN_FILEto later steps. The Anthropic SDK inside pi does the exchange itself and rereads the file before each refresh.auth.openai.com/oauth/tokenand writes the access token to pi'sauth.json, which pi rereads whenever the file changes.pr-risk.yml:id-token: write.test_llm_credentials.pyruns in PR Risk Tests.Notes for review
varsitself. GitHub rejects${{ vars.* }}in action metadata (Unrecognized named-value: 'vars'), so callers pass the six IDs as inputs. Callers of pr-risk pass nothing;pr-risk.ymlpasses them once. I didn't hardcode the IDs because this repo is public, and they would then live in two places.@main.uses:can't take an expression, so the action doesn't follow thesecurity-workflows-refinput. The classifier script and prompt still do. Within this PR that's fine, because the action and the change topr-risk.ymlmerge together.Merge order
A reusable workflow job can't request more permissions than its caller grants. If this merges first, pr-risk fails to start in every caller. Each caller needs
id-token: writefirst:Callers can keep passing the old secrets until they're cleaned up.
Testing
unittestfortest_pr_risk.py(18) andtest_llm_credentials.py(7) pass. The new tests run the action's own shell code against a fake credential script. shellcheck and actionlint are clean.openai/gpt-6-lunaandanthropic/claude-haiku-5-5answered after the original credentials had expired. The credential files had been rewritten about six minutes after start, and the Anthropic settings reached the later step.Reviewed with sol-loop: 2 rounds with openai-codex/gpt-6.1-sol on extra-high reasoning. Round 1, before the action, was approved. Round 2 found one issue in the README example: the pi step didn't set
PI_PREFERRED_MODEL. I fixed it with a README-only change, which wasn't re-reviewed.