Living checklist · last updated
The Builder's Checklist: Securing AI Agents and Home Labs
By alkizz
Most AI security advice is either a 90-page framework or a warning about the robots coming for us. This is neither. It's a list of things you can check this week.
Each item has a why (one line) and a how (the quick version). The robot uprising is not on the list. Your exposed API key is.
This one is for builders: home labs and small teams running agents. Running a company? See The Business Checklist.
You've got Ollama or LM Studio humming, an agent harness with shell access, a Discord bot wired to it, and four MCP servers you installed because a README said so. Good. Let's make sure it's your agent.
Secrets & Keys
1. Get API keys out of your prompts, repos, and dotfiles.
- Why: Anything the agent can read, a prompt injection can ask it to repeat, and anything in git is forever.
- How: Use a secrets manager or at minimum env vars injected at runtime. Run
gitleaksortrufflehogon your repos. If a key ever touched a commit, rotate it. Don't just delete the line.
2. One key per tool, with a spend cap.
- Why: One shared "god key" means one leak burns everything, and a runaway loop can burn your credit card (OWASP calls this Unbounded Consumption, LLM10:2025).
- How: Separate keys per agent/integration, set hard budget limits and usage alerts in every provider console, and use fine-grained/read-only tokens wherever the provider supports them.
3. Treat your chat-bot token like a root password.
- Why: A leaked Discord/Slack/Telegram bot token lets anyone be your bot, including whatever tools it's connected to.
- How: Store it like any other secret, limit the bot to the servers/channels it needs, and know where the "reset token" button is before you need it.
Tool Permissions & Sandboxing
4. Run the agent as a nobody, in a box.
- Why: An agent with shell access runs with your privileges. That includes your SSH keys and browser profile.
- How: Run it in a container or VM as a non-root user, mount only the directories it needs, and never mount
~/.ssh,~/.aws, or your home directory "just to make it work."
5. Default-deny tools; require a human for anything destructive or outbound.
- Why: OWASP lists Excessive Agency (LLM06:2025) for a reason. The agent doesn't need
rm,git push, and "send email" to summarize a PDF. - How: Allowlist tools per task, keep confirm-before-execute on for writes, deletes, payments, and messages. Resist the "auto-approve everything" toggle, at least until you've read the logs for a week.
6. Break the "lethal trifecta."
- Why: Private data + untrusted content + a way to send data out = exfiltration waiting to happen (Simon Willison).
- How: For each agent, list which of the three it has. If it has all three, remove one: no outbound network, no access to secrets/private data, or no untrusted input.
Network Exposure
7. Make sure your local model server is actually local.
- Why: Ollama binds to
127.0.0.1:11434by default, but one config change exposes it. Cisco found 1,100+ exposed Ollama servers via Shodan, and SentinelLABS/Censys mapped ~175,000 hosts. - How: Check
OLLAMA_HOSTand LM Studio's server settings. Runss -tlnp(ornetstat) and look for0.0.0.0. Need remote access? Put it behind Tailscale/WireGuard or a reverse proxy with auth, never a raw port forward.
8. Keep the model runtime patched.
- Why: Model servers are software with CVEs like anything else, and a year-long study of exposed Ollama endpoints found very few vulnerable hosts ever upgraded in place.
- How: Subscribe to release notes for Ollama/LM Studio/your harness, update on a schedule, and don't run an old version just because it "still works."
9. Restrict the agent's egress.
- Why: Most exfiltration needs an outbound connection. No egress means fewer bad days.
- How: Firewall the agent's container to just the APIs it needs. A simple egress proxy with an allowlist beats a long list of rules you'll never maintain. The MCP security best practices recommend the same, plus blocking private ranges and
169.254.169.254.
Prompt Injection
10. Assume every web page, email, issue, and file the agent reads is hostile.
- Why: Prompt injection is LLM01:2025, and it works through content, not just the chat box. Invariant Labs showed a malicious GitHub issue could steer an agent into leaking private repo data into a public PR.
- How: Don't give an agent that browses or reads inboxes the same tokens that touch private data. Scope tokens to one repo/one mailbox, and review what it's about to do before it does it.
11. Don't trust the output either.
- Why: Model output that gets executed, rendered as HTML, or passed into SQL is Improper Output Handling (LLM05:2025).
- How: Treat model output like user input. Escape it, validate it, and never pipe it straight into
eval, a shell, or a database query.
Plugins / MCP Supply Chain
12. Vet MCP servers like you'd vet a stranger's shell script, because that's what they are.
- Why: The postmark-mcp npm package shipped 15 clean versions, then added one line in 1.0.16 that BCC'd every email to the attacker (Postmark's notice).
- How: Install from the vendor's official repo, check the publisher, pin exact versions (no
npx some-server@latestin your config), and read the diff before upgrading anything that touches email, files, or credentials.
13. Scan tool descriptions, and watch for "rug pulls."
- Why: Tool poisoning hides instructions in tool descriptions the model reads but you don't, like an "add" tool that also quietly reads
~/.ssh/id_rsa. Descriptions can also change after you approve them. - How: Read the full tool descriptions, run a scanner like mcp-scan, pin/hash tool definitions, and don't mix untrusted servers in the same session as ones holding sensitive access.
Logging & Kill Switch
14. Log every tool call, with arguments.
- Why: When something weird happens, "the AI did it" is not an incident report.
- How: Log tool name, arguments, timestamp, and result to somewhere the agent can't write to or delete. Skim it weekly; you'll be surprised.
15. Have a kill switch you've actually tested.
- Why: At 2 a.m. you want one command, not a scavenger hunt.
- How: Write down how to stop the agent, revoke its keys, and disconnect the bot. Script it (
docker stop, key revocation, token reset) and test it once.
Harness Settings
16. Use the harness's own locks, not just your container.
- Why: The harness decides what the agent may run before your sandbox ever sees it, and "bypass permissions" mode skips that check.
- How: Claude Code: set
permissions.denyrules andpermissions.disableBypassPermissionsMode: "disable", then confirm with/status(docs). Codex: restrictallowed_sandbox_modesso--yolo/danger-full-accessis off the table (docs). Gemini CLI:security.disableYoloMode(docs).
17. A name-based MCP allowlist is a label, not a lock.
- Why: Anyone can name a server "github." Claude Code's own docs say matching by
serverName"is not a security control" (docs). - How: Match by what actually runs:
serverUrlorserverCommand(exact argv) in Claude Code,identity = { command = ... }/{ url = ... }in Codex (name and identity must match). Gemini CLI'smcp.allowedand similar lists match by name, so treat them as convenience. Cursor'smcpAllowlistonly decides which tools auto-run, not which servers load.
Agent Stack & Config
18. Put a real login in front of every agent app, API and webhook, not just the model server.
- Why: Item 7 locks the model server's door, but the agent apps around it keep shipping with the door open. Langchain-Chatchat's API binds
0.0.0.0:7861with no auth and will run its shell tool for anyone (Lasso). Archon's control API sits on0.0.0.0:3090with no auth (VulnCheck; port per the finder). And DB-GPT's "auth" is a mock that hands every caller admin (Lasso). - How: Run
ss -tlnpand list everything listening, not just the model server: workflow builders, agent UIs, MLflow, dashboards, webhook receivers. Bind each one to127.0.0.1. In Docker, that means-p 127.0.0.1:<port>:<port>, because plain-pis "insecure by default". Turn on the app's own login where it has one (mlflow server --app-name basic-authper MLflow,LANGFLOW_AUTO_LOGIN=falsefor Langflow). Give every webhook route its own secret. Anything you need remotely goes behind Tailscale/WireGuard or a proxy that requires a login. Then curl the API from another machine with no credentials. A login screen in the browser proves nothing; a 401 from the server does.
19. Treat AGENTS.md, CLAUDE.md and repo config as code, and never start an agent in Downloads or an untrusted repo.
- Why: Agents read these files at startup and do what they say. Forever Security caught one planted
AGENTS.mdin a customer's~/Downloadstelling Codex to install a malicious npm package. Nobody knows how it got there, but Forever says a web page can save a file there with no click (Forever). Aider auto-loads.aider.conf.ymlfrom the repo with no trust prompt, and two of its keys run as shell commands (VulnCheck). - How: Don't start Codex, Claude Code or any other agent in
~/Downloadsor any folder other people can write to. Before an agent opens a repo you didn't write, read itsAGENTS.md,CLAUDE.md,.claude/settings.jsonand.aider.conf.ymlyourself, and look for commands, new MCP servers, or an API URL you didn't set. Check~/.codex/config.tomlfor[mcp_servers.*]blocks you didn't add, because that file applies to every Codex session on the machine. Open repos you don't trust only in a throwaway VM or container. For Aider there's no fixed version yet: 0.86.2 is the latest on PyPI and the issue is still open.
20. Test your approval prompts on every path, not just the chat window.
- Why: An approval gate only protects the paths that actually go through it. OpenSRE's shell tool never opts into its gate, and on gateway and scheduled runs the gate "approves everything automatically" (Lasso). EvoScientist's async sub-agents were built with no approval gate at all (Lasso). And in Archon's default install, the finder's reading of the source shows the API call behind "approve" takes no credential, though the finder didn't send that request to a live server (the finder; VulnCheck confirms the
/api/*control API has no auth). - How: List every way your agent can run: chat, scheduled jobs, background tasks, sub-agents, headless or CLI mode, webhooks, and chat-app gateways. Push a harmless canary like
id(what Lasso used) through each one, and see whether anything asks you first. If nothing asks, assume nothing will. Make sure whatever approves an action needs a login too (item 18). Keep auto-approve flags away from channels you don't control. Re-run the test after upgrades, because a fix for one path doesn't prove the others.
21. Know where your AI tools keep their logins and settings, and check them for changes you didn't make.
- Why: Your coding agent's token and config often sit in plain files on disk, and other people want both. Check Point found an infostealer whose
aisessionshandler grabs files like.claude\credentials.json,.codex\auth.jsonand Cursor'sstate.vscdb(Check Point). Symantec found a relay script that rewrites~/.codex/config.tomlor~/.claude/settings.jsonso every request goes through someone else's server, and for Codex it sets the sandbox todanger-full-access(Symantec). And a backdoored Claude Code extension in Cursor's marketplace added an attacker's SSH key, labeledsvc-telemetry, toauthorized_keys(Cursor). - How: List the credential and config files for every AI tool you run. Check Point's tables give the Windows paths, and each tool's own docs give the rest (Anthropic's docs, for example, name Claude Code's file
~/.claude/.credentials.json, or the Keychain on macOS). Where you can, swap long-lived keys on the laptop for short-lived credentials, so a copied file stops working sooner. That shrinks the window; it doesn't close it. Then check those files now and then for things you didn't set:base_urlorANTHROPIC_BASE_URLpointing somewhere new,sandbox_mode = "danger-full-access", an[mcp_servers.*]block you didn't add, base-URL, API-key or auth-token environment variables you didn't add (Symantec namesOPENAI_BASE_URL,CODEX_API_KEYandANTHROPIC_AUTH_TOKEN), and keys in~/.ssh/authorized_keysyou don't recognize. Keeping a copy of the config files (not the credential files) in a local git repo you never push turns "what changed?" into onegit diff. Check the copies for keys first, becausesettings.jsonandconfig.tomlcan hold them too.
22. Pin the agent stack itself (packages, images, extensions) to exact versions, and let new releases age before you take them.
- Why: Poisoned releases don't stay up long, and they don't need to. LiteLLM's trojanized 1.107.0 was on PyPI for about two hours, and its Docker
latest,main-latestandmain-stabletags pointed at the bad image for under three. LiteLLM says you were affected if you "used an unpinned version" or one of those tags in that window (LiteLLM). Malicious builds of the Claude Code extension sat in Cursor's marketplace from about 2:27am to 1:35pm PT on Oct 29 (Cursor). Item 12 pins your MCP servers; the rest of the stack deserves the same. - How: Pin Python packages with hashes (pip's
--require-hashes), container images by digest instead of tag (Docker calls a digest an "immutable identifier"), and editor extensions to exact versions withextensions.allowed(Cursor, VS Code). A pin only protects you until you bump it, so make every bump wait: uv'sexclude-newertakes a duration like7 days, and Cursor's install cooldown (extensions.installCooldownHours) won't install or update to an extension version until it has been on the marketplace for a set number of hours. If a security fix can't wait, skip the delay for that one release once the vendor's own advisory confirms it (uv'sexclude-newer-packagecan exempt a single package). Upgrade on purpose, on your schedule (item 8), not wheneverlatestmoves.
23. Know what your agent remembers, and don't let untrusted content write to it.
- Why: Memory turns a one-off prompt injection into a standing order. Johann Rehberger showed that an untrusted web page or document could get ChatGPT's memory tool to save instructions that then sent everything the user typed to an attacker's server, in every new chat after that one. OpenAI fixed the leak in the macOS app in September 2024 (version 1.2024.247), but Rehberger wrote that a website or untrusted document "can still invoke the memory tool to store arbitrary memories" (Embrace The Red). Anthropic's Zero Trust guide for agents lists memory poisoning next to prompt injection and tool poisoning, and counts "memory protected against poisoning" among the principles (Anthropic).
- How: Find where each agent keeps what it remembers: a memory settings page, a notes folder, instruction files it's allowed to edit, a vector store. Read it now and then, and delete anything you didn't put there, especially anything phrased as an order ("always", "from now on", a URL to send things to). On agents that read web pages, email, docs or tool output (item 10), turn automatic memory writes off, or make the agent propose a memory and wait for you to approve it. Keep those files out of reach of other agents, plugins and MCP servers, read-only at most (item 4). And keep a versioned copy, like the local git repo in item 21, so after an incident you can roll memory back to a known-good point instead of guessing what to delete.
🧰 If You Only Do Five
- Rotate and scope your keys. Per-tool keys, spend caps, nothing in git. (Items 1-2)
- Close the ports. Model servers on localhost or behind a VPN, never raw on the internet. (Item 7)
- Sandbox and default-deny. Agents in containers, minimal tools, a human approves destructive or outbound actions. (Items 4-5)
- Pin and vet your MCP servers/plugins. Official sources, exact versions, read the diff. (Item 12)
- Have a kill switch you've actually tested. One command to stop the agent, revoke its keys, and disconnect the bot. (Item 15)
The Closer
None of this is exotic. It's least privilege, patching, egress control, supply chain hygiene, and "call them back before you wire the money," applied to a new kind of software that happens to take instructions from anything it reads. The models will keep getting better. The basics will keep mattering more.
Start with the five. Then come back for the rest. And if you're also on the hook for a company's AI, keep going with The Business Checklist.
Changelog
- Nov 1, 2026: Added items 18–22 in a new Agent Stack & Config section (a real login on every agent app and webhook, repo instruction files, testing approval prompts on every path, where AI tools keep their logins and settings, and pinning the agent stack itself).
- Oct 16, 2026: Added items 16–17 on harness settings (permission locks, and why name-based MCP allowlists aren't a boundary).
- Oct 14, 2026: First published.