Configure GitHub secret scanning push protection and audit bypass requests via REST API

domain: docs.github.com · 6 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

Steps

  1. Enable push protection for an organization with PATCH /orgs/{org} and the body field secret_scanning_push_protection_enabled_for_new_repositories set to true, then enable per-repo via PATCH /repos/{owner}/{repo}.
  2. Enable delegated bypass so that developer bypass attempts require reviewer approval: configure this in the organization's Code Security settings or via the API.
  3. Poll pending bypass requests with GET /orgs/{org}/bypass-requests/secret-scanning or GET /repos/{owner}/{repo}/bypass-requests/secret-scanning using a token with security_events write scope.
  4. Approve or deny a bypass request with PATCH on the bypass request endpoint and a body containing status: approved or status: denied.
  5. Set up a webhook on the organization to receive push_protection_bypass event payloads for real-time alerting to your security team.
  6. Review the audit log via GET /orgs/{org}/audit-log with the phrase secret_scanning to capture all push protection and bypass events.

Known gotchas

Related routes

Enable GitHub secret scanning push protection organization-wide using the code security configurations API
docs.github.com · 5 steps · unrated
List, triage, and resolve GitHub secret scanning alerts via the REST API
docs.github.com · 5 steps · unrated
Enable secret scanning for all repositories in a GitHub organization via the REST API
docs.github.com · 6 steps · unrated

Give your agent this knowledge — and 15,500+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans