FEAT: Explore datasets and use seeds in chat and custom scenarios #2744
Description
Is your feature request related to a problem? Please describe.
People using CoPyRIT need a way to discover seed prompts without leaving the GUI, inspect the datasets already in memory, optionally load built-in datasets, and use a selected example in a human-led attack. Selecting several examples should lead to a configurable scenario rather than a batch-chat feature.
The backend already lists dataset names from memory and registered providers. Chat already supports media previews and copying content into its input. This series should reuse that infrastructure and remain mostly GUI work plus thin service APIs.
Describe the solution you'd like
User experience
Add a Datasets section with searchable/filterable dataset cards. Cards show meaningful counts, modalities, harm categories when present, and whether a dataset is loaded or available from a provider. Clicking a card opens a paginated prompt table with expandable content and metadata. Images render, and audio/video have playback controls.
For one selected prompt or linked multimodal example, provide:
- Import to new attack.
- Import to current conversation within the current attack.
- Import to new conversation within the current attack.
These actions populate an editable draft. They never send to a target automatically. Add a "Need inspiration? Browse seed prompts" entry point in chat, preserving the draft and originating attack/conversation while browsing.
For multiple selected examples, provide Configure scenario. Reuse Scanner configuration, execution, progress, and history. Defaults are exactly prompt sending, no converters, and a compatible configured objective-scorer preset. Let the user configure standard attack techniques, converter pipelines, target, and scoring before confirming launch.
Agreed design boundaries
- Memory is the source of browsable seeds. Provider loading is explicit and writes through existing memory APIs. Catalog browsing, filtering, and estimates must not download datasets.
- Use credentials already configured on the backend. Loaded datasets remain in the deployment's shared memory. Do not introduce browser token entry, a credential store, or private per-user dataset access.
- Use configured instances from ScorerRegistry, not a hardcoded list of scorer class names. Prefer the compatible instance tagged default_objective_scorer. Existing composites are valid presets; raw refusal=true must not be presented as attack success.
- Preserve existing objectives. If a selected example lacks an objective required by the scenario, ask for it rather than inventing one or treating a file path as an objective.
- Keep grouped text/media, roles, and ordering intact. Use stored seed types and declared parameters to explain prompts, objectives, and simulated-conversation configurations. Preserve unknown template state; the shipped API has no
is_templateflag. Unsupported import shapes remain inspectable with an explanation; do not silently flatten or execute them. - Use the shipped FEAT GUI: Add paginated seed browsing API #2748/FEAT: paginated seed browsing #2989 browsing contract rather than intermediate PR descriptions. Carry
selection_keywithexample_id; detail is read-onlySeedRecorddata with raw stored values, conditions and provenance, not reconstructed execution-ready seeds. Text search covers prompt/objective values, not simulated-conversation JSON; the seed-type filter finds configurations. - Distinguish logical examples from seed/prompt pieces and objectives. A text/image pair is one example with two pieces. Missing harm labels mean "Not labeled", not "Safe". Unknown provider counts are not zero, and provider estimates are not exact loaded counts.
- Preserve chat drafts, attachments, target/converter settings, browsing filters, and return context. Confirm before replacing a draft. Respect existing target compatibility and conversation mutation restrictions.
- Use bounded database-side pagination and lazy media loading. No autoplay. Keep safe media serving and clear missing-file/unsupported-format fallbacks.
- No memory schema migrations, new dataset tables, new execution engine, or persistent dataset copied for each selection. Narrow memory read-query helpers are allowed when required for counts and pagination.
Delivery sequence
The main explorer sequence is released to contributors one item at a time. The summary and browsing foundations are completed in #2762/#2746 and #2989/#2748, and catalog/navigation is completed in #3071/#2747. The current contributor item is #2745 (prompt table/details), which extends the shipped dataset-selection page. Shared media previews in #2749 follow it.
Item 12 (#2755, the general scorer registry backend API) ran as an independent track and is completed in #2990. The overlapping general-API issue #2970 is also completed by that PR and remains related work, not an eighteenth child.
The remaining dataset-specific scorer requirements are explicit in #2757 (exact-selection and registry-name request contract), #2760 (compatible defaults, composites/inverters, and objective-result semantics), and #2759 (configured-instance picker, tags/default/compatibility metadata, and setup guidance). The full identifier returned by #2990 does not by itself implement these behaviors.
Item 13 (#2757) is released only after both item 11 (#2756) and item 12 (#2755) are complete, followed by maintainer promotion. #2756 is still open, so completing the scorer API does not release #2757 early. Each issue includes its own focused tests and failure states; the final item does not defer that work.
| Order | Work item |
|---|---|
| 1 | #2746 FEAT GUI: Add memory-backed dataset summary API (completed in #2762) |
| 2 | #2748 FEAT GUI: Add paginated seed browsing API (completed in #2989) |
| 3 | #2747 FEAT GUI: Add dataset navigation and cards (completed in #3071) |
| 4 | #2745 FEAT GUI: Add prompt table and seed detail view |
| 5 | #2749 FEAT GUI: Share image, audio, and video previews with datasets |
| 6 | #2750 FEAT GUI: Preserve chat drafts when exploring datasets |
| 7 | #2751 FEAT GUI: Import a dataset example into a chat draft |
| 8 | #2752 FEAT GUI: Add seed-prompt inspiration entry points |
| 9 | #2754 FEAT GUI: Expose built-in dataset provider metadata |
| 10 | #2753 FEAT GUI: Load built-in datasets into memory on request |
| 11 | #2756 FEAT GUI: Add dataset loading controls and access guidance |
| 12 | #2755 FEAT: Scorer Backend API (completed in #2990; parallel API track) |
| 13 | #2757 FEAT GUI: Accept exact seed selections in scenario requests |
| 14 | #2760 FEAT: Support custom scenarios over selected dataset examples |
| 15 | #2759 FEAT GUI: Configure a scenario from selected dataset examples |
| 16 | #2758 FEAT GUI: Configure scenario attack techniques and converters |
| 17 | #2761 DOC GUI: Document dataset workflows and cover cross-flow journeys |
Contributor readiness
- This parent is assigned to Roman Lutz (@romanlutz); child issues are available for external contributors when promoted.
- The current contributor-ready item is FEAT GUI: Add prompt table and seed detail view #2745 (prompt table and seed details), marked help wanted and unassigned at promotion. Coordinate on that issue before starting. Extend the existing
/datasets/detail?selection_key=<encoded>page with read-only paginated example browsing and lazy expansion, using the shipped APIs. Media playback, chat import, and scenario flows remain separate later items. - FEAT GUI: Add memory-backed dataset summary API #2746, FEAT GUI: Add paginated seed browsing API #2748, FEAT GUI: Add dataset navigation and cards #2747, and FEAT: Scorer Backend API #2755 are completed, along with related FEAT: Add a general scorer registry API for dataset-driven scenarios #2970. Completed roadmap items no longer carry readiness labels. FEAT GUI: Accept exact seed selections in scenario requests #2757 still depends on FEAT GUI: Add dataset loading controls and access guidance #2756 even though its scorer API prerequisite is complete.
- Other open children carry not ready yet until their prerequisites have merged and the maintainer promotes them.
- On promotion, remove not ready yet and apply help wanted. Keep at most one active main-sequence item; the independent scorer API track is now complete. Do not mark the entire series help wanted at once.
Describe alternatives you've considered, if relevant
- A second dataset store or copying selections into new persistent datasets would duplicate memory and is out of scope.
- Automatically fetching all providers to obtain counts would make browsing expensive and can require gated access. Show available metadata without fetching.
- Concatenating several unrelated prompts into one chat draft would change their meaning. Use the scenario flow for multi-select.
- A new batch runner, general scorer-builder GUI, unscored scenario mode, dataset editor/deleter, or arbitrary user-supplied loader code is not part of this series. The general scorer API creation route already shipped in FEAT: expose ScorerRegistry through the backend API #2990 and should be reused, not rebuilt.
Additional context
Read doc\code\framework.md and the applicable .github\instructions files before implementing a child issue. Keep business logic in the appropriate framework component; the GUI and backend are adapters.
The final API contract and consumer notes are recorded in #2748 and the merged browsing guide. #2747 documents the exact catalog fields; #2745 documents routes, search/facets, cursor navigation, safe previews and raw detail records. #2751 and #2757 retain dataset-scoped selection and explicit import/execution validation. Reuse these APIs instead of rebuilding them or restoring the superseded reconstruction-based response.
The catalog/navigation handoff is shipped in #3071. Preserve its opaque selection-key route, validated catalog return path, loaded-only catalog, and runtime/request invalidation. #2745 now includes the exact frontend extension points, separation of catalog queries from seed queries, placeholder-copy updates, and regression coverage to retain.
Useful starting points: DatasetSelection, DatasetCard, useLoadedDatasets, routeParams.ts, DatasetService and the dataset routes/models, ChatWindow and ChatInputArea, MessageList, the media route and attack media mappers, ScenarioDetail, ScenarioConfigurationResolver, ScorerRegistry, and ScorerInitializer.
Coordinate with #2735 for counts without materializing unloaded datasets and #2653 for decomposition of the Scanner configuration page. These are related work, not requests to duplicate or take over those issues.
Contributors must be able to develop and test this feature with local seed fixtures, mock providers, and media fixtures without privileged Hugging Face access or paid target calls.
Relationship to scenario dataset generation
Rich's scenario dataset plan covers dynamic dataset generation for scenarios, initially LLM-generated text objectives, plus the shared source-selection, limit, and fetch-policy controls around it. The boundary matches this explorer: provider -> typed seeds -> memory -> scenario. Configured scenario providers can generate missing named data during preparation; subsequent runs reuse stored rows by name, rather than generating again by default. Browsing, estimates, and resume must not generate data.
Coordination status checked on 2026-10-12 UTC: explicit generation (#2904), source/limit preparation (#2956), and configured providers (#3116) are merged. The proposal's PR 2 is the still-open #3143, which adds shared scenario dataset requests/options and a GUI source table. Follow the live implementation and PR status rather than treating the gist's older "planned" status as authoritative.
- FEAT GUI: Add prompt table and seed detail view #2745 can browse already-stored generated objectives and their provenance through the existing APIs. It does not wait for generator configuration UI.
- FEAT GUI: Expose built-in dataset provider metadata #2754 should reuse shared provider/count/origin metadata, including the additions proposed in [BREAKING] FEAT: Add scenario dataset controls to CLI, REST, and GUI #3143. FEAT GUI: Load built-in datasets into memory on request #2753 and FEAT GUI: Add dataset loading controls and access guidance #2756 still own the explorer's explicit built-in Load operation, operation status, and gated-access guidance; scenario preparation does not deliver that whole workflow.
- FEAT GUI: Accept exact seed selections in scenario requests #2757, FEAT: Support custom scenarios over selected dataset examples #2760, and FEAT GUI: Configure a scenario from selected dataset examples #2759 should reuse the shared scenario contracts and form components where applicable. Exact selected examples remain a distinct input mode: names, broad filters, sampling caps, provider reuse, or refresh must not silently replace or reduce the selected population.
Generator configuration in the GUI, generation-quality scoring, and destructive refresh are separate optional follow-ups, not additions to this approved 17-item series. Generation quality is distinct from scoring the attack's outcome. These coordination links do not change the delivery order, native dependencies, or contributor-readiness policy.
Activity