Skip to main content

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 found
  • 1: usage or runtime error
  • 2: 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


Download files

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

Source Distribution

prompt_injection_blocker-0.1.0.tar.gz (10.5 kB view details)

Uploaded Source

Built Distribution

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

prompt_injection_blocker-0.1.0-py3-none-any.whl (9.8 kB view details)

Uploaded Python 3

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

Hashes for prompt_injection_blocker-0.1.0.tar.gz
Algorithm Hash digest
SHA256 eb20b55cc971d72cafc546fc020f234b92fd41e8427be95f8edc218d7bc391d2
MD5 4b9ab258a192a32e7b50cdeb0d2dadaf
BLAKE2b-256 4388344c25f3f2fc2b1b02965497126bb4a59a8929aa1388eec1b2cb3cb70244

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

File hashes

Hashes for prompt_injection_blocker-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7d51bd507e99a78b0a269325bc8ec9f1c099d7124a560817816e75526468cabc
MD5 9a930e0288e6e7c8bd2723e9dfb14b7a
BLAKE2b-256 d246a68f0eeb5dc5a6555e3f3846754fb3e07b2f9df7ea4917a45256023987c9

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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