PromptShield
Local cybersecurity and privacy tool suite for artificial intelligence workflows.
Purpose
Artificial intelligence models can record data that users transmit in prompts. This tool suite gives full-stack protection:
- PromptShield Pro: Detects and masks credentials, passwords, database URIs, and identity numbers before data leaves your computer.
- PromptShield Guard: Analyzes incoming user prompts in less than 0.2 milliseconds to block prompt injections, persona jailbreaks, and system prompt extraction.
All calculations run locally on your device with zero telemetry and zero network calls.
Live Interactive Sandbox
Test both engines directly in your browser:
👉 lorthris.github.io/promptshield
Architecture and Core Modules
c:/Drive/fun/
├── promptshield/
│ ├── detector.py # 50+ secret signatures, Luhn CC, ATO TFN, Shannon entropy
│ ├── redactor.py # Deterministic pseudonym substitution and restore mapping
│ ├── guard.py # Prompt injection, jailbreak, and leak defense engine
│ ├── clipboard.py # System clipboard background sanitiser
│ └── cli.py # Unified command-line interface
├── docs/ # Live interactive web application (GitHub Pages)
└── tests/ # 32 automated unit tests
Quick Install
Install directly via pip:
pip install git+https://github.com/lorthris/promptshield.git
Or run directly from the cloned repository without installation:
python -m promptshield.cli --help
Commands
1. Scan Files for Sensitive Credentials
python -m promptshield.cli scan path/to/file.txt
python -m promptshield.cli scan path/to/file.txt --json
2. Mask Secrets with Deterministic Pseudonyms
python -m promptshield.cli redact dirty.log --out clean.log --session incident42
3. Restore Live Secrets in Model Output
python -m promptshield.cli restore ai_reply.txt --session incident42 --out final.txt
4. Guard LLMs Against Prompt Injections and Jailbreaks
python -m promptshield.cli guard user_prompt.txt
python -m promptshield.cli guard user_prompt.txt --sanitize --out clean_prompt.txt
python -m promptshield.cli guard user_prompt.txt --json
5. Sanitise System Clipboard
python -m promptshield.cli clip
6. Install Automated Git Pre-Commit Hook
python -m promptshield.cli install-hook
7. GitHub Actions CI/CD Integration
# .github/workflows/security.yml
- name: PromptShield Security Scanner
uses: lorthris/promptshield@v1
Commercial Licences
Commercial developer packages are available on Gumroad with perpetual rights and free updates.
🎉 Launch Special: Use code LAUNCH20 at checkout for 20% off any tool or bundle.
| Package | Purpose | Price (USD) | Link |
|---|---|---|---|
| PromptShield Pro | Outbound secret & PII sanitiser, Git hook, clipboard daemon | $19 | Buy Pro Edition |
| PromptShield Guard | Inbound prompt injection, jailbreak & leak firewall | $19 | Buy Guard Edition |
| Complete AI Security Suite | Both full packages (Save $9) | $29 | Buy Complete Suite |
Testing
Run the automated test suite:
python -B -m unittest discover -s tests -p "test_*.py"
Release files for promptshield-core 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| promptshield_core-1.0.0.tar.gz | 20.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| promptshield_core-1.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 36.6 kB
Release files / promptshield_core-1.0.0.tar.gz
| Download URL | promptshield_core-1.0.0.tar.gz |
|---|---|
| Size | 20.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8eddc9a8a74cf0d547fd289f26d226adbf1609b712a143c3446665aa8b6d671b
|
|
BLAKE2b-256 checksum How to use checksums |
93b687be57914461b965ad4532f5ed1b7557226d6afbc118c0095093f0910ecc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 21, 2026.
Transparency logRelease files / promptshield_core-1.0.0-py3-none-any.whl
| Download URL | promptshield_core-1.0.0-py3-none-any.whl |
|---|---|
| Size | 16.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
af3963816b8893d4eabdf772e7454aa40ef7eb9f11637e226e223f8389e06712
|
|
BLAKE2b-256 checksum How to use checksums |
7c6f5410981cbc44de52ae793ef581c2cf3206c9cbe27a7c0dfac1acb6c6a46a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 21, 2026.
Transparency log