Repository navigation
FIX: Persist general technique flag on seed entries (#3739) - #3844
Closed
Hrushikesh Ramilla (Hrushikesh-ramilla) wants to merge 1 commit into
Closed
Hrushikesh Ramilla (Hrushikesh-ramilla) wants to merge 1 commit into
Hrushikesh Ramilla (Hrushikesh-ramilla) wants to merge 1 commit into
Conversation
Copilot started reviewing on behalf of
Hrushikesh Ramilla (Hrushikesh-ramilla)
November 2, 2026 21:52
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Seed deduplication ignores is_general_technique, silently skipping otherwise identical prompts with opposite flags and preventing technique-group rebuilding when a legacy row defaults to False.
1 open issue
What changed in this PR
This PR addresses #3739 by persisting is_general_technique through PyRIT’s seed storage and retrieval, preserving the flag needed to reconstruct attack technique groups.
Changes:
- Stores and restores the flag, including its projection onto
SeedRecord. - Adds a migration with a false legacy default and a simulated-conversation backfill.
- Adds persistence, identity round-trip, and migration regression tests.
| File | Description |
|---|---|
tests/unit/memory/test_seed_general_technique.py |
Tests flag persistence and technique-group reconstruction. |
tests/unit/memory/test_seed_general_technique_migration.py |
Tests backfill, downgrade, SQL Server SQL generation, and schema alignment. |
tests/unit/memory/test_operations_and_findings_migration.py |
Upgrades to the latest revision before checking schema alignment. |
pyrit/models/seeds/seed_record.py |
Exposes the flag on seed records. |
pyrit/memory/memory_models.py |
Persists and restores the flag in seed mappings. |
pyrit/memory/alembic/versions/064a1eff19fc_add_is_general_technique_to_seed_entries.py |
Adds the column and backfills simulated conversations. |
Review effort: Balanced
| self.prompt_group_id = entry.prompt_group_id | ||
| self.seed_type = seed_type | ||
| self.origin = entry.origin.value | ||
| self.is_general_technique = bool(getattr(entry, "is_general_technique", False)) |
Persist is_general_technique on SeedEntry and project it onto SeedRecord, reconstructing the execution flag on retrieved seeds and preventing identity drift or reconstruction errors when restoring technique groups. Also adds Alembic schema migration and unit regression tests. Signed-off-by: Hrushikesh Ramilla <ramillahrushikesh@gmail.com>
Hrushikesh Ramilla (Hrushikesh-ramilla)
force-pushed
the
fix/seed-general-technique-persistence-3739
branch
from
November 2, 2026 22:52
942396f to
250e811
Compare
Contributor
|
duplicate of #3785 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Resolves #3739.
Summary of Changes