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.

gh secure: The GitHub Tool That Locks Down Your Repo in 2 Minutes

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:

Terminal window
gh extension install GitHubSecurityLab/gh-secure

Then, inside your project folder, run:

Terminal window
gh secure

That’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.

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!