Skip to content

FEAT: Add target capability detection to the GUI - #3600

Merged
Richard Lundeen (richlundeen) merged 15 commits into
microsoft:mainfrom
richlundeen:richlundeen-target-capability-detection
Nov 10, 2026
Merged

Richard Lundeen (richlundeen) merged 15 commits into
microsoft:mainfrom
richlundeen:richlundeen-target-capability-detection

Conversation

@richlundeen

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

Copy link
Copy Markdown
Contributor

Description

Let users detect selected targets' capabilities from the GUI and apply the results automatically. Detection batches continue when users navigate to another page.

  • Add capability detection to the target configuration view, including selection of multiple targets.
  • Check a control request before shared target discovery applies results, and combine checks across all children of a round-robin target.
  • Document target discovery, the backend API, and the GUI workflow.

Demonstration: the existing screenshots show the detection entry point and selection of all sample targets.

Capability detection entry point with sample targets
Capability detection with all sample targets selected

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Use the shared correctness-test watchdog for retained-request shutdown synchronization without changing cancellation or cleanup assertions.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Preserve capability detection with automatic registry refresh, remembered objective references, and shared registry identity details.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Keep successful GUI detection payloads across failed or omitted later batches without overriding newer registry reads. Disclose possible provider charges before launch and cover the frontend API wrapper contract.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings November 9, 2026 09:36

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated review completed. No blocking concerns remain. This review records source coverage; it does not authorize merge.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Capability discovery can report JSON support that round-robin children cannot honor, while wrapped unsupported-feature rejections can incorrectly abort strict discovery.

2 open issues
What changed in this PR

Adds live target capability detection to the PyRIT GUI, connecting target selection and progress tracking to backend discovery and session-scoped capability updates.

Changes:

  • Adds selectable detection batches that continue across page navigation and update cached target capabilities.
  • Adds a detection API with private probe instances, deadlines, conflict checks, and round-robin aggregation.
  • Extends strict discovery, regression coverage, and user documentation.
File Description
tests/​unit/​prompt_target/​test_round_robin_target.py Tests capability aggregation across children.
tests/​unit/​prompt_target/​test_discover_target_capabilities.py Tests strict discovery and declaration preservation.
tests/​unit/​backend/​test_target_detection.py Covers detection, isolation, cleanup, conflicts, and route responses.
tests/​unit/​backend/​test_runtime_lifecycle.py Uses shared watchdog timeouts for lifecycle tests.
pyrit/​prompt_target/​round_robin_target.py Adds child capability aggregation.
pyrit/​prompt_target/​common/​discover_target_capabilities.py Adds strict discovery and control requests.
pyrit/​backend/​services/​target_service.py Coordinates private probes and capability updates.
pyrit/​backend/​routes/​targets.py Exposes the capability detection endpoint.
pyrit/​backend/​README.md Documents detection API behavior and limitations.
pyrit/​backend/​models/​targets.py Adds the detection request model.
frontend/​src/​services/​api.ts Adds the detection API client method.
frontend/​src/​services/​api.test.ts Tests detection request encoding and response handling.
frontend/​src/​hooks/​useTargetCapabilityDetection.ts Manages batches, progress, and runtime invalidation.
frontend/​src/​components/​Config/​TargetTable.tsx Adds target selection and detection status controls.
frontend/​src/​components/​Config/​TargetTable.test.tsx Tests selection, progress, errors, and remount behavior.
frontend/​src/​components/​Config/​TargetTable.styles.ts Styles detection controls and table columns.
frontend/​src/​components/​Config/​TargetFiltersBar.styles.ts Shares reset-control sizing for alignment.
frontend/​src/​components/​Config/​TargetConfig.tsx Merges detected capabilities with registry refreshes.
frontend/​src/​components/​Config/​TargetConfig.test.tsx Tests result retention and refresh races.
frontend/​src/​App.tsx Keeps detection active across navigation and updates defaults.
frontend/​src/​App.test.tsx Tests navigation persistence and remembered target updates.
doc/​gui/​0_gui.md Adds brief GUI detection guidance.
doc/​code/​targets/​0_prompt_targets.md Documents strict discovery semantics.
.github/​copilot-instructions.md Clarifies where shared behavior and GUI guidance belong.

Review effort: Balanced

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

Copy link
Copy Markdown
Contributor Author

Both causes in this review are fixed in 44afd84. Round-robin sends use task-local parent capability flags without changing registered children, and LiteLLM's generic error wrapper retains provider statuses so strict discovery recognizes confirmed 400/422 feature rejection. The service-to-provider, concurrent-isolation, cancellation and strict-discovery/operational-control regressions pass in the affected suite. Each inline thread has a focused explanation of its repair.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated review completed. No blocking concerns remain. This review records source coverage; it does not authorize merge.

Keep manual bindings stable across registry detection, retain unprobeable adapter declarations, and validate packaged image payloads before applying results.

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated review completed. No blocking concerns remain. This review records source coverage; merging is handled separately.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Snapshot manual-chat capabilities and scope sends and replay on the original target. Preserve legacy session flags and present saved capabilities when reopening chats.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Always install the saved task-local scope even when flags initially match. Gate real service history retrieval while concurrent detection updates the live target and verify preserved provider history for current and legacy chats.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Match the memory history sequence contract and explicitly guard successful result assignment while retaining Event release and task join.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@richlundeen
Richard Lundeen (richlundeen) added this pull request to the merge queue Nov 10, 2026
Merged via the queue into microsoft:main with commit 9a4c0de Nov 10, 2026
61 checks passed
@richlundeen
Richard Lundeen (richlundeen) deleted the richlundeen-target-capability-detection branch November 10, 2026 22:01
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.

3 participants