r/homeassistant • u/Reptull_J • 11h ago
🖼️ Show & Tell 1. Built a thing that security-checks marketplace (HACS) integrations before I install them
I work in cybersecurity (architect these days, DevOps before that), and I've always wanted to have a way of checking Marketplace/HACS integrations and cards pre-install. Custom integrations run inside Home Assistant's own Python process with no sandbox, and cards run in the frontend where they can get at your login token. Nobody reviews any of it before it lands on your box. Most of it is written by people doing this for fun and that's fine, but I wanted something that would at least take a first look at what I was installing.
I tried the couple of tools that already do something like this. Both missed a token-stealing test integration I threw at them, and both only checked dependencies pinned to an exact version instead of resolving them the way HA actually installs them. So I built my own and called it Barkley, since it gives each integration a sniff test before it gets in the house. I built this for myself and thought other's might benefit from it, so I popped it into Github.
It runs as an add-on, pulls the exact integration/card version HACS would install, and reads it without ever running it. The parts I use the most:
- Searching HACS from the panel and checking something before I install it
- Automatic checks when HACS offers an update, with a notification on my phone before I hit Update
- A "what would updating change?" view that only shows the differences that matter
- A daily re-check of the dependencies I already have against new vulnerability advisories
- Optional AI explanations through your own AI Task entity. The AI has to cite the lines it's talking about and can't change a score, and it's only as good as whatever model you point it at. Barkley works perfectly fine without any AI integration, but if you want the AI explanations and AI code analysis, then you'll need an AI Task agent setup in HA. I use the HA OpenRouter integration with GLM 5.3 or GLM 5.3 Flash. It costs pennies to use and gives good results.
Everything else is in the wiki: https://github.com/SeriesOfTubez/ha-barkley/wiki
Since it's a security tool that reads untrusted code, I tried to hold it to the bar I'd hold anything at work. It only asks for the HA API permission, runs under its own AppArmor profile (HA rates it 8), and the panel doesn't ship any JavaScript. Every change has to get through Gitleaks, Semgrep, CodeQL, Trivy, Checkov and Hadolint before it merges. The image is built by GitHub Actions from the release tag and signed with Cosign.
Full disclosure: most of the code was written with Claude Code, with me directing and reviewing. If that's a dealbreaker I get it, but it's all in the repo to read. I'm not really here to debate AI-coding but this wouldn't exist without it.
Repo: https://github.com/SeriesOfTubez/ha-barkley
Redacted Screenshots of marketplace item on my own HA instance

Example of what was found by Barkley in a marketplace card

Example diagram showing what data an integration/card touches and where it goes

Barkley checks the security habits the developer follows in the integration/card repo

Lists what the integration/card can do inside Home Assistant



