gh secure: The GitHub Tool That Locks Down Your Repo in 2 Minutes
GitHub Security Lab's gh secure extension turns on branch protection, secret scanning, Dependabot, and CodeQL for your repo with one command, no cybersecurity background needed.
When weâre vibe coding, we just want to ship. We do not want to spend an afternoon clicking through 30 different GitHub settings pages to set up branch protection and code scanning. So⌠we just donât. And that leaves our repos wide open.
GitHub Security Lab quietly released a tool that fixes this, and you donât need to know anything about cybersecurity to use it.
What is gh secure?
Itâs an extension for the GitHub CLI (the gh command you type in your terminal instead of clicking around github.com). Itâs called gh-secure, and its whole job is turning on the security settings most of us skip.
Install it once:
gh extension install GitHubSecurityLab/gh-secureThen, inside your project folder, run:
gh secureThatâs literally it. In under two minutes, it sets up:
- Branch protection, so nobody (including a very enthusiastic AI agent) can overwrite the main version of your code.
- Secret scanning, which catches API keys you accidentally committed before they end up somewhere they shouldnât.
- Dependabot, which flags vulnerable packages your app depends on and opens updates for them.
- CodeQL scanning, which looks for security bugs in your code before you merge them.
Youâll need the GitHub CLI installed and signed in, and admin access to the repo. If itâs your own project, youâve got that.
You donât even have to leave your editor
My favorite part: you can hand this to your AI coding agent. In Claude Code (or whatever you build with), just say:
Run gh secure and enable all recommended features.Itâs free for open source projects. Nothing about your actual code changes; these are guardrails around it.
The takeaway
Security doesnât have to be a whole separate career you study for before youâre allowed to ship. Sometimes itâs one command. Go run it in your repo right now.
Want more vibe-code-securely tips like this? Join my newsletter.
Happy building!
Kedasha
This post was written with the help of AI from a human-written YouTube script.
-
The 10-Second Test That Protects Your Vibe-Coded App
-
Never Write Custom Date and Time Logic With AI
-
The Terrifying Fine Print of Personal AI Agents
Related Posts:
Written by
Kedasha Kerr
Software Developer
in Chicago
I write about building with AI.
Let's stay connected! đ
Get the next post delivered to your inbox and follow me on Instagram for daily AI tips and coding content.
See you on Instagram!