Contributing¶
Setup¶
git clone https://github.com/DodiBadshah/py-prompt-injection
cd py-prompt-injection
python -m venv .venv
.venv\Scripts\activate
pip install -e ".[dev]"
Running tests¶
pytest --tb=short
All 40 tests must pass before submitting a pull request.
Project structure¶
py-prompt-injection/
├── llm_probe/
│ ├── core/
│ ├── schemas/
│ ├── payloads/
│ ├── adapters/
│ ├── scoring/
│ ├── runner/
│ ├── reporting/
│ └── cli/
├── tests/
├── docs/
└── .github/workflows/
Adding a new adapter¶
- Create a new file in
llm_probe/adapters/namedyourprovider_adapter.py - Subclass
BaseAdapterfromadapters/base.py - Implement the
sendmethod following the existing adapter pattern - Add the adapter name to the CLI choices in
cli/main.py - Write tests in
tests/test_adapters.py
Adding new payloads¶
- Open the relevant YAML file in
llm_probe/payloads/catalog/ - Add a new entry following the existing schema
- Run the test suite to confirm the loader picks it up cleanly
Pull request checklist¶
- All 40 existing tests pass
- New tests added for any new functionality
- Docstrings added for new public classes and functions
- mkdocs build passes with no warnings