MinGent Windows AI Agent: How It Resists Supply-Chain Attacks
Agent Stack Footprint One npm install can quietly pull in over four hundred packages you never read. For an AI agent with shell access, that's not clutter, that's attack surface. MinGent, a Show HN project, pitches the opposite for Windows: a small agent built to resist supply-chain attacks, with a

One npm install can quietly pull in over four hundred packages you never read. For an AI agent with shell access, that's not clutter, that's attack surface. MinGent, a Show HN project, pitches the opposite for Windows: a small agent built to resist supply-chain attacks, with as little third-party code as possible. Check the repo for specifics. Here I'll break down the design principles behind that idea, and the patterns you can steal for your own agents today.
First, a takeaway you can use in five minutes. Before trusting any agent, have your own assistant audit its dependencies. This prompt is read-only. It lists every import, asks whether the standard library could replace it, and scores the risk from one to five. Read-only matters. An auditor that can edit files is just another way in.
You are a dependency auditor. List every third-party import in [REPO_PATH]. For each: purpose, stdlib alternative, risk 1-5. Flag any install-time scripts. Output a table. Do NOT edit files. Enter fullscreen mode Exit fullscreen mode Here's why this matters so much for agents. A bug in a normal library is a bug. A compromised package inside an agent inherits the agent's powers: your files, your shell, your network, your tokens. So dependency count stops being a style preference and becomes a security number. Attackers know it, which is why hijacked maintainer accounts and typosquatted names keep appearing in registries.
Step one: lean on the standard library. Every package you skip is one fewer maintainer account an attacker can hijack. Step two: pin what remains by hash, not just version. A version tag can be republished. A hash can't be faked. Step three: vendor the code. If the whole agent fits in a folder you can read, you can actually review updates. Step four: deny network by default, then allowlist specific hosts. A hijacked package can't phone home to a host you never approved.
The model proposes an action. Treat that output as untrusted text, no matter how confident it sounds. The agent parses it into a structured tool request: a tool name and typed arguments, nothing free-form. A policy layer written in plain code checks the request. Is the path inside the workspace? Is the command on the allowlist? Approved calls run in a sandbox: a low-privilege Windows user, restricted folders, no ambient credentials. Everything lands in an append-only log, so you can replay exactly what the agent did. That log is also your incident report.
The principle underneath all of it: trust the policy, not the model. Prompts are suggestions. Code that rejects a bad path is a guarantee. Put your security rules where an injected instruction can't rewrite them. A hidden instruction in a webpage or a README can fool the model, but it can't fool a path check.
Start with a lockfile diff. Any new or changed dependency fails the build until someone explains it. Verify hashes on install. If a package's contents change under the same version, the install stops. Run a static scan for install-time scripts, obfuscated strings, and unexpected network calls. Finish with a human. A small diff on a small codebase is a review that actually gets done.
Here's what hash enforcement looks like in practice with Python's installer. Every requirement must carry a hash. It's a small flag with big consequences. Three packages verify cleanly. A fourth is blocked because it's unpinned. That failure is the feature: fail closed, then decide on purpose. Yes, it's slightly annoying, and that friction is cheap insurance.
$ pip install --require-hashes -r requirements.txt ✓ 3 packages hash-verified ✗ Blocked: unpinned dependency 'helper-lib' → Add a hash or remove it Enter fullscreen mode Exit fullscreen mode Harden Your Agent This Week Count your dependencies today and set a budget. Dozens is fine for a big app. For an agent, aim for single digits. If the number surprises you, that's your first finding. Wrap shell and file tools in allowlists. No raw command strings straight from the model. Run the agent as a low-privilege account. On Windows, that also means a separate profile with no saved credentials. Log every tool call with its arguments and result. If something goes wrong, replay beats guessing.
Then use Claude Code as your reviewer. Point it at your tool wrappers and ask specifically about path escape. On Windows, watch for mixed slashes, short 8.3 names, and symlinks. One unchecked path join can undo your whole sandbox, so keep the fix and add a test.
$ claude -p "review tool wrappers for path escape" ✓ Scanned 6 tool handlers → Found 1 unchecked path join ✓ Patch proposed, tests 14/14 passing Enter fullscreen mode Exit fullscreen mode Ship It That's the pattern: fewer dependencies, hard policy, full logs. Build the smallest version of it this week. Follow for more agent engineering breakdowns.