Repository navigation
Description
Problem
A filename-word denylist silently excludes files from the graph. It matches on the name only —
the content is never inspected — so design-system files called tokens.css / tokens.contract.json
are treated as credentials and dropped.
Discovered on a monorepo whose design tokens are generated artifacts with fixed names: the generated
tokens.css and the committed tokens.contract.json were both absent from the graph, announced by a
single line:
[graphify extract] 1 file(s) skipped as potentially sensitive (rename or move if wrongly flagged): tokens.css
Repro (deterministic on 0.9.34)
mkdir case && cd case
for n in tokens token mytokens design-tokens palette secrets credentials; do
echo ':root{ --a: #fff; }' > "$n.css"
done
echo 'def f(): return 1' > tokens.py
echo '{"a":1}' > tokens.json
echo '{"a":1}' > plain.json
graphify extract . --code-only --no-cluster --out /tmp/out --force[graphify extract] found 2 code, 0 docs, 0 papers, 0 images
[graphify extract] 2 file(s) not classified (no supported extension or shebang), skipped: mytokens.css, palette.css
[graphify extract] 6 file(s) skipped as potentially sensitive (rename or move if wrongly flagged):
credentials.css, design-tokens.css, secrets.css, token.css, tokens.css, tokens.json
The rule, as observed
| file | outcome |
|---|---|
tokens.css, token.css, design-tokens.css, secrets.css, credentials.css, tokens.json |
skipped as sensitive |
mytokens.css, palette.css |
not matched |
tokens.py |
not matched |
plain.json |
indexed |
Three properties, all of which look unintended:
- Content is never read. An empty file named
token.cssis skipped; a file namedpalette.css
containing a real API key is not. The check cannot do what its message claims. - The match is word-boundary aware, which makes it worse, not better.
design-tokensmatches
(separator-delimited wordtokens),mytokensdoes not. So the more conventionally named a
design-token file is, the more likely it is to be dropped. - It is extension-dependent.
tokens.pysurvives;tokens.cssandtokens.jsondo not. Same
word, same content-blindness, different outcome. (Also note.cssis not a supported code
extension at all —palette.csscame back "not classified" — yettokens.cssstill went down the
sensitive path, so the check runs ahead of classification.)
Why the suggested remedy does not work
The warning says "rename or move if wrongly flagged". For a generated artifact that is not
available: the name is fixed by the generator and asserted by a drift guard in CI. Renaming it to
please a scanner would break the build that produces it. In a design-system repo, tokens.* is close
to the single most likely filename to exist.
Suggested fix
Any of these would resolve it; roughly in order of preference:
- Inspect content. Gate the skip on an actual secret-shaped match (high-entropy string, known key
prefixes,PRIVATE KEYarmor). A:root{}block of hex colours is not that. - Drop
tokenfrom the name denylist, or require it to co-occur with a content signal.
secret/credential/passwordare far less ambiguous thantoken, which is ordinary vocabulary
in design systems, tokenizers, parsers and lexers. - Make it overridable — honour a
.graphifyignore-style allowlist, or add
--no-sensitive-filter. Today there is no flag to opt out; I checked--help. - Raise the reporting. One line in the middle of extraction output is easy to miss for a file
that then simply does not exist in the graph. If a file is excluded, it is worth being loud.
Happy to send a PR for (1) or (3) if you have a preference on shape.
Environment
graphifyy 0.9.34, macOS (darwin 25.5.0), Python 3.12, --code-only (no LLM backend involved).
Activity
sashankh commentedon Aug 20, 2026
Reproduced on current
v8(b2cd362, 0.9.48) — still live, and the behaviour splits into twodistinct problems that are worth separating, because only one of them actually costs you nodes.
Probing
_is_sensitive/classify_file/_is_graphable_sourcedirectly:_is_sensitiveclassify_filetokens.jsonFileType.CODEtokens.contract.jsonFileType.CODEplain.jsonFileType.CODEtokens.cssNonetoken.css,design-tokens.css,tokens.scssNonemytokens.css,palette.cssNonetokens.py,tokens.tsFileType.CODEapi_token.txt,oauth_token.json,credentials.json,.token1.
tokens.json/tokens.contract.json— genuine data loss. These classify asFileType.CODE, so graphify would index them (plain.jsonproves it), and Stage 3 drops themanyway.
.jsonis in_SECRET_PRONE_DATA_EXTS, so_is_graphable_source()returns False andthe
#1666source exemption never applies. This is the part that removes nodes from the graph.2. The
.csscases — a reporting defect, not data loss.classify_file()returnsNonefor
.css/.scsstoday, so those files were never graph candidates.palette.csssays soaccurately ("not classified — no supported extension"), while
tokens.cssclaims"skipped as potentially sensitive". Same extension, same non-outcome, two different messages,
and only the alarming one is wrong. That is what makes this hard to diagnose — it reads like a
security judgement about the file's contents when it is really just an unsupported extension.
(Note this interacts with #2698, which proposes classifying
.css: if that lands, category 2silently becomes category 1.)
Worth noting the asymmetry in category 1 is only about the
tokenkeyword's vocabulary. Thesame machinery is right for
credentials.jsonandoauth_token.json, and those must keepbeing caught — so "drop
tokenfrom the denylist" (your option 2) would regress the cases#436/#718/#2106were filed for. Any fix here has to keepoauth_token.json,api_token.txt,credentials.jsonand.tokenflagged while sparingtokens.json, which iswhy option 1 (a content signal gating Stage 3) or option 3 (an explicit override) look like the
only shapes that hold.
You offered a PR for (1) or (3) and there has been no steer since — is there a preference?
Happy to implement whichever you'd take. For what it's worth, (3) as a
.graphifyignore-styleallowlist has the useful property that it also covers the
.csshalf after #2698, and it doesnot require reading file contents in a module that is deliberately filename-only today.
Repro used (no LLM backend, deterministic):
Environment:
v8@b2cd362(0.9.48), Python 3.12.10, Windows 11 (not platform-specific).singhsatyampratap commentedon Aug 20, 2026
Thanks for reproducing this and separating the two cases, that distinction makes sense.
I wouldd prefer option 3, an explicit override/allowlist, as the first fix. I agree that simply removing
tokenwould risk regressing the legitimate credential cases.A
.graphifyignore-style allowlist would also give users a deterministic way to include known-safe generated files such astokens.jsonandtokens.contract.json, without changing the existing filename-based security behaviour.I’m also happy for the misleading
.cssreporting to be fixed separately, especially if #2698 lands.nothariharan commentedon Oct 9, 2026
Fixed by #4263, which supersedes #1921 (the
.graphifyincludeapproach, whose machinery was removed in #2112 and no longer exists on currentv8).Both halves of the report are addressed:
1. The
.csshalf was a reporting defect, not data loss..css/.scss/.lessare now classified as code and run through a new CSS/SCSS design-token extractor (#3473).tokens.cssis genuinely graphable now, so it is no longer reported as "skipped as potentially sensitive" for what was really an unsupported extension.2.
tokens.json/tokens.contract.json. #3527 deliberately keeps bare pluraltokensin data files excluded, so instead of weakening the default this implements the explicit override the issue asked for (option 3). A wildcard-free!pathentry in.graphifyignore(or--exclude) now overrides only the Stage-3 name heuristic:.env,id_rsa,server.pem) and credential-store directories are never rescued;!*.json) do not rescue, so a broad opt-in cannot silently ingest credential stores;/is anchor-exact;.graphifyignore/--excludeset is consulted, never.gitignore;tokens.json,oauth_token.json,api_token.txt,credentials.json,.token,secrets.jsonall stay skipped unless explicitly listed.oauth_token.json/api_token.txt/credentials.json/.tokenremain flagged.3. Reporting. The skip is no longer silent —
GRAPH_REPORT.mdgains a## Skipped Filessection naming every excluded file, and the CLI notice names the escape hatch.See #4263.
fix(detect,extract): explicit filter override, design-token files, .g…
fix(detect,extract): scope the Graphify-Labs#2498 override to explici…
fix(extract,detect): keep same-file token edges; anchor leading-slash…
fix(detect,extract): explicit filter override, design-token files, .g…
fix(detect,extract): scope the Graphify-Labs#2498 override to explici…
fix(extract,detect): keep same-file token edges; anchor leading-slash…