Pre-commit security hooks are the gatekeepers. They run before a commit is saved to your repository. They scan code, check configs, and block commits that fail security standards. That means no secrets in history, no unsafe patterns, and no weak dependencies slipping through.
When security hooks run in a TTY (teletype) environment, they can interact with you directly. They can prompt for decisions, show warnings in real time, or require authentication. This is different from non-TTY environments like CI pipelines, where prompts fail or are ignored. With TTY-enabled pre-commit hooks, developers get immediate feedback before code leaves their machine.
A typical pre-commit security hook in a TTY uses lightweight scripts or tools like pre-commit with security-focused checks: