A mathematical, zero-latency prompt injection and AUP guardrail.
Project description
HaShield 🛡️
A lightweight, mathematically rigorous dual-layer guardrail for Large Language Models. HaShield provides zero-shot detection of prompt injections and prevents data exfiltration and harmful content generation with near-zero latency.
Installation
pip install hashield
from hashield.wrapper.decorators import protect_llm
MY_SECRET_PROMPT = "You are a helpful assistant. The admin password is 'SuperSecret123'."
@protect_llm(secret_prompt=MY_SECRET_PROMPT)
def my_llm_function(user_prompt):
# Your LLM call here
return "LLM Response"
*Save the file.*
### Step 4: Install the Build Tools and Compile
Now go to your PowerShell terminal. Make sure you are in `C:\HaShield\HaShield` and your `(venv)` is active.
First, install the tools that package your code:
```powershell
pip install build twine
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
hashield_guard-0.1.0.tar.gz
(4.4 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file hashield_guard-0.1.0.tar.gz.
File metadata
- Download URL: hashield_guard-0.1.0.tar.gz
- Upload date:
- Size: 4.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5df03913aab6559edd5318a457bc7815a3849b104233c206669b1105dbb57b30
|
|
| MD5 |
d97da0c7bcc17a24b0ee9f2745003aae
|
|
| BLAKE2b-256 |
b9d367bca4656c9f9d9bb99a1a047d33e36df0663f5d639501f0ecee0f9bd582
|
File details
Details for the file hashield_guard-0.1.0-py3-none-any.whl.
File metadata
- Download URL: hashield_guard-0.1.0-py3-none-any.whl
- Upload date:
- Size: 5.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5e675ab3fb8c288c83bd82c5bc85867ac60bebfaa0bcebc4e3227008277f84ad
|
|
| MD5 |
b016f94105df9a7f758aeb4381eedae9
|
|
| BLAKE2b-256 |
780a4ea7cfe127d13a8a2a6b3aa93ce1a7ecca0f45e923261a8c1461fd8e3d21
|