Skip to main content

safeworkflow Banner

SafeWorkflow

Prompt injection and supply-chain risk protection for agentic workflows

PyPI version Python 3.10+ License: MIT

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

  1. Multi-source Scanner - Detect risks in PR comments, issue bodies, markdown docs, PDFs, URLs
  2. Risk Scoring Engine - 0-100 score with severity levels (low/med/high/critical)
  3. Content Sanitizer - Remove/redact malicious injection patterns
  4. CI/CD Integration - GitHub Actions with fail-on-threshold policy
  5. 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.

Metadata

Release files for safeworkflow 1.0.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for safeworkflow 1.0.7
File Size Uploaded Provenance Actions
safeworkflow-1.0.7.tar.gz 9.6 kB Without provenance Details for safeworkflow-1.0.7.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for safeworkflow 1.0.7
File Interpreter ABI Platform Actions
safeworkflow-1.0.7-py3-none-any.whl Python 3 none any Details for safeworkflow-1.0.7-py3-none-any.whl

Total release size: 19.5 kB

Release files / safeworkflow-1.0.7.tar.gz

Download URL safeworkflow-1.0.7.tar.gz
Size 9.6 kB
Tags Source
SHA-256 checksum
How to use checksums
79fb39e5282c72a19c518e63f1f33a35d8ba2e4528b6cf06e6babb0d171e4420
BLAKE2b-256 checksum
How to use checksums
a97f9b46a4e0c8680f0f4c0c0e2fab459951bad97efc1d8d8b04021a16ad75df
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.12

Release files / safeworkflow-1.0.7-py3-none-any.whl

Download URL safeworkflow-1.0.7-py3-none-any.whl
Size 9.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0d6d95967296203df81d8ad058293b3a258c4c9bcf26826cabc970da20f93e94
BLAKE2b-256 checksum
How to use checksums
d4a6b719263850b584ede490afbc72760c14b1beac996fb6dee1036b36351c73
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.12

Security for safeworkflow 1.0.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page