Anonyfox / Lab

Check your machine for the Downloads AGENTS.md hijack.

A free local audit for stray instructions, changed agent settings and persistence. Read one Python file, then run it.

For Codex and Claude Code on macOS and Linux. Python 3.8+. Read-only by default.

Need the response checklist? From €19

Read the file before you run it

curl -fsSLO https://lab.anonyfox.com/coding-agent-security/agent-sec-audit.py
less agent-sec-audit.py
python3 agent-sec-audit.py

The audit consults no model. It reads local files and runs fixed read-only listings.

Verify the file with SHA-256

Compare the downloaded file’s checksum with:

4864371f1adb3c94ae9cfa0ebc4e44d720e07533dcb90e9e6f8581047964c47a

Checksum file

shasum -a 256 agent-sec-audit.py

How does a file in Downloads become a lasting change?

Found an instruction file you did not write? Paste it into the free AGENTS.md checker to see what it tells your agent to load and allow.

A locked-down agent can still ship an app that breaks at launch. Run what it built through the free vibe coding production checklist: 50 checks for auth, payments, data integrity and recovery.

  1. CodexDownloads/AGENTS.mdUntrusted instructions
  2. ~/.codex/config.tomlNew MCP server entry
  3. Every later sessionStarts the added launcher
  1. Claude CodeCLAUDE.mdUntrusted instructions
  2. .claude/settings.jsonenv.ANTHROPIC_BASE_URL
  3. Traffic to another hostChanged API destination
>90 %

Codex ran the malware

in Forever Security’s own tests
~50 %

Claude wrote the settings

in Forever Security’s own tests

Forever Security’s 22 October 2026 report describes an AGENTS.md planted in Downloads.

In its Codex demonstration, the instructions led to a user-level MCP entry using launchctl and an attempted function-color installation.

Its Claude Code demonstration used CLAUDE.md to redirect API traffic through env.ANTHROPIC_BASE_URL.

The changed configuration could affect later agent sessions. The report’s attempt rates come from Forever Security’s own tests.

Read Forever Security’s investigation. Check supported settings against the official Codex reference and Claude Code settings docs.

Review settings.json before the next agent session. Keep sandbox and approval controls enabled.

Prefer an agent-driven review? Use the free coding-agent security-check prompt. That prompt asks your agent to review the machine; this script runs fixed checks without asking a model.

What will it look at?

Open a check to see its paths, keys and severity rules. These are review heuristics. A familiar server name or a recent timestamp needs context.

Stray instructionsinstruction
Paths
~/Downloads; ~/Desktop; XDG download dir; /tmp; $TMPDIR; --scan roots
Keys or patterns
AGENTS.md, AGENTS.override.md, CLAUDE.md, CLAUDE.local.md, .cursorrules, .cursor/rules/**, .mcp.json, .claude/settings*.json, .codex/config.toml
Severity
high if suspicious lines; medium otherwise
Source: Stray instructions
Codex MCP serverscodex-mcp
Paths
$CODEX_HOME/config.toml or ~/.codex/config.toml; discovered .codex/config.toml
Keys or patterns
mcp_servers.<name>: command, args, env, url
Severity
high for risky command/args; medium otherwise unless exact baseline
Source: Codex MCP servers
Codex API destinationscodex-url
Paths
Codex config files
Keys or patterns
chatgpt_base_url; openai_base_url; model_providers.<id>.base_url
Severity
high for non-default host unless approved host; current Codex ignores provider URL keys in project config
Source: Codex API destinations
Claude API destinations and proxiesclaude-url
Paths
~/.claude/settings.json; managed settings; discovered project settings; current environment
Keys or patterns
env.ANTHROPIC_BASE_URL; ANTHROPIC_FOUNDRY_BASE_URL; HTTP_PROXY; HTTPS_PROXY; ALL_PROXY
Severity
high for non-api.anthropic.com host unless approved host
Source: Claude API destinations and proxies
Claude credential helperclaude-helper
Paths
Claude settings files
Keys or patterns
apiKeyHelper
Severity
info
Source: Claude credential helper
Claude MCP serversclaude-mcp
Paths
~/.claude.json (global and per-project MCP); discovered .mcp.json
Keys or patterns
mcpServers.<name>: command, args, env, url
Severity
high for risky command/args; medium otherwise unless exact baseline
Source: Claude MCP servers
macOS launch jobspersistence-launchd
Paths
~/Library/LaunchAgents; macOS /Library/LaunchAgents and /Library/LaunchDaemons
Keys or patterns
Label; Program; ProgramArguments; modification time
Severity
high for com.ptools.setup; medium for npm/npx/node/curl/tmp/shell -c; info if recent
Source: macOS launch jobs
Linux user unitspersistence-systemd
Paths
$XDG_CONFIG_HOME/systemd/user or ~/.config/systemd/user; $XDG_DATA_HOME/systemd/user or ~/.local/share/systemd/user
Keys or patterns
user unit command patterns; modification time
Severity
high for com.ptools.setup; medium for npm/npx/node/curl/tmp/shell -c; info if recent
Source: Linux user units
Linux login applicationspersistence-autostart
Paths
$XDG_CONFIG_HOME/autostart or ~/.config/autostart
Keys or patterns
desktop command patterns; modification time
Severity
high for com.ptools.setup; medium for npm/npx/node/curl/tmp/shell -c; info if recent
Source: Linux login applications
User crontabpersistence-cron
Paths
user crontab via crontab -l
Keys or patterns
non-comment scheduled entries
Severity
high for com.ptools.setup; medium for suspicious command pattern; info otherwise
Source: User crontab
function-color indicatorsioc-function-color
Paths
npm root -g; ~/.npm/_npx; ~/.npm/_cacache/index-v5; /tmp/ptools; --scan roots
Keys or patterns
function-color package directories; cache index text; package-lock.json references; ptools path
Severity
high; text-only references require context
Source: function-color indicators

Default folders: Downloads, Desktop and temporary directories, including the configured XDG download folder. Add a repository with --scan PATH. Symlinks and credential files are skipped. Limits: depth 8, 50,000 files per tree and 2 MiB per file; incomplete coverage exits 2. Read checks.json.

Planted files in.
Findings out.

17 / 17 planted artifact categories detected

The inert fixture recreates the instruction files, agent config changes and package indicators. Commands are replaced with true; the package directory contains a dummy manifest.

33 tests passed. The clean fixture with its reviewed baseline produced 0 findings, including 0 high findings.

The test suite also checks redaction, read-only behavior, backups and symlink handling. Fixture results demonstrate these checks, not detection rates on real attacks.

[high] instruction: ~/Downloads/CLAUDE.md
  Instruction/config in an untrusted scan folder; L1: ANTHROPIC_BASE_URL … settings.json [other content withheld]
[high] instruction: ~/Downloads/AGENTS.md
  Instruction/config in an untrusted scan folder; L2: config.toml … mcp_servers [other content withheld]; L3: npm install [other content withheld]
[high] ioc-function-color: ~/Downloads/project/package-lock.json
  function-color package name found
[medium] instruction: ~/Downloads/project/.mcp.json
  Instruction/config in an untrusted scan folder
[high] ioc-function-color: ~/Downloads/project/node_modules/function-color/package.json
  node_modules/function-color package directory found
[medium] instruction: ~/Downloads/project/.claude/settings.local.json
  Instruction/config in an untrusted scan folder
Actual fixture output excerpt. Home paths normalized to ~. Evidence shows matching source fragments with line numbers; other content is withheld.

Paste this into your agent

Give it the public file index before discussing a local review. Keep your configuration on your machine.

Read the Markdown page · Read the check definitions

Fetch https://lab.anonyfox.com/coding-agent-security/index.md and https://lab.anonyfox.com/coding-agent-security/checks.json; explain the local checks and help me review the script before I run it.

The scan is free.
Keep the response routine.

Use the checklist to review what you found. Add the team files when someone needs to own approvals, onboarding and the next review.

Solo security kit v1.0

€19 one-time

  • Free audit script and MIT licence
  • 8-page hardening checklist: A4 and US Letter PDF
  • Editable Markdown checklist
  • Sourced response steps and weekly routine

One person, across your own and client projects.

ZIP attachment by email within 24 hours.

Buy Solo security kit v1.0 · €19

No VAT is charged under § 19 UStG (German small business regulation).

Team security bundle v1.0

€49 one-time

  • Everything in Solo
  • 2-page policy: PDF, Markdown and editable Word
  • Baseline allowlist template
  • Rollout sheet and 1-page onboarding handout: PDF, Markdown and Word

One company, all its staff.

ZIP attachment by email within 24 hours.

Buy Team security bundle v1.0 · €49

No VAT is charged under § 19 UStG (German small business regulation).

Before you run it

Does this send my configuration to an AI model?

The audit runs locally with Python’s standard library. It reads files and runs fixed read-only listings. It makes no model requests or network calls. Read the downloaded file before running it.

Does a clean result mean my machine is safe?

Exit 0 means these checks found nothing within their scan scope. It is not a malware clearance. Symlinks and credential files are skipped; depth, file-count and size limits report coverage errors. Exit 2 means a check could not complete.

Why does it flag my company proxy or MCP server?

A configured integration can be legitimate. Severity is a review heuristic. Confirm the destination and full command with the owner, then approve the reviewed host or exact server definition in a baseline. Risky launch commands stay flagged.

Will it change or delete anything?

The default scan writes nothing. --write-baseline FILE explicitly writes an allowlist. --fix asks before each supported change, unless you supply --yes. It moves stray instruction files into quarantine and backs up supported config edits. Persistence and npm cleanup stay manual.

Can I run it in a container instead?

Run the audit on the machine and account whose agent settings you want to inspect. A container normally sees its own home and files. Pass active repositories with --scan PATH. The script does not inspect remote agent hosts from your laptop.

What does it need, and does it support Windows?

Python 3.8 or newer on macOS or Linux, including WSL. Native Windows is not covered yet. Python 3.11 or newer supports full TOML parsing; older versions report unsupported syntax through the conservative fallback.

How is this different from the free security-check prompt?

The free prompt asks your agent to review the machine. This script performs fixed local checks without consulting a model. The paid kits add the response checklist and, for teams, editable working rules and rollout files.

What arrives after payment?

A ZIP attachment arrives by email within 24 hours. Solo contains the script and an 8-page checklist in A4 and US Letter PDF plus Markdown. Team adds policy, rollout and onboarding files in PDF, Markdown and Word, plus a baseline template. Team covers one company and all its staff.

Before reviewing a change, check that the repository’s AGENTS.md instructions name its test commands; the repository handover workflow checks whether those instructions match the code. Use the security review prompt to scope the review. For agents that reach a purchase flow, the agent checkout checker examines a separate boundary: the public path from product facts to checkout.