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%
Build a Python command-line tool that integrates with a dependency vulnerability scanner to generate comprehensive security reports that include announcements, warnings, and scan results.
Your tool should scan Python dependencies for vulnerabilities and capture all security announcements, notifications, and warnings that the scanner provides. The output should be parsed and formatted into a structured report that security teams can review.
The tool must perform the following:
Execute Vulnerability Scan: Run a dependency vulnerability scan on a given requirements file or project directory.
Capture Announcements: Extract any security announcements or platform notifications returned by the scanner.
Capture Local Warnings: Identify and collect local warnings such as:
Generate Report: Create a structured JSON report containing:
The tool should output a JSON structure like:
{
"scan_timestamp": "2025-12-31T17:45:00Z",
"scan_status": "completed",
"announcements": {
"count": 2,
"items": [
{
"type": "security",
"message": "New vulnerability database available"
}
]
},
"warnings": {
"count": 3,
"items": [
{
"category": "unpinned_requirements",
"message": "Package 'requests' is not pinned to a specific version"
}
]
}
}@generates
def run_scan(target_path: str) -> dict:
"""
Execute a vulnerability scan and capture all announcements and warnings.
Args:
target_path: Path to requirements file or project directory to scan
Returns:
dict: Structured report containing scan results, announcements, and warnings
Raises:
ValueError: If target_path does not exist
RuntimeError: If scan execution fails
"""
pass
def parse_scan_output(scan_output: str) -> dict:
"""
Parse scanner output to extract announcements and warnings.
Args:
scan_output: Raw output from the vulnerability scanner
Returns:
dict: Parsed announcements and warnings with counts and categorization
"""
pass
def generate_report(scan_data: dict) -> str:
"""
Generate a formatted JSON report from scan data.
Args:
scan_data: Dictionary containing scan results, announcements, and warnings
Returns:
str: JSON-formatted report string
"""
passProvides dependency vulnerability scanning with announcements and notification capabilities.
@satisfied-by