pyrit.memory.SeedPromptEntry#

class SeedPromptEntry(*, entry)[source]#

Bases: Base

Represents the raw prompt or prompt template data as found in open datasets.

Note: This is different from the PromptMemoryEntry which is the processed prompt data. SeedPrompt merely reflects basic prompts before plugging into attacks, running through models with corresponding attack strategies, and applying converters. PromptMemoryEntry captures the processed prompt data before and after the above steps.

Parameters:
  • __tablename__ (str) – The name of the database table.

  • __table_args__ (dict) – Additional arguments for the database table.

  • id (Uuid) – The unique identifier for the memory entry.

  • value (str) – The value of the seed prompt.

  • value_sha256 (str) – The SHA256 hash of the value of the seed prompt data.

  • data_type (PromptDataType) – The data type of the seed prompt.

  • dataset_name (str) – The name of the dataset the seed prompt belongs to.

  • harm_categories (List[str]) – The harm categories associated with the seed prompt.

  • description (str) – The description of the seed prompt.

  • authors (List[str]) – The authors of the seed prompt.

  • groups (List[str]) – The groups involved in authoring the seed prompt (if any).

  • source (str) – The source of the seed prompt.

  • date_added (DateTime) – The date the seed prompt was added.

  • added_by (str) – The user who added the seed prompt.

  • prompt_metadata (dict[str, str | int]) – The metadata associated with the seed prompt. This includes information that is useful for the specific target you’re probing, such as encoding data.

  • parameters (List[str]) – The parameters included in the value. Note that seed prompts do not have parameters, only prompt templates do. However, they are stored in the same table.

  • prompt_group_id (uuid.UUID) – The ID of a group the seed prompt may optionally belong to. Groups are used to organize prompts for multi-turn conversations or multi-modal prompts.

  • sequence (int) – The turn of the seed prompt in a group. When entire multi-turn conversations are stored, this is used to order the prompts.

  • role (str) – The role of the prompt (e.g., user, system, assistant).

__str__()#

Returns a string representation of the memory entry.

__init__(*, entry)#

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

Methods

__init__(*, entry)

A simple constructor that allows initialization from kwargs.

get_seed_prompt()

Attributes

added_by

authors

data_type

dataset_name

date_added

description

groups

harm_categories

id

metadata

Refers to the _schema.MetaData collection that will be used for new _schema.Table objects.

name

parameters

prompt_group_id

prompt_metadata

registry

Refers to the _orm.registry in use where new _orm.Mapper objects will be associated.

role

sequence

source

value

value_sha256

added_by#
authors: Mapped[List[str] | None]#
data_type: Mapped[Literal['text', 'image_path', 'audio_path', 'video_path', 'url', 'reasoning', 'error', 'function_call', 'tool_call', 'function_call_output']]#
dataset_name#
date_added#
description#
get_seed_prompt() SeedPrompt[source]#
groups: Mapped[List[str] | None]#
harm_categories: Mapped[List[str] | None]#
id#
name#
parameters: Mapped[List[str] | None]#
prompt_group_id: Mapped[UUID | None]#
prompt_metadata: Mapped[dict[str, str | int]]#
role: Mapped[Literal['system', 'user', 'assistant', 'tool', 'developer']]#
sequence: Mapped[int | None]#
source#
value#
value_sha256#