Thank you for your interest in contributing to PIF! This document provides guidelines for contributing.
- Fork the repository
- Clone your fork:
git clone https://github.com/YOUR_USERNAME/prompt-injection-firewall.git - Create a branch:
git checkout -b feature/your-feature - Make your changes
- Run tests:
go test -race ./... - Submit a pull request
# Install dependencies
go mod download
# Run tests
go test -v -race ./...
# Run linter
golangci-lint run
# Build binaries
go build ./cmd/pif-cli/
go build ./cmd/firewall/- Add patterns to the appropriate YAML file in
rules/ - Follow the existing format (see
rules/jailbreak-patterns.yaml) - Include both true-positive and true-negative test cases
- Run the benchmark suite to verify accuracy
- Follow standard Go conventions (
gofmt,goimports) - Write tests for all new functionality
- Maintain >80% test coverage
- Use
log/slogfor structured logging
Use conventional commits: feat:, fix:, docs:, test:, refactor:, chore:
See SECURITY.md for reporting security vulnerabilities.