A CLI tool for biometric authentication confirmation.
confirm-pam
is a command-line tool that provides biometric authentication (fingerprint/Touch ID) confirmation prompts. It's designed to prevent automated tools (including AI agents) from bypassing security checks like git commit --no-verify
.
$ confirm-pam "Allow commit with --no-verify?";
shows following dialog:
- β Touch ID authentication on macOS
- π Custom message display during authentication prompt
- π¦ Simple exit codes: 0 for success, 1 for failure/cancel, 2 for errors
- πͺΆ Lightweight binary with minimal dependencies
- π Fast native performance
cargo install confirm-pam
# Clone and build
git clone https://github.com/azu/confirm-pam
cd confirm-pam
cargo build --release
# Copy to PATH
sudo cp target/release/confirm-pam /usr/local/bin/
confirm-pam "Your authentication message here"
0
- Authentication successful1
- User cancelled authentication2
- Error occurred (biometrics unavailable, etc.)
if confirm-pam "Allow sensitive operation?"; then
echo "Authenticated - proceeding"
else
echo "Authentication failed or cancelled"
exit 1
fi
Override git
command to include confirmation prompts.
zsh example:
# Override git push -f and commit --no-verify
git() {
if [[ $@ == *'push'* && $@ == *'-f'* ]]; then
echo "Use git push --force-with-lease --force-if-includes instead"
elif [[ $@ == *'commit'* && $@ == *'--no-verify'* ]]; then
if confirm-pam "Allow commit with --no-verify?"; then
command git "$@"
else
echo "Authenticated Failed - Disallow the commit by human. Please wait and follow the instructions."
return 1
fi
else
command git "$@"
fi
}
Platform | Status | Authentication Method | Issue |
---|---|---|---|
macOS | β Supported | Touch ID | - |
Linux | π§ Planned | PAM + fprintd | #1 |
Windows | π§ Planned | Windows Hello | #2 |
- macOS 10.12.2 or later
- Touch ID capable device
- Touch ID must be configured in System Preferences
# Show available commands
make help
# Build the project
make build
# Run all tests (unit + lint + format check)
make test
# Run Touch ID integration tests (requires user interaction)
make dev-test
# Clean build artifacts
make clean
# Install to system PATH
make install
# Create releases with specific version bump
make release-patch # patch version
make release-minor # minor version
make release-major # major version
# Run tests
cargo test
# Run integration tests (requires user interaction)
./test_touchid.sh
# Build for release
cargo build --release
# Format code
cargo fmt
# Run linter
cargo clippy
This project uses local manual releases with make commands:
# Patch release (0.1.0 β 0.1.1): Bug fixes, small improvements
make release-patch
# Minor release (0.1.0 β 0.2.0): New features, enhancements
make release-minor
# Major release (0.1.0 β 1.0.0): Breaking changes, major releases
make release-major
- β
Version bumped in
Cargo.toml
using semver - β Git tag created and pushed
- β Published to crates.io
β οΈ GitHub release needs to be created manually
Contributions are welcome! Please see the open issues for planned features and improvements.
MIT License - See LICENSE file for details