Skip to content

feat(redteam): add Turkish letter coverage to homoglyph map - #10244

Open
fevziegeyurtsevenler wants to merge 7 commits into
promptfoo:mainfrom
fevziegeyurtsevenler:altaysec/promptfoo
Open

fevziegeyurtsevenler wants to merge 7 commits into
promptfoo:mainfrom
fevziegeyurtsevenler:altaysec/promptfoo

Conversation

@fevziegeyurtsevenler

@fevziegeyurtsevenler fevziegeyurtsevenler commented Jul 30, 2026 •

Copy link
Copy Markdown

Extend the existing homoglyph strategy to substitute ç Ç ş Ş ğ Ğ ö Ö ı ü, including the previously omitted ü → ϋ mapping. Existing ASCII substitutions and other unmapped letters are preserved. The docs describe the covered letters and font-dependent appearance without claiming that unmapped letters have no possible lookalikes.

The regression fails before the ü fix and passes afterward; it also verifies that mapped characters remain distinct after NFC normalization. Validation: focused strategy tests, 36,664 backend tests (10 skipped), TypeScript, architecture, Knip, style, core build and production docs build pass. Thirteen cases run through the registered strategy and built CLI preserve expected output, metadata, unrelated variables and named metrics, including a complete Turkish sentence.

@promptfoo-scanner promptfoo-scanner Bot 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.

👍 All Clear

Reviewed the diff adding Turkish letter coverage to the red-team homoglyph strategy and its docs/tests. These changes only extend a static character mapping and do not introduce or modify any LLM calls, tools, or execution sinks. No LLM-security-relevant behavior changes were identified.

Minimum severity threshold: 🟡 Medium | To re-scan after changes, comment @promptfoo-scanner
Learn more


Was this helpful?  👍 Yes  |  👎 No 

@codecov

codecov Bot commented Jul 30, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.73%. Comparing base (aaeebf2) to head (69c4f35).

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #10244      +/-   ##
==========================================
- Coverage   89.73%   89.73%   -0.01%     
==========================================
  Files        1051     1051              
  Lines       92781    92781              
  Branches    32855    32855              
==========================================
- Hits        83261    83256       -5     
- Misses       9520     9525       +5     
Flag Coverage Δ
backend 90.44% <ø> (-0.01%) ⬇️
site 53.49% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@fevziegeyurtsevenler

Copy link
Copy Markdown
Author

Gentle ping — CI is fully green (34/34 checks, codecov patch covered) and the change is a small, self-contained map extension (+61/−7, no overlap with the #10056 Unicode-normalization work as noted in the description). Happy to rebase or adjust if anything is needed for review.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 16, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-14T02:40:24.853983Z 69c4f35 New commits
🔒 Security Review ✅ Completed 2026-09-16T01:50:06.081222Z 6609c3f New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6609c3fc69

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/redteam/strategies/homoglyph.ts Outdated
Comment on lines +70 to +73
// cross-script confusable with a different code point. (ü, Ü and İ
// are omitted: the only visually-identical alternatives are their NFD
// decompositions, which recompose to the original character under NFC and so
// have no effect.)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Map the available precomposed ü confusable

For Turkish inputs containing ü (for example, güvenlik), the strategy still leaves this language-specific letter untouched even though Greek small upsilon with dialytika, ϋ (U+03CB), is a precomposed cross-script confusable and remains distinct under NFC. The claim that only an ineffective NFD alternative exists is therefore false, and the same untouched-signal coverage gap this change addresses remains for a common Turkish letter; add the mapping and include ü in the transformed-letter test.

AGENTS.md reference: AGENTS.md:L370-L372

Useful? React with 👍 / 👎.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for security reviews. Please try again later.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 19689f67ff

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Ğ: 'Ǧ', // Latin capital g with caron (U+01E6)
ö: 'ӧ', // Cyrillic small o with diaeresis (U+04E7)
Ö: 'Ӧ', // Cyrillic capital o with diaeresis (U+04E6)
ü: 'ϋ', // Greek small upsilon with dialytika (U+03CB)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Cover capital Ü and İ with NFC-stable homoglyphs

When a Turkish prompt contains capital Ü or dotted capital İ (for example at a sentence start or in all-caps text), those characters still pass through unchanged—the new untouched test for Üİ confirms the gap remains after adding lowercase ü. This is avoidable without losing the NFC property: the map accepts string values, so Ü can use Armenian Ս + U+0308 and İ Greek Ι + U+0307, reusing the bases already chosen for ASCII U/I; both sequences remain distinct after NFC. Add these two keys and include them in the coverage set instead of asserting them untouched.

AGENTS.md reference: src/redteam/AGENTS.md:L48-L48

Useful? React with 👍 / 👎.

@mldangelo mldangelo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Reviewed the actual Unicode mappings and corrected missing lowercase ü coverage. Documentation now avoids unsupported claims about cross-script alternatives and explains normalization/font limits. The new regressions fail before the mapping fix. All 39 focused and 36,664 backend tests pass; real registered-strategy and CLI cases verify all ten Turkish mappings, NFC behavior, unchanged inputs, metadata, and named metrics. Types, architecture, Knip, style, core/docs builds, and all 67 current-head CI checks pass.

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.

3 participants