Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hashield-0.1.0.tar.gz (4.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

hashield-0.1.0-py3-none-any.whl (5.3 kB view details)

Uploaded Python 3

File details

Details for the file hashield-0.1.0.tar.gz.

File metadata

  • Download URL: hashield-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

Hashes for hashield-0.1.0.tar.gz
Algorithm Hash digest
SHA256 722355441c03f9e32fb5c8d9c2786569e276cded0e88e92ff69654ab01c067a7
MD5 7d8bee71aa71a45638874feac41fdaa3
BLAKE2b-256 e5b66463849c4eefa616c853860f1f464096034e99c35c74910484b10212d95d

See more details on using hashes here.

File details

Details for the file hashield-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: hashield-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.12

File hashes

Hashes for hashield-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2a50dc962855b564e4d2702c3427e11a0f1f010277ebe092fc2955c114301e9d
MD5 609f7dbca0955d7cbf9f528e74ddaab9
BLAKE2b-256 f8ede7e7f935066ca3606d18485d8474531024c027f7b66848f3049ee2d6e15f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page