Read-only scanner for prompt-injection and LLM anti-analysis text in files before agent review
Project description
Prompt Injection Blocker
Read-only scanner for prompt-injection and LLM anti-analysis text in files before agent review.
This tool is meant for defensive intake: copied advisories, incident notes, third-party repositories, docs, issues, and fixtures that may contain text aimed at overriding an AI assistant or suppressing analysis.
It does not remove files, modify content, execute code, contact registries, or prove that content is safe.
Install
pipx install prompt-injection-blocker
# or
pip install prompt-injection-blocker
Python 3.9+. No runtime dependencies.
Usage
prompt-injection-blocker /path/to/project
prompt-injection-blocker /path/to/project --json
prompt-injection-blocker /path/to/project --report report.json
From a source checkout:
python -m prompt_injection_blocker /path/to/project
pip install -e ".[dev]" && pytest
Exit codes:
0: no blocking promptware patterns found1: usage or runtime error2: blocking promptware patterns found
What It Flags
- prompt-injection text that tries to override prior/system/developer instructions
- text asking an agent to reveal secrets, hidden instructions, environment variables, or tokens
- text trying to make an agent run commands or fetch external content
- LLM-targeted anti-analysis language that tells scanners not to report suspicious content
- broad repo-local agent instruction language that deserves review before opening a path in automated agents
The rules are intentionally conservative. A finding means "do not feed this raw text into an agent," not "this file is malware."
Safe Handling
- Do not paste flagged text into agents in raw form.
- Summarize or defang prompt-injection text before sharing with the team.
- If this appears in a third-party repository, do not open the repo in agents or editors until reviewed.
- If a test needs one of these markers, split or encode it so the test remains meaningful without carrying live promptware. This codebase stores all of its own detection markers split and joins them at runtime; keep that discipline when adding rules.
Scope Limits
This scanner only checks text-like files and known phrase families. It will not detect every possible prompt-injection attempt, encoded payload, image-only instruction, or model-specific attack.
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
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 prompt_injection_blocker-0.1.0.tar.gz.
File metadata
- Download URL: prompt_injection_blocker-0.1.0.tar.gz
- Upload date:
- Size: 10.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
eb20b55cc971d72cafc546fc020f234b92fd41e8427be95f8edc218d7bc391d2
|
|
| MD5 |
4b9ab258a192a32e7b50cdeb0d2dadaf
|
|
| BLAKE2b-256 |
4388344c25f3f2fc2b1b02965497126bb4a59a8929aa1388eec1b2cb3cb70244
|
Provenance
The following attestation bundles were made for prompt_injection_blocker-0.1.0.tar.gz:
Publisher:
publish.yml on Dragon-Lady/prompt-injection-blocker
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
prompt_injection_blocker-0.1.0.tar.gz -
Subject digest:
eb20b55cc971d72cafc546fc020f234b92fd41e8427be95f8edc218d7bc391d2 - Sigstore transparency entry: 1785508006
- Sigstore integration time:
-
Permalink:
Dragon-Lady/prompt-injection-blocker@631638ebe1999f4ce849f38c9bd816b45f07571c -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/Dragon-Lady
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@631638ebe1999f4ce849f38c9bd816b45f07571c -
Trigger Event:
release
-
Statement type:
File details
Details for the file prompt_injection_blocker-0.1.0-py3-none-any.whl.
File metadata
- Download URL: prompt_injection_blocker-0.1.0-py3-none-any.whl
- Upload date:
- Size: 9.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7d51bd507e99a78b0a269325bc8ec9f1c099d7124a560817816e75526468cabc
|
|
| MD5 |
9a930e0288e6e7c8bd2723e9dfb14b7a
|
|
| BLAKE2b-256 |
d246a68f0eeb5dc5a6555e3f3846754fb3e07b2f9df7ea4917a45256023987c9
|
Provenance
The following attestation bundles were made for prompt_injection_blocker-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on Dragon-Lady/prompt-injection-blocker
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
prompt_injection_blocker-0.1.0-py3-none-any.whl -
Subject digest:
7d51bd507e99a78b0a269325bc8ec9f1c099d7124a560817816e75526468cabc - Sigstore transparency entry: 1785508113
- Sigstore integration time:
-
Permalink:
Dragon-Lady/prompt-injection-blocker@631638ebe1999f4ce849f38c9bd816b45f07571c -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/Dragon-Lady
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@631638ebe1999f4ce849f38c9bd816b45f07571c -
Trigger Event:
release
-
Statement type: