I run a few AI agents on my homelab. They can’t change network, VMs or cloud directly. Every change goes through an approval gate outside the agent, and an approval is tied to one specific plan. So I assumed my agent config was in decent shape.
I wrote a small linter to check that and ran it on my own machine. The permissions were tight. But ~/.claude.json held 6 access tokens for MCP servers in plain text. The permissions were fine, the file next to them wasn’t.
It reads Claude Code (settings.json, ~/.claude.json), .mcp.json, Cursor, VS Code and Claude Desktop configs. 14 rules, for example:
Bash(python3:) looks narrow, but it’s basically Bash(). Same for sudo:* and npx:*.
Allowing a whole MCP server also allows the write tools it gets later.
Unpinned npx/uvx packages pull the latest version on every start.
Plaintext tokens (masked in the output), bypass mode, shell plus open WebFetch, missing deny rules, --privileged/Docker socket, remote servers over http://.
A finding is a question, not a vulnerability. My first version flagged exact commands like Bash(bash script.sh). That was noise, so now only wildcards trigger. It only reads local config, it doesn’t query servers or look at tool descriptions.
Try it python3 agentlint.py
One file, standard library only, read-only, no network, MIT: https://github.com/airbone42/agent-permission-linter
Disclosure: the output ends with a link to my write-up on approval gates for agents. AGENTLINT_GUIDE_URL= turns it off. Most of the code was written with Claude Code.
Which rule is missing, and which one gives you false alarms?
Top comments (1)
Nice catch on the tokens. One more rule worth adding, for repos you clone: a project can ship its own .mcp.json, and if enableAllProjectMcpServers is on (or someone approved the servers once), they start with your user's environment. Flagging that setting, plus any project .mcp.json that runs npx without a pinned version, covers the "config came from someone else" case.
For the tokens themselves, .mcp.json supports ${VAR} expansion, so the file can point to an env var instead of holding the secret.