Implements first version of modular capability system#15
Implements first version of modular capability system#15andreashappe merged 1 commit intoipa-lab:mainfrom
Conversation
|
Thank you for your submission, a couple of questions: On high-level: in its current form this looks less like a When going through the capabilities, I like the overall And during the conversion, we seemed to have dropped the windows support (on a first glance). So on a first glance, I'd suggest to:
|
Using the new @use_case and @configurable system, it is now possible to add further use-cases to the wintermute project, while having them automatically inject all required configurations. It also formalizes some parts of the code, such as LLM capabilities, which are now specifically created. This is still a point where some functionality is missing though, as the capabilities are not yet properly passed to function calling LLMs, which should be done in a future release. Proper care was taken, to not change the semantics of the resulting use-cases (such as local_privesc_linux) other than that the configuration now works differently. If there are regressions then this is not on purpose and should be reported. This commit also contains various code-cleanup operations, which happened through the re-work for the new system. However, especially helper methods, and the contents of the privesc use-case have largely stayed unchanged, other than adapting them to the new surrounding infrastructure.
|
The requested changes were implemented, and I have squashed them to a single, properly documented commit. |
andreashappe
left a comment
There was a problem hiding this comment.
I am not 100% happy but it's good enough (and better than the code before) to be used as base for further improvements
This adds a first implementation of a modular capability system as well as the corresponding dependency injection / parameter resolution.
This means, that if you define an
@experimentclass (and it is included somewhere from themain.pyscript), all parameters of its__init__method will try to be filled from parameters (either command line arguments, the.envfile, environment variables or python function default values), including recursively building parameters that expose a__parameters__field (such as created by the@capabilityannotation on a class).As example, the exisiting wintermute.py script has been re-implemented, and can now be executed with the experiment names
linux_privesc_gpt35turbo,linux_privesc_gpt4andlinux_privesc_gpt4turbo(which use different versions of the GPT API respectively, as can be seen by their names) from main.py.To know which parameters to include, you can call it as eg
python3 main.py linux_privesc_gpt4turbo -hand get the following list of parameters:While the help output probably needs to be improved (not all of these parameters are mandatory, and some are not even sensible to change without knowing what you are doing), they show you all that you can configure in this experiment.
This has been automatically generated from the following dependencies / options (
@dataclasshas been used here to automatically have all fields in a__init__function and have them properly assigned):Comparing this you can also see, how the parameter names were built. All that start with eg
llm.are parameters of the GPT35Turbo capability.If you now for example set the
ssh.passwordandssh.usernamein the environment variables, and thellm.api_keyandlog_db.connection_stringin your.envfile, you can execute the command usingThis PR currently contains quite a bit of duplicated code, which has been left on purpose to ease the comparison between old and new version, and to allow better regression testing.