Skip to content

FEAT: Save converter copies (part 18) - #4069

Open
varunj-msft wants to merge 212 commits into
microsoft:mainfrom
varunj-msft:varunj-msft/13178-Save-Converter-Copies
Open

varunj-msft wants to merge 212 commits into
microsoft:mainfrom
varunj-msft:varunj-msft/13178-Save-Converter-Copies

Conversation

@varunj-msft

@varunj-msft varunj-msft commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

Description

Part 18 of saving Registry entries across restarts. A side branch stacked on part 13 (#4052), with part 17 (#3984) merged in as the first commit; nothing builds on it. This PR's own changes: varunj-msft/PyRIT@c1f28b9...varunj-msft/13178-Save-Converter-Copies

Design: 4.7 Editing and deleting, 4.5 Entries that use other entries. Where every part fits: PR map.

This is one of the changes for saving Registry entries across restarts. It needs #3984, which keeps a copy's endpoint and credentials the same as its source's. Until the earlier PRs merge, the diff here also shows their changes.

Save to registry on a converter's changed settings, in chat or in a technique edit, made a Temporary copy that was gone after a restart. Copies can now be saved, and a saved copy is rebuilt from the converter it copies at every start.

  • A converter created with source and "persist": true is saved as a recipe that names the converter it copies and holds only the changed settings. At every start it's rebuilt from that converter as it is then, after it, so it keeps where that converter sends requests and how it signs in.
  • Only the changes are checked: they can't hold a credential or name a Temporary entry (typed 400). A reference the changes clear is saved as the entry its default names, as for a new converter, so a Temporary default is refused too. A copy of a Temporary converter can't be saved, since that converter is gone after a restart. A copy can't change its source's connection settings at all, saved or not, and that refusal now comes before the credential and Temporary-entry checks on the changes.
  • Restore checks a copy's saved changes the same way, waits for the converter it copies, and keeps who saved it. A copy whose converter is gone, or is now a different class, fails to restore and says why.
  • The Save to registry dialog saves by default, follows the saved-name rule, and offers Create as Temporary with the reason when the copy can't be saved. A taken name shows on the name field.
  • The backend README and the GUI doc cover saved copies.

What stays the same: a copy made with Create as Temporary is Temporary, as before, and a copy still can't change its source's connection settings (#3984). Target copies are unchanged.

Screenshots: Save to registry for a copy of a saved converter, the saved copy in the Converters table, and a copy of a Temporary converter offered as Temporary with the reason.
copies_1_save_copy_dialog
copies_2_saved_copy_row
copies_3_copy_of_temporary_offers_temporary

Not covered:

…API input

External construction now rejects a parameter whose type includes Path unless the
calling service passes the name in allowed_path_params after making the value safe.
The converter service allows its upload parameters once they are stored, and the
target service allows the server-set upload folder and the GitHubCopilotTarget
working directory. The scorer-only check is removed, and the "Valid parameters"
list leaves out path parameters callers cannot set.
The target catalog now applies the path rule to required parameters too, so a
target that needs a disallowed path is left out instead of listed without the
field, matching the scorer catalog. allowed_path_params is typed frozenset[str]
so a bare string cannot turn the allow-list into a substring match.
The target catalog still lists a target whose required path parameter is its
server-set upload folder when the server has one, and leaves it out otherwise.
# Conflicts:
#	tests/unit/backend/test_converter_service.py
A launch script that registers a name held for a saved entry that
couldn't be restored is refused, and the refusal is recorded even when
the script catches it, so the launch stops instead of running with the
script's entry in the saved one's place. A suite entry that fails on a
held entry, or on a broad technique selection, shows the reason without
the error's details.
The OpenAI SDK adds that variable's headers to every request, so a saved
OpenAI target would send whatever the server puts there, which can be a
credential. While it's set, saving an OpenAI target is refused and a
saved one isn't restored; the message names the variable, never its
value. Targets declare such variables in server_header_variables.
Saving converters and scorers follows the same rules as saving targets now: a type that only a scan's launch script added can't be saved, a class without cached metadata is checked the way restore checks it, only a taken name is reported as a conflict, a storage failure logs its short reason, and the owner is recorded only when the entry is saved.
A saved converter copy follows the same rules now: a taken name is a conflict, and a class without cached metadata is checked the way restore checks it. Restore refuses a server file in a copy's changes as it does for any saved entry.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants