Back to all rules / Hidden content and security

unsafe-path

File path contains control, bidi or invisible characters.

warning by default Hidden content and security Config or baseline only

Source: Trojan Source (Boucher and Anderson) (trojansource.codes), read 14 October 2026.

On GitHub: the rule doc and the tests.

Jump to another rule89

What it catches#

File path contains control, bidi or invisible characters.

A file name or folder name that contains control characters, bidirectional controls or invisible characters. The message shows the path with those characters escaped.

Why it matters#

A path that displays differently from how it is stored can disguise which file an agent loads.

Bad example#

$ ls .claude/rules | cat -A
security.md$
securM-bM-^@M-^Kity.md$

Two files that both display as security.md; the second has a zero-width space inside the name. A reviewer sees one rules file. Claude Code loads both, and the second can say anything.

Good example#

$ ls .claude/rules | cat -A
security.md$

How to fix#

Rename the file to plain ASCII: git mv ".claude/rules/$(printf 'secur​ity.md')" .claude/rules/security-2.md, then decide whether its contents belong anywhere. ls | cat -A or find . -name '*[^ -~]*' lists names with non-ASCII bytes.

Suppress or configure#

unsafe-path is a security rule, so it cannot be suppressed with a comment in the file: a suppression comment is itself a hidden comment, and an attacker who can add a payload can add one next to it. A comment that tries gets a suppression-not-allowed warning.

Turn it off, or change its severity, in .asitisrc.json, which shows up in review:

{ "rules": { "unsafe-path": "off" } }

Or accept the findings you have today in a baseline, so only new ones fail the build:

asitis lint --format json --write-baseline > .asitis-baseline.json
asitis lint --baseline .asitis-baseline.json

Source#

Trojan Source (Boucher and Anderson), read on 14 October 2026.

See what an agent changed in your CLAUDE.md. Keep or revert each change.

The linter is free and needs no signup. I'm also building a desktop editor for the markdown your agents write and read. It shows what an agent changed since you last looked, lets you keep or revert each change, and never touches a line you didn't edit. No release date yet. One email to confirm, one when the paid beta opens, one when 1.0 ships. $29 once for a founding licence, with 24 months of updates.

Or add the linter to CI, no email needed.

Your address is stored with Cloudflare, which hosts this site. No IP address is kept. See the privacy policy.

Run the rule

Back to all rules

This page is generated from the plugin's rule registry. Edit it on GitHub. False positive? Open an issue with the line it fired on.