Skip to content

FEAT: Add native ASSERT prompt generation - #3271

Open
Richard Lundeen (richlundeen) wants to merge 10 commits into
microsoft:mainfrom
richlundeen:richlundeen-assert-prompt-generation
Open

Richard Lundeen (richlundeen) wants to merge 10 commits into
microsoft:mainfrom
richlundeen:richlundeen-assert-prompt-generation

Conversation

@richlundeen

@richlundeen Richard Lundeen (richlundeen) commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Description

Assert (https://github.com/responsibleai/ASSERT) allows users to specify policies using english language and test those policies.

This PR adds native ASSERT-style prompt generation using PyRIT targets, normalizers, and seeds. AssertGenerator researches an English behavior requirement, builds a policy taxonomy, resolves coverage dimensions, and returns validated native AttackSeedGroup objects.

  • Support pairwise, stratified, full-factorial, and random assignment planning with deterministic sampling, exact requested counts, bounded JSON retries, and measured coverage.
  • Associate each objective with optional literal target messages and separately named adversarial SeedPrompt inputs. Existing technique factories bind those inputs through constructor-level AttackAdversarialConfig; existing attacks own JSON replies, feedback, and turn handling.
  • Package complete results through AssertProvider for memory storage. Group associations, literal text, response schemas, identity, and bounded generation references survive serialization and storage.
  • Add opt-in hosted-search capability and request-policy enforcement at the target layer.
  • Group generation providers under seed_datasets/generated, preserving the public TargetObjectiveProvider import. Add lazy exports and retain MIT attribution to ASSERT v0.3.0, revision 04b713fe73879208369750b3bd5ad53544f3eecc (2026-09-04).

This PR covers generation only. ASSERT-specific scoring and foundry scenario integration are separate work. No ASSERT runtime dependency or dependency-manifest changes are included.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: ede3dafb-0eaa-472d-9638-2bf9e8661437
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: ede3dafb-0eaa-472d-9638-2bf9e8661437
Comment thread pyrit/scenario/core/matrix_atomic_attack_builder.py
Comment thread pyrit/executor/promptgen/assert_generator.py Outdated
Comment thread pyrit/models/identifiers/seed_identifier.py Outdated
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: ede3dafb-0eaa-472d-9638-2bf9e8661437
Check group prompt contracts before attack construction. Retry whitespace-only system prompts and use canonical behavioral inputs for seed storage.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: ede3dafb-0eaa-472d-9638-2bf9e8661437
Comment thread pyrit/scenario/core/attack_technique_factory.py
Comment thread pyrit/scenario/core/attack_technique_factory.py Outdated
Preserve complete-group storage checks and canonical named-prompt identity.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: ede3dafb-0eaa-472d-9638-2bf9e8661437
Share named prompt slot, parameter, and schema validation with attack construction. Bind adaptive candidates to fresh group-specific attacks before selection, preserve full technique identity and saved choices, and pass prepared inline groups through Execute.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: ede3dafb-0eaa-472d-9638-2bf9e8661437
Separate restored-name registration from proposed-name recovery so both retain their assertions within the existing E2E timeout.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: ede3dafb-0eaa-472d-9638-2bf9e8661437
Comment thread pyrit/scenario/scenarios/adaptive/adaptive_scenario.py Outdated
Comment thread pyrit/models/seeds/attack_seed_group.py
Preserve context-based construction, named-prompt binding, child technique labels, and the incoming Operations acceptance tests.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: ede3dafb-0eaa-472d-9638-2bf9e8661437
Restore saved names and source occurrences for adaptive and baseline groups. Reject unbound or mismatched named prompts at the atomic boundary while preserving compound child identities.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: ede3dafb-0eaa-472d-9638-2bf9e8661437
Preserve named seed-group prompts and run-scoped technique editing.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants