-
Notifications
You must be signed in to change notification settings - Fork 801
FEAT Plug-in mechanism for private scenarios #2131
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 6 commits
9f409ab
c7a7528
e7d63cf
eca5928
0b11b6c
8781038
e6159e5
f8e761d
ed3fc0d
fb822e0
95de68c
c108578
b551008
c028f8b
67f8a85
067ffba
2ae6c55
b21f856
21ebf36
466679a
88bd76a
b177f49
1538e6e
bbd3da8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -250,6 +250,36 @@ AZURE_OPENAI_VIDEO_MODEL="sora-2" | |
| AZURE_OPENAI_VIDEO_UNDERLYING_MODEL="sora-2" | ||
|
|
||
| OPENAI_VIDEO_ENDPOINT = ${AZURE_OPENAI_VIDEO_ENDPOINT} | ||
|
|
||
| ################################## | ||
| # PLUG-INS | ||
| # | ||
| # PyRIT can load a non-disclosable plug-in (extra datasets + scenarios) from a | ||
| # pre-built wheel at initialization time. Plug-in loading runs automatically as a | ||
| # guaranteed-first phase inside initialize_pyrit_async (before the configured | ||
| # initializers) — there is nothing to add to .pyrit_conf. The wheel is extracted to | ||
| # .plugin/<name>/, prepended to sys.path, imported, and its bootstrap is run so its | ||
| # datasets/scenarios register like built-ins. Extraction only — never pip/.venv. | ||
| # | ||
| # WARNING: loading a plug-in executes third-party code in the PyRIT process. | ||
| # Whoever can set PLUGIN_* / write this .env can run code on the host. Treat this | ||
| # file as sensitive. | ||
| ################################### | ||
|
|
||
| # Path to a pre-built plug-in wheel on disk. Setting it enables plug-in loading; | ||
| # leaving it unset is a no-op. | ||
| # PLUGIN_WHEEL="/abs/path/to/my_plugin-0.0.0-py3-none-any.whl" | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does that mean we support only one plugin? If so, I think it's a design limitation that might bite us later.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. To answer your first question, yes, but not as an explicit constraint. I see two solutions to plug-in composition: we can just load multiple plug-ins and place the burden of compatibility on the user, or we can add a layer of abstraction, so that plug-in components can be collected, compared, and initialized in a certain order. I lean towards the second long-term, but in either case I don't think we should support only one plugin on purpose. |
||
|
|
||
| # Optional: the wheel's top-level import package. Auto-detected from the wheel | ||
| # when omitted; set this to disambiguate multi-package wheels. | ||
| # PLUGIN_PACKAGE="my_plugin" | ||
|
|
||
| # Optional: continue (with a warning) instead of failing when the plug-in cannot | ||
| # be loaded. Equivalent to initialize_pyrit_async(plugin_fail_open=True). | ||
| # PLUGIN_FAIL_OPEN="false" | ||
|
|
||
| # Optional: override the base extraction directory (defaults to <pyrit home>/.plugin). | ||
| # PLUGIN_DIR="/abs/path/to/.plugin" | ||
| OPENAI_VIDEO_KEY = ${AZURE_OPENAI_VIDEO_KEY} | ||
| OPENAI_VIDEO_MODEL = ${AZURE_OPENAI_VIDEO_MODEL} | ||
| OPENAI_VIDEO_UNDERLYING_MODEL = "" | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| # Keeps the .plugin/ directory in version control while its contents stay ignored. | ||
| # PyRIT extracts plug-in wheels here at runtime (see PLUGIN_WHEEL). |
Uh oh!
There was an error while loading. Please reload this page.