Skip to content

Check for secrets before commit and push #94

Description

@nasser1941

Problem

A model committed a camera password in source code, as a default configuration, and lcode pushed it to a public GitHub repository. Nothing warned anyone. Cleaning up took a history rewrite, a force-push and a password change, and GitHub still serves the old commits.

Proposal

  • Before git commit and git push: scan what's being committed or pushed for secrets: passwords and tokens in code, private keys, credentials in URLs (rtsp://user:pass@…), .env files.
  • When something is found, stop the command and show where. In ask mode, the user decides. In auto-edit and yolo modes it stays blocked, and the model is told to move the secret into configuration or the environment.
  • Pushing to a public repository gets a stricter check.
  • Patterns: use lcode's existing secret patterns (memory already has some) and add common credential forms.

Acceptance criteria

  • Commits and pushes that contain secrets are stopped, with the file and line
  • False positives can be allowed explicitly
  • Tests, docs

Activity

  1. nasser1941 commented on Oct 10, 2026

    @nasser1941
    OwnerAuthor

    Shipped in 0.26.0 (#102).

    PyPI build, checked without a model:

    • git add cam.py && git commit → cam.py:1: a password or key;
    • git push origin main with an unpushed commit → old.py:1 (commit f368f84): a password in a URL;
    • bash -c 'git add . && git commit …' → caught;
    • a docs-only commit → nothing.

    Before release, with qwen3.6-35b in yolo mode: asked to commit a camera config with a password, the commit was stopped, nothing was committed, and the model asked the user how to proceed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions