tessl install tessl/pypi-safety@3.6.0Scan dependencies for known vulnerabilities and licenses.
Agent Success
Agent success rate when using this tile
61%
Improvement
Agent success rate improvement when using this tile compared to baseline
1.39x
Baseline
Agent success rate without this tile
44%
A Python script that wraps a dependency vulnerability scanner for use in continuous integration pipelines, providing proper exit codes, machine-readable output, and failure handling.
Create a Python script that scans Python project dependencies for vulnerabilities and integrates seamlessly with CI/CD pipelines.
The script must:
The script should accept the following command-line arguments:
--output-format: Specify the output format (default: json)--non-blocking: When specified, the script should not fail the build even if vulnerabilities are found--target: Optional path to scan (default: current directory)Given a project with vulnerable dependencies:
@test
Given a project with vulnerable dependencies and non-blocking mode enabled:
@test
Given a project with no vulnerable dependencies:
@test
@generates
import sys
import argparse
def scan_dependencies(target_path: str, output_format: str, non_blocking: bool) -> dict:
"""
Scans dependencies for vulnerabilities.
Args:
target_path: Path to the project directory to scan
output_format: Format for output (e.g., 'json')
non_blocking: If True, always return success exit code
Returns:
Dictionary containing scan results
"""
pass
def main():
"""
Main entry point for the CI/CD scanner script.
Parses arguments and executes the scan.
"""
pass
if __name__ == "__main__":
main()Provides vulnerability scanning for Python dependencies.