bidi-guard

Detect hidden Unicode bidirectional characters in source files for CI integration.

29|5|Updated Mar 26, 2026
One-click install
npx skills add https://github.com/Moshe-ship/mkhlab --skill bidi-guard
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: bidi-guard
Source: https://github.com/Moshe-ship/mkhlab/tree/main/skills/bidi-guard
Command: npx skills add https://github.com/Moshe-ship/mkhlab --skill bidi-guard

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This tool detects Unicode bidirectional characters that enable Trojan Source attacks, helping secure source code from subtle, directionality-based vulnerabilities.

Core Features & Use Cases

  • Detects hidden bidirectional characters in source files
  • Supports CI integrations and local scans for code hygiene
  • Useful for auditing open-source projects and code reviews to prevent bidi-based exploits

Quick Start

Run bidi-guard scan PATH to detect hidden bidi characters in your source code.

Frequently Asked Questions about bidi-guard

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I detect hidden Unicode bidirectional characters in source code?

To detect hidden Unicode bidirectional characters in source code, run a scan over your source tree. This identifies invisible bidi control characters that can enable Trojan Source attacks and produces actionable results.

What is a Trojan Source attack and how do bidi characters exploit source files?

A Trojan Source attack uses hidden Unicode bidirectional characters to alter the visual rendering of source code, masking malicious logic. Scanning source files detects these bidi hazards before they enter your codebase.

Can I scan code diffs and pull requests for bidi hazards in CI?

Yes, you can scan code diffs and pull requests for bidi hazards in CI. The tool produces actionable results suitable for CI integration, allowing automated detection of dangerous bidirectional characters.

How do I audit mixed RTL scripts in source trees for security vulnerabilities?

To audit mixed RTL scripts in source trees, run a targeted scan for hidden bidirectional characters. This identifies Unicode control characters that could introduce directionality-based vulnerabilities into your code.

What is the best way to prevent bidi-based exploits in open-source projects?

The best way to prevent bidi-based exploits in open-source projects is to scan code during reviews and CI. This detects hidden bidirectional characters early, securing source files from subtle Trojan Source attacks.

Does bidi-guard work with source trees containing mixed RTL scripts?

Yes, bidi-guard works specifically with source trees containing mixed RTL scripts. It scans code, diffs, and PRs to detect hidden Unicode bidi characters that could enable Trojan Source attacks.