Skip to content

Security / Unicode sanity

Checks for problems that slip past code review: content that reads one way to a reviewer and another way to a compiler, a terminal or git (invisible or direction-changing Unicode, non-ASCII bytes, leftover merge-conflict markers); content, imports, tracked paths or symlinks a project forbids; files that must match a pinned digest or the output of their generator; and commits that must be signed or come from an allowed author. A diff view tends to render the first group harmlessly, which is why a mechanical check is the reliable defence.

Rule kinds in the Security / Unicode sanity family. Each rule below links to its own page with options, an example, and any auto-fix support.

RuleDescription
file_content_forbiddenFile contents must NOT match a regex.
file_hashContent SHA-256 must equal the expected digest.
file_is_asciiEvery byte in the file must be < 0x80 (pure ASCII), except codepoints listed in allow:.
pinned_referencesRequire executable references in supported CI and container files to identify immutable artifacts rather than mutable tags or branches.
spdx_identifier_validValidate every SPDX-License-Identifier: value as a strict SPDX license expression.
no_merge_conflict_markersFlag <<<<<<< , =======, >>>>>>> , ||||||| markers at the start of a line, almost always left over from an unresolved merge.
no_bidi_controlsFlag Trojan-Source bidi override characters (U+202A to U+202E, U+2066 to U+2069).
no_zero_width_charsFlag body-internal zero-width characters (U+200B, U+200C, U+200D, and non-leading U+FEFF).
no_symlinksFlag tracked paths that are symbolic links.
git_no_denied_pathsFire when any tracked file matches a configured glob denylist.
git_commit_author_allowlistAssert every commit author in scope matches an allowed email and/or name pattern.
git_commit_gpg_signedAssert every commit in scope has a verifying signature (git verify-commit exits 0).
pair_hashThe algorithm digest (sha256 default / sha512) of every file matching source must appear in the single target file, either as an embedded hex substring (format: contains, default) or a <hex> <path> manifest line (format: sums-line, where the path token must be the source's path; a leading * binary marker and a ./ prefix are tolerated).
generated_file_freshA committed artefact must equal what a declared command generator produces, in one of two modes (exactly one of file / outputs).
import_gateForbid imports whose extracted target matches a forbid regex, within the paths scope, an architectural import firewall (staging-layer isolation, core/providers separation, private-API gates).