Protocol

Know where secret protection blocks the change

A blocked push can keep a secret out of the remote repository. It does not undo a local commit or retract data already sent to a model or log.

About 2 min read

Before you use it

Use when
  • A coding agent may see local configuration, examples or logs containing credentials.

Keep this limit in mind

  • Secret scanning has coverage gaps and bypass paths; prevention still starts with credential handling and least privilege.

Current editorial reading

Put checks before each disclosure

Keep real credentials out of source and agent context. Use a local pre-commit check when the goal is to stop a credential entering local Git history, and verify which remote push-protection paths are enabled. GitHub also documents protection for some web and API writes; do not assume every entry path has the same coverage.

Clean the affected history before retrying

Suppose a generated fixture contains a live token and the command-line push is blocked. Replace the token with a non-secret fixture and remove it from the affected commits, not only the latest file. Investigate whether it reached another destination. If genuinely exposed, follow the provider’s revocation or rotation procedure. Detection supports credential hygiene; it does not replace it.

Take it with you

For the next blocked push, check every reported location and the path that exposed the value. Never use a real credential just to test whether a scanner will catch it.

Sources and evidence (3)

What we checked

Supports

GitHub push protection blocks detected secrets during supported push or hosted-write paths, including command-line pushes and GitHub UI commits.

Selected official documentation read on 2026-10-04. The local-commit distinction concerns command-line Git; the draft preserves the documented UI-commit exception.

Push protection · What is push protection?; How push protection works

Limits

Push protection has configuration-dependent coverage and documented bypass or exemption paths.

Selected Types of push protection and Push protection bypass and alerts sections read on 2026-10-04. No live scanner or repository configuration was tested.

Push protection · Types of push protection; Push protection bypass and alerts

Supports

Removing a secret from the latest file can leave it in Git history, and an exposed credential requires invalidation or replacement.

Selected official sections read on 2026-10-04. Response order remains provider-specific; a blocked push alone does not establish that there was external exposure.

Secret leakage risks · What are secrets?; How secrets get exposed

Provides context

OWASP advises keeping secrets outside project files that AI tools can read.

Section 9 read on 2026-10-04. This supports context minimization, not a claim that GitHub push protection controls prompts or logs.

Secure Coding with AI Cheat Sheet · Prompt Context Leakage and Sensitive Code Exposure, Do

Editorial sources (3)

Editorial version 1.0.0 · Evidence checked 2026-10-04

Save and practise this idea

My learning

Read. Recall. Repeat.

Save this idea and return to it on any device.

Use email
Keep exploring

Connected ideas

You are readingKnow where secret protection blocks the change

Original edition evidence and sources

These records belong to the original released edition. The current editorial reading has its own evidence above; neither set silently replaces the other.

Supports

GitHub push protection can block supported secret patterns before they reach protected repositories, while GitHub notes that scanning coverage has limits.

Not all secrets or encodings are detected, and bypass mechanisms exist.

Push protection · What is push protection; supported behavior

Supports

OWASP's current secure-coding-with-AI guidance treats repository content, issues, PRs, comments, fetched pages, logs and tool responses as potential indirect prompt-injection inputs for coding agents.

Threat likelihood depends on who can influence the content and what permissions the agent has.

Secure Coding with AI Cheat Sheet · Indirect Prompt Injection in the Development Loop

All sources (2)
Original edition, downloads and provenance

The reading above is editorial version 1.0.0, bound to this exact source edition. The original data and saved downloads retain that edition and the separate editorial layer. They may contain earlier wording; use the current reading above when interpreting it.

Version 0.1.0

No review details are supplied for this edition.

Read the original edition and overlay as JSON · Release details