Repository navigation
FEAT: Add target capability detection to the GUI - #3600
Richard Lundeen (richlundeen) merged 15 commits into
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…arget-capability-detection
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>
Richard Lundeen (richlundeen)
left a comment
There was a problem hiding this comment.
Automated review completed. No blocking concerns remain. This review records source coverage; it does not authorize merge.
There was a problem hiding this comment.
🟡 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>
|
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. |
Richard Lundeen (richlundeen)
left a comment
There was a problem hiding this comment.
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>
Richard Lundeen (richlundeen)
left a comment
There was a problem hiding this comment.
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>


Description
Let users detect selected targets' capabilities from the GUI and apply the results automatically. Detection batches continue when users navigate to another page.
Demonstration: the existing screenshots show the detection entry point and selection of all sample targets.