AI-powered security auditor for AUR packages — scans PKGBUILDs, patches, and install scripts for malicious content. Integrates with yay, runs standalone, or fits any makepkg-based workflow.
For each package, aur-guardian asks an LLM to review:
- Source URLs — are they from the expected upstream domain, or redirected through a third party?
- Integrity — are checksums (
sha256sums,sha512sums,b2sums) present for all sources? Are anySKIPentries unjustified? - Build scripts —
curl|bash,evalon remote content,wgetpiped tosh, base64-decoded execution, unexpected outbound connections, obfuscated code - Patches — do diffs match their stated purpose? Any injected backdoors or writes outside the build directory?
- Install scripts — suspicious post-install commands in
.installfiles
Each package gets a verdict: CLEAN, WARNING, or SUSPICIOUS, with a brief explanation. Reports are saved to ~/.config/aur-guardian/reports/.
- Bash 4.4+
- GNU grep (for
-Pflag) - An LLM CLI that reads a prompt from stdin and writes the response to stdout (see LLM configuration)
- yay (optional, for automatic integration)
- jq (optional, used by
install.shto configure yay)
git clone https://github.com/YOUR_USERNAME/aur-guardian.git
cd aur-guardian
bash install.shinstall.sh will:
- Copy the scripts to
~/.config/aur-guardian/ - Check that your LLM CLI is available
- Optionally configure yay to use aur-guardian automatically
Set the AUR_GUARDIAN_LLM environment variable to any command that reads a prompt from stdin and prints the response to stdout. Defaults to claude -p.
# Claude Code CLI (default)
export AUR_GUARDIAN_LLM="claude -p"
# Ollama
export AUR_GUARDIAN_LLM="ollama run llama3"
# shell-gpt
export AUR_GUARDIAN_LLM="sgpt"Add the export to your ~/.bashrc or ~/.zshrc to make it permanent.
After running install.sh and accepting the yay configuration, aur-guardian runs automatically every time yay installs or upgrades AUR packages. It hooks into yay's editor step, which runs after PKGBUILDs are fetched but before packages are built.
$ yay -Syu
[aur-guardian] Checking google-chrome...
✓ google-chrome: CLEAN
Sources from dl.google.com with valid sha512sums, no suspicious build commands.
[aur-guardian] Checking some-package...
✗ some-package: SUSPICIOUS — review before proceeding!
build() downloads and executes a script from an untrusted domain via curl|bash.
→ Answer N at the next prompt to abort installation.
==> Proceed with installation? [Y/n]
Packages whose files have not changed since the last check are skipped instantly.
To configure yay manually (without install.sh):
yay --editor ~/.config/aur-guardian/aur-guardian.sh --editmenu --answeredit All --saveaur-guardian.sh /path/to/package/PKGBUILDUseful for reviewing a specific package before building it manually.
aur-guardian-scan.sh # scans ~/.cache/yay
aur-guardian-scan.sh /other/path # scans a custom cache directoryScans all PKGBUILDs in the cache, reports on anything that has changed since the last run. Handy as a periodic audit or before a batch upgrade.
EDITOR=~/.config/aur-guardian/aur-guardian.sh makepkgOr set it permanently in ~/.makepkg.conf:
BUILDDIR=/tmp/makepkgaur-guardian tracks file hashes in ~/.config/aur-guardian/file_hashes.sha256 to avoid re-analysing unchanged packages. To force a full re-analysis, delete that file:
rm ~/.config/aur-guardian/file_hashes.sha256Per-package reports are saved to ~/.config/aur-guardian/reports/<package>_<timestamp>.md.
MIT