Repository navigation
FIX: Refuse saved converters and scorers that would use this server's credentials (part 11) - #4050
Open
varunj-msft wants to merge 309 commits into
Conversation
The banner tied a retry to its failure only through the failed state, so a retry from an earlier failure could still show its answer when the polls missed the runtime becoming ready in between. The generation changes only when the runtime becomes ready or the backend restarts, so a new one now starts a new failure too.
A long failure list made the banner taller than a phone screen, and the app doesn't scroll, so Retry could end up out of reach. The list now scrolls on its own within a third of the screen, and can be scrolled from the keyboard. When the list can't be loaded, the banner says so, keeps the last list it had, and keeps trying.
Scripts a scan runs at launch register their targets, converters and scorers with replace, so one that used a saved entry's name silently replaced it for everyone, and scripts that skip names already taken (the technique and tools scripts, round-robin grouping, the scorer script's preferred scorers) left the scan with the saved entry instead of their own. Restore now marks the entries it rebuilds, the registries and those scripts refuse to replace or stand in for a marked entry, and the launch stops with a 409 naming the script and the entry, even when the script caught the refusal itself. A suite shows the same message for that entry.
A launch script that caught the refusal and raised its own error skipped the recorded-refusal check, so the launch failed with that error instead of the 409 naming the saved entry. The clash is now reported on any error once a refusal was recorded; other errors pass through as before.
…navailable storage
The runtime status keeps its short summary. The restore log now also lists each field's full location and message, escaped, without the stored values, and with URL credentials removed. Credentials are removed before a location is shortened, so the summary can't keep part of one either.
# Conflicts: # pyrit/registry/registry_recipe_storage.py
Its text can carry a SAS URL. The 503 handler no longer logs it as a debug traceback, and the scenario suite service no longer attaches it to its warning; both log the storage message, which has no credentials.
# Conflicts: # frontend/src/components/Config/CreateTargetDialog.tsx
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.
Description
This is one of the changes for saving Registry entries across restarts. It builds on #4028. Until the earlier PRs merge, the diff here also shows their changes.
A saved converter or scorer is rebuilt at every start and shared by everyone using the app, so restore should refuse one that would sign in with this server's own credentials, as it already does for targets (#4025).
AzureContentFilterScorerread this server's key when theirs is empty, or else sign in with its Azure identity, and no value turns that off. They now list that key inserver_fallback_parameters(azure_speech_key,api_key), so the shared saved-entry check refuses them, as it does for targets.AudioTrueFalseScorerandAudioFloatScaleScorertranscribe with this server's Speech settings.LocalRefusalClassifierScorerloads its model from a folder on this server, or downloads it with this server's Hugging Face sign-in. These get anot_saveable_reason, likeWebSocketCopilotTargetandHuggingFaceChatTargetin FIX: Refuse saved targets that would authenticate with a key (part 7) #4025.server_fallback_parametersis now on theConverterandScorerbases, andnot_saveable_reasononScorer, as onPromptTarget.api_keyin the saved-entry check, ascheck_saveable_classalready assumed. A recipe can no longer pass by naming an auth mode its class doesn't take.pyrit_conf.mdlists the converters and scorers that can't be saved yet.Converters and scorers made without saving, and the ones the startup scripts register, aren't checked.
RobloxPiiScorerandLocalViolenceClassifierScorercan still be saved: their models are fixed public ones and nothing a caller sets.Not covered: saving converters and scorers through the API, which is #4051 (part 12). Picking a server credential, or keeping typed keys in a key vault, would let the Speech converters and the Content Safety and audio scorers be saved later.