Justin Schoenegge

Locking down my AI setup

I use Claude Code for almost everything I build here, so I took an evening to check what it's actually allowed to do on my Mac.

The audit. The basics of how my Mac is set up turned out to be the most important protection. The assistant's own allow list was a different story. Months of clicking "always allow" had built up a long list of rules, and some were broader than I'd meant them to be.

A password check for risky commands. Instead of trimming the list right away, I added a hook: a small script that runs before every shell command. If a command looks like it could compromise the machine, a dialog asks for my password first, and Cancel blocks it. I tested it against risky and everyday commands until it caught the first without getting in the way of the second. It's a safety net, not a wall.

Rotating a key. My stock chart project uses an Anthropic API key, and that key had ended up in a session transcript. It came up again during this cleanup, so I rotated it: made a new key, pasted it straight into the local secrets file (never into chat), and tested it with a check that only shows a status code.

Takeaways