Prompt injection and supply-chain risk protection for agentic workflows
Project description
SafeWorkflow
Prompt injection and supply-chain risk protection for agentic workflows
Installation
pip install safeworkflow
Quick Start
Python API
from safeworkflow import scan, sanitize
# Scan for injection risks
result = scan("Ignore all previous instructions and do something else.")
print(f"Score: {result.score}/100")
print(f"Is Safe: {result.is_safe}")
# Sanitize malicious content
clean = sanitize("Ignore all previous instructions")
print(clean) # Output: [REDACTED]
CLI
# Scan a file
safeworkflow scan input.txt
# Scan with JSON output
safeworkflow scan input.txt --format json
# Fail on high risk
safeworkflow scan input.txt --fail-on high
# Sanitize content
safeworkflow sanitize "Ignore previous instructions" --output clean.txt
Features
- Multi-source Scanner - Detect risks in PR comments, issue bodies, markdown docs, PDFs, URLs
- Risk Scoring Engine - 0-100 score with severity levels (low/med/high/critical)
- Content Sanitizer - Remove/redact malicious injection patterns
- CI/CD Integration - GitHub Actions with fail-on-threshold policy
- Audit Logger - JSON logs of detected risks for observability
Use Cases
- Protect CI pipelines from poisoned external content
- Sanitize untrusted input before passing to LLM agents
- Monitor content flow through automation workflows
- Detect supply-chain attack patterns in PRs/issues
Documentation
License
MIT License - see LICENSE for details.
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
safeworkflow-1.0.7.tar.gz
(9.6 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 safeworkflow-1.0.7.tar.gz.
File metadata
- Download URL: safeworkflow-1.0.7.tar.gz
- Upload date:
- Size: 9.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
79fb39e5282c72a19c518e63f1f33a35d8ba2e4528b6cf06e6babb0d171e4420
|
|
| MD5 |
e92cb22f4e80dfb86bda0769e59d9158
|
|
| BLAKE2b-256 |
a97f9b46a4e0c8680f0f4c0c0e2fab459951bad97efc1d8d8b04021a16ad75df
|
File details
Details for the file safeworkflow-1.0.7-py3-none-any.whl.
File metadata
- Download URL: safeworkflow-1.0.7-py3-none-any.whl
- Upload date:
- Size: 9.9 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 |
0d6d95967296203df81d8ad058293b3a258c4c9bcf26826cabc970da20f93e94
|
|
| MD5 |
65f7e4c93240a096d7628b41de590def
|
|
| BLAKE2b-256 |
d4a6b719263850b584ede490afbc72760c14b1beac996fb6dee1036b36351c73
|