Repository navigation
feat(redteam): add Turkish letter coverage to homoglyph map - #10244
fevziegeyurtsevenler wants to merge 7 commits into
Conversation
Signed-off-by: Fevzi Ege Yurtsevenler <[email protected]>
There was a problem hiding this comment.
👍 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
Codecov Report✅ All modified and coverable lines are covered by tests. 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
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
Signed-off-by: Fevzi Ege Yurtsevenler <[email protected]>
|
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. |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 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".
| // 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.) |
There was a problem hiding this comment.
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 👍 / 👎.
|
You have reached your Codex usage limits for security reviews. Please try again later. |
There was a problem hiding this comment.
💡 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) |
There was a problem hiding this comment.
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
left a comment
There was a problem hiding this comment.
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.
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.