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
  • observability/tool-output text, such as fake Sentry resolutions, that tries to make an agent run package-manager diagnostics
  • 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.1.tar.gz (11.0 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.1-py3-none-any.whl (10.0 kB view details)

Uploaded Python 3

File details

Details for the file prompt_injection_blocker-0.1.1.tar.gz.

File metadata

  • Download URL: prompt_injection_blocker-0.1.1.tar.gz
  • Upload date:
  • Size: 11.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for prompt_injection_blocker-0.1.1.tar.gz
Algorithm Hash digest
SHA256 9f2a2371d1242eb36f9f9de057f7b2c3ad7b8315ea42dd8e81a6f0fdae289f5a
MD5 63b569d54bc9745db47172d1f6682c81
BLAKE2b-256 1b9db48b844c41cfd50dbc8a1e63249e584942eab6e6367af16d82ed0b2d8adb

See more details on using hashes here.

Provenance

The following attestation bundles were made for prompt_injection_blocker-0.1.1.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.1-py3-none-any.whl.

File metadata

File hashes

Hashes for prompt_injection_blocker-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e46ba838bd7b4f679af2a6e99c9fb5cb1f658a1355563aed99895a004b354e0f
MD5 cf77f2c7441d94d4a0b637c17c4b120e
BLAKE2b-256 32fc6d1a16451434c4a56f60a588b4f62bc05d94bc1e37ab6a721c68996bf18f

See more details on using hashes here.

Provenance

The following attestation bundles were made for prompt_injection_blocker-0.1.1-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