Skip to content

FIX: Remove TextTarget from GUI - #3777

Merged
Roman Lutz (romanlutz) merged 10 commits into
microsoft:mainfrom
pcbeingused333:fix-c1186
Nov 7, 2026
Merged

Roman Lutz (romanlutz) merged 10 commits into
microsoft:mainfrom
pcbeingused333:fix-c1186

Conversation

@pcbeingused333

@pcbeingused333 alexcastgonz (pcbeingused333) commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

Description

TextTarget prints to the Python host's text stream for SDK demonstrations and manual workflows; it is not an interactive GUI endpoint. Remove it from CoPyRIT's target flows while preserving SDK and REST API support.

Fixes #3712.

  • Exclude TextTarget and registered composites containing it from GUI creation, registries, defaults, and chat/converter/technique/round-robin target choices, using a shared frontend rule after loading all registry pages.
  • Keep saved history readable, but prevent further GUI sends to TextTarget; pending registry updates and saved last-use preferences cannot reintroduce it.
  • Retain accurate no-auth metadata for SDK/API callers and existing authentication behavior for other GUI targets.

Tests and Documentation

Regression coverage checks GUI exclusion, pagination, registry updates, target defaults/references, and readable saved history without sending. The frontend README documents the SDK-only behavior. The full affected frontend batch passed: 18 suites, 740 tests.

Additional focused checks, run from frontend:

  • npm test -- --runInBand --watch=false --runTestsByPath src\utils\targetVisibility.test.ts src\hooks\useTargetRegistry.test.ts src\hooks\useAttackTargetResolution.test.tsx: passed, 22 tests.
  • npm run type-check: passed.
  • npm run lint: passed.

JupyText was not run because no notebook changed. Python tests were not rerun for the frontend-only follow-up; the original registry/backend no-auth metadata regression tests remain in this PR.

The initial no-auth metadata fix was prepared with an AI coding assistant (Claude Code) and submitted by Alex Castillo González. The GUI exclusion is included in follow-up commit 8522680818af.

TextTarget writes to a local stream and never contacts a service, but it
inherited the default supported_auth_modes of (api_key,), so the target
picker described it as 'Supported authentication: API key'. Declare an
empty tuple and have the dialog say 'No authentication required' when the
registry reports no auth modes.
# Conflicts:
#	tests/unit/registry/test_target_registry.py
Copilot AI balanced review requested due to automatic review settings November 5, 2026 14:52

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

The new async test in tests/unit/backend/test_target_service.py needs an _async suffix to comply with the required naming convention.

1 open issue
What changed in this PR

This PR addresses #3712 by identifying TextTarget as credential-free in registry metadata and displaying that information in the target-creation dialog.

Changes:

  • Declare that TextTarget supports no authentication modes.
  • Show “No authentication required” for empty mode lists from loaded registry metadata, while preserving fallback behavior.
  • Add registry, backend, and frontend regression tests.
File Description
tests/​unit/​registry/​test_target_registry.py Verify credential-free metadata and retain API-key-only coverage.
tests/​unit/​backend/​test_target_service.py Verify the API returns no authentication modes for TextTarget.
pyrit/​prompt_target/​text_target.py Declare an empty supported authentication-mode tuple.
frontend/​src/​components/​Config/​CreateTargetDialog.tsx Display credential-free status when registry metadata is available.
frontend/​src/​components/​Config/​CreateTargetDialog.test.tsx Add TextTarget coverage and verify the authentication description.

Review effort: Balanced

@romanlutz Roman Lutz (romanlutz) changed the title fix: report no auth modes for credential-free TextTarget FIX: Remove TextTarget from GUI Nov 7, 2026

@romanlutz Roman Lutz (romanlutz) 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.

Had to change this substantially since the original goal didn't make too much sense in the greater scheme of things...

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>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@romanlutz
Roman Lutz (romanlutz) added this pull request to the merge queue Nov 7, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 7, 2026
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@romanlutz
Roman Lutz (romanlutz) added this pull request to the merge queue Nov 7, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 7, 2026
@romanlutz
Roman Lutz (romanlutz) added this pull request to the merge queue Nov 7, 2026
Merged via the queue into microsoft:main with commit 7167c82 Nov 7, 2026
58 of 59 checks passed
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.

TextTarget is described as using API-key authentication even though it needs no credentials

3 participants