Scan Python code for ten AST security issues: eval/exec, shell=True, pickle, unsafe yaml, weak hashes, disabled TLS, hardcoded secrets, SQL built from strings, mktemp, debug=True. Use when the user asks for a security scan or SARIF.
92%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
Medium
Suggest reviewing before use
"""Base and specific error classes for sast_rules_mini."""
from __future__ import annotations
class SastError(Exception):
"""Base exception class for sast_rules_mini with a stable machine-readable code."""
def __init__(self, message: str, code: str = "sast_error") -> None:
super().__init__(message)
self.code = code
self.message = message
def __str__(self) -> str:
return f"[{self.code}] {self.message}"