Repository navigation
fix(docs): allow the AGENTS.md link through the llms leakguard - #21
Merged
Merged
Conversation
leakguard: llms-full.txt links to AGENTS.md (https://github.com/HaoZeke/eb-stack/blob/main/AGENTS.md); allowlist the URL in scripts/leakguard.toml or drop the link scripts/gen-llms-txt.py and the prek llms-leakguard hook read the same allowlist. The manual index URL is listed, so generation writes llms-full.txt.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What and why
llms-full.txtgeneration hits this line when the allowlist is empty:The manual index publishes that URL.
scripts/leakguard.tomlallowlists it.scripts/gen-llms-txt.pyand the prekllms leakguardhook read that file.Before and after
Before, an empty allowlist makes
scripts/llms_leakguard.pyexit 1 and print the line above.scripts/gen-llms-txt.pyexits 1 on the same line and does not write.After, the URL is in
scripts/leakguard.toml.python3 scripts/llms_leakguard.pyexits 0.python3 scripts/gen-llms-txt.pyrewrites nothing.python3 scripts/gen-llms-txt.py --checkexits 0.uvx prek run -aexits 0, includingllms leakguard.Tests
cargo +stable fmt --all --checkexited 0.cargo +stable clippy --locked --all-targets -- -D warningsexited 0.cargo +stable test --locked --all-targetsexited 0.1516 passed, 0 failed, 10 ignored.
tests/llms_txt.rsrunsscripts/llms_leakguard.pyand checks the allowlist URL.Note
Low Risk
Docs and CI hook changes only; no runtime or auth behavior. Risk is limited to false positives blocking llms regeneration if new instruction links are added without updating the allowlist.
Overview
Adds a llms leakguard that blocks markdown links to
AGENTS.md,CLAUDE.md, orGEMINI.mdin generated or committedllms.txt/llms-full.txtunless the URL is listed inscripts/leakguard.toml.scripts/gen-llms-txt.pyruns that check on the rendered content before writing or--check, so generation fails with the same messages as the standalone script. A new prek local hook (llms-leakguard,always_run) runsscripts/llms_leakguard.pyagainst the committed files;CHANGELOG.mddocuments both paths.The manual’s existing
AGENTS.mdGitHub link is allowlisted so index generation and hooks pass without dropping discovery links.tests/llms_txt.rsasserts the allowlist entry and thatllms_leakguard.pyexits successfully.Reviewed by Cursor Bugbot for commit a2bc888. Bugbot is set up for automated code reviews on this repo. Configure here.