Skip to content

FIX: Mark more credential parameters as sensitive - #3807

Merged
varunj-msft merged 2 commits into
microsoft:mainfrom
varunj-msft:varunj-msft/13178-Sensitive-Credential-Params
Nov 5, 2026
Merged

varunj-msft merged 2 commits into
microsoft:mainfrom
varunj-msft:varunj-msft/13178-Sensitive-Credential-Params

Conversation

@varunj-msft

Copy link
Copy Markdown
Contributor

Description

This is one of the changes from the work on saving Registry entries across restarts. It doesn't depend on the rest of that work.

Problem. The create forms show the Azure Speech converters' azure_speech_key and HackAPromptTarget's cookie and session_id in plain text. /api/targets/types and /api/converters/types report them as sensitive: false, because the shared list of sensitive parameter names (ComponentIdentifier.get_sensitive_parameter_names, added in #2846) leaves them out. The converter form also has its own text field for plain parameters that ignores the flag.

Change.

  • Add the three names to the shared list. Only these three classes use them, so the shared list, which applies to targets, converters and scorers alike, is enough.
  • The converter form uses a password field for sensitive parameters, as the target form already does through ParameterField.
  • The registry's target credential-name check also matches cookie, session_id and names ending in _key, and converters get the same check, so the next missed credential fails a test.

What stays the same. Identifiers, hashes and stored data. The list only sets the sensitive flag in the type catalogs and keeps a converter's sensitive inputs out of its editable settings. Instance responses don't include these values today (the Speech key's type has no JSON form), so no response body changes beyond the flag. Non-sensitive converter fields still use a text field.

Tests and Documentation

  • New: /api/targets/types marks HackAPrompt's cookie and session_id sensitive and leaves challenge_slug plain; /api/converters/types marks azure_speech_key sensitive and leaves azure_speech_region plain for both Speech converters; the converter form renders a sensitive field as a password field and a plain one as text. Updated: the shared-list test (now also checks converters) and the target credential-name check. New: the converter credential-name check. Each new test fails without the change.
  • pytest tests/unit/models/identifiers/test_typed_identifier.py tests/unit/registry/test_target_registry.py tests/unit/registry/test_converter_registry.py tests/unit/backend/test_api_routes.py::TestTargetRoutes tests/unit/backend/test_api_routes.py::TestConverterRoutes: 184 passed.
  • npx jest src/components/Registry/CreateConverterDialog.test.tsx: 62 passed. npx eslint --max-warnings 0 on the changed frontend files: clean.
  • uv run --frozen --extra all --link-mode=copy ty check pyrit: all checks passed. pre-commit: passed.
  • Live, against local backends built from this branch and from main with the same config: /api/targets/types and /api/converters/types report cookie, session_id and azure_speech_key as sensitive on this branch and not on main; challenge_slug and azure_speech_region stay plain on both.

No documentation or JupyText changes.

The create forms showed the Azure Speech converters' azure_speech_key and
HackAPromptTarget's cookie and session_id in plain text. The shared list
of sensitive parameter names left them out, and the converter form's own
text field ignored the flag. Add the three names, use a password field for
sensitive converter parameters, and widen the credential-name checks so the
target and converter registries flag the next one.

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.

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

@varunj-msft
varunj-msft added this pull request to the merge queue Nov 5, 2026
Merged via the queue into microsoft:main with commit 5eeb0d3 Nov 5, 2026
66 checks passed
@varunj-msft
varunj-msft deleted the varunj-msft/13178-Sensitive-Credential-Params branch November 5, 2026 04:52
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