pyrit.prompt_target.GandalfTarget#

class GandalfTarget(*, level: GandalfLevel, max_requests_per_minute: int | None = None)[source]#

Bases: PromptTarget

__init__(*, level: GandalfLevel, max_requests_per_minute: int | None = None) None[source]#

Initialize the Gandalf target.

Parameters:
  • level (GandalfLevel) – The Gandalf level to target.

  • max_requests_per_minute (int, Optional) – Number of requests the target can handle per minute before hitting a rate limit. The number of requests sent to the target will be capped at the value provided.

Methods

__init__(*, level[, max_requests_per_minute])

Initialize the Gandalf target.

check_password(password)

Checks if the password is correct.

dispose_db_engine()

Dispose database engine to release database connections and resources.

get_identifier()

send_prompt_async(**kwargs)

Sends a normalized prompt async to the prompt target.

set_model_name(*, model_name)

Set the model name for this target.

Attributes

async check_password(password: str) bool[source]#

Checks if the password is correct.

True means the password is correct, False means it is not

async send_prompt_async(**kwargs)#

Sends a normalized prompt async to the prompt target.

supported_converters: list#