llm-security/tests
Kjell Tore Guttormsen a61c1c9648
fix(scope): node_modules and the Claude Code plugin dir are foreign
A target with no .git of its own under cwd shares cwd's git root, so the
v8.1.1 rule alone called it own: an installed package under a repo and a
plugin-cache copy still had their .llm-security-ignore / policy.json read.

Chosen (PM rule, order 20260922T192716Z): a target is additionally foreign
when the path from cwd to it has a node_modules segment, or when it lies
under $CLAUDE_CONFIG_DIR/plugins (default ~/.claude/plugins). Because those
are the two concrete places foreign code lands under a user's working
directory, the failure direction is safe (foreign means more findings), and
a general "no .git of its own" rule would shut out ordinary subdirectories
of the caller's own repo. git archive exports stay indistinguishable from
own subdirectories; documented as a known limit in the module header.

Red first: 6 unit + 6 orchestrator assertions failed before the fix;
known-positives (plain subdir, workspace package dir, rest of config dir)
passed before and after.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-22 21:32:40 +02:00
..
e2e test(llm-security): build poisoned fixtures at test time, never on disk 2026-09-22 13:07:38 +02:00
fixtures test(ast-taint): materialize the ast-scan fixtures at test time 2026-09-22 14:11:27 +02:00
golden refactor(llm-security): build the SIG ruleset from vendored commons (malware-signatures 0.1.0) 2026-08-13 21:28:14 +02:00
helpers fix(policy): read policy.json only from the caller's own working tree 2026-09-22 20:15:17 +02:00
hooks refactor(llm-security): build the secret table from vendored commons (secret-egress 0.3.0) 2026-08-13 21:10:14 +02:00
lib fix(scope): node_modules and the Claude Code plugin dir are foreign 2026-09-22 21:32:40 +02:00
scanners fix(scope): node_modules and the Claude Code plugin dir are foreign 2026-09-22 21:32:40 +02:00
av-surface.test.mjs test(ast-taint): materialize the ast-scan fixtures at test time 2026-09-22 14:11:27 +02:00