Safeguard
Developer Tools•

Can a Brewfile be your record of the tools on a dev laptop?

A Brewfile declares the packages you want installed and can be dumped from a machine. Use it as a reviewable inventory of laptop tooling, with limits.

Safeguard Security Team
3 min read

Yes, partly. Homebrew Bundle reads a Brewfile that declares the state you want, and brew bundle dump can write one from what is installed. Stored in version control, it becomes a reviewable inventory of Homebrew tools. It does not cover software installed by other means, so treat it as one list among several.

What a Brewfile is

The Homebrew documentation describes Homebrew Bundle as a declarative interface for installing and upgrading packages and starting services. Rather than listing the commands you would run, you list the state you want. A simple Brewfile contains a line such as brew followed by a package name in quotes. Running brew bundle then installs what is missing.

The documentation also describes entries for tools installed with other managers, including cargo and uv, in the current version of that page. Check the page for your Homebrew version before relying on it.

Why it helps security

An inventory answers questions that otherwise take an afternoon:

  • What is installed on this laptop, and who decided that?
  • Did this tool arrive through a reviewed change or a one-off command?
  • If a package is reported as compromised, do we have it?

A file in a repository can be diffed. A new line shows up in a pull request, where a teammate can ask why. That beats a laptop where tools accumulate silently.

How to build one

  1. Dump the current state to a file using brew bundle dump.
  2. Open the file and delete anything you no longer use.
  3. Add a short comment above anything unusual saying why it is there.
  4. Commit it to a private dotfiles or team tooling repository.
  5. Review changes to it like any other dependency change.

Do not put secrets in this file. It should hold package names and sources only. Our post on dev container and dotfile posture discusses what belongs in shared setup repositories.

What it will not tell you

A Brewfile lists what you declared. It does not list:

  • Global npm packages, covered in where npm install -g puts packages.
  • Python tools installed by pip or similar.
  • Apps dragged into the Applications folder or installed by a vendor installer.
  • Editor extensions.

Pair it with the checklist in listing every command line tool you installed.

Keeping it honest

A file that is never compared with reality drifts. Once a quarter, dump a fresh copy and diff it against the committed one. Anything installed but not recorded either gets recorded or removed. Anything recorded but not installed is stale and should be deleted.

Try it yourself

Click through it at your own pace, or open it full screen.

Notice that the inventory lists each item with its source and version. Aim for the same fields in your laptop record.

Quick check

Does brew bundle install tools I have not listed?

No. It installs what the Brewfile declares. It does not add extras on its own.

Should a Brewfile contain tokens?

No. Keep it to package names and sources, and store secrets elsewhere.

Sources

Last reviewed: 19 October 2026.

Never miss an update

Weekly insights on software supply chain security, delivered to your inbox.

Self-healing security runs on Safeguard.

Your first fix PR is minutes away.

No sales call required, even your agent can complete the purchase over MCP.