unicode_safety_gate
Scans GitHub repos, pull requests, diffs, or files for adversarial Unicode and Trojan Source risks, then returns a block/warn/pass verdict, risk score, locations, and fixes.
Instructions
Adversarial Unicode & Trojan Source gatekeeper. Scans a public GitHub repo, a pull request, a unified diff or a list of files for adversarial Unicode with the 19 rules (USC001-USC019) of dcondrey/unicode-safety-check: bidi controls (Trojan Source), invisible and default-ignorable characters, variation-selector and tag-character payloads (Glassworm), private-use code points, homoglyph and mixed-script identifiers, confusable collisions, misplaced BOM and control characters. Leads with a block/warn/pass verdict, a 0-100 risk score, the top locations (file:line:column) grouped so one trick reads as one finding, and the fix; also returns every finding, a SARIF 2.1.0 log for GitHub code scanning, and model-written exploit explanations that are checked against the findings. Findings and verdict come from deterministic rules; only the explanations use a model. Repo scans read up to 1,000,000 characters, shallowest files first, and list what they skipped.
Cost: 0.25 USDC per call, paid automatically over x402 on Base when AGENT_PRIVATE_KEY is configured and the price is within MAX_USDC_PER_CALL.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ref | No | Branch, tag or commit for repo; defaults to the default branch. | |
| diff | No | Unified diff (git diff output). Only added lines are scanned; findings carry new-file line numbers. | |
| repo | No | Alternative to files and diff: a public GitHub repository, owner/repo or https://github.com/owner/repo[/tree/ref]. Read from its source archive; files are scanned shallowest first up to the character cap and the rest are listed as skipped. | |
| files | No | Files to scan in full. Provide exactly one of files, diff, repo or prUrl; total content is capped at 1000000 characters. | |
| prUrl | No | Alternative to files and diff: a public GitHub pull request, commit or compare URL. Only added lines are scanned. | |
| scanExcluded | No | Also scan paths the upstream scanner skips (node_modules/, vendor/, dist/, build/, .lock, .min.js, images, archives). Default false. | |
| identifierPolicy | No | Default ascii-only: any non-ASCII identifier is flagged (USC019). | |
| permittedScripts | No | Used with permitted-scripts. Default Latin, Common, Inherited. |