Red Teaming API
api_delete_attack_module(am_id)
Deletes an attack module by its identifier.
This function takes an attack module ID as input and calls the delete method from the AttackModule class to remove the specified attack module from storage.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
am_id |
str
|
The unique identifier of the attack module to be deleted. |
required |
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if the attack module was successfully deleted. |
Raises:
Type | Description |
---|---|
Exception
|
If the deletion process encounters an error. |
Source code in moonshot/src/api/api_red_teaming.py
api_get_all_attack_module_metadata()
Retrieves metadata for all available attack modules.
This function calls the get_available_items
method from the AttackModule
class to retrieve all available
attack modules metadata.
It then extracts the metadata for each attack module and returns a list of dictionaries, each containing the metadata of an attack module.
Returns:
Type | Description |
---|---|
list[dict]
|
list[dict]: A list of dictionaries, each representing the metadata of an attack module. |
Source code in moonshot/src/api/api_red_teaming.py
api_get_all_attack_modules()
Retrieves all available attack module IDs.
This function calls the get_available_items
method from the AttackModule
class to retrieve all available
attack modules.
It then extracts the IDs of each attack module and returns a list of these IDs.
Returns:
Type | Description |
---|---|
list[str]
|
list[str]: A list of strings, each representing an attack module ID. |