AI Tools & Scripts
Python Code Safety Check
Check Python code before you merge: SQL built from strings, pickle and yaml.load on untrusted data, eval and exec, hardcoded secrets, verify=False, unverified JWTs, MD5 on passwords, debug mode, mktemp and random tokens.
What you get: 1 file · 21.24 KB · ZIP
See purchase optionsProduct description
A single f-string in cursor.execute() is a SQL injection, and a single pickle.loads() on request data lets an attacker run code on your server. This skill finds those and eight other security mistakes in Python code (Flask, Django, FastAPI or plain scripts) before you merge or deploy, and tells you how to fix each one.
Your agent runs a scanner on your .py files. It reads them with Python's own parser, so it follows imports and aliases (import pickle as pk, from yaml import load) and follows a query built in a variable to the execute() call that runs it. Query text built only from ALL_CAPS constants is not flagged, and test files are read but not reported. It never imports or runs your code. It returns BLOCK, REVIEW, or NOT FLAGGED, with the file, line, reason, and a safer approach. Secrets are never printed.
What it checks
BLOCK (fix before shipping)
P01: SQL built with an f-string, %, + or .format() and passed to execute(), raw(), text() or read_sql()
P02: pickle, marshal or dill loads, pandas.read_pickle, numpy.load(allow_pickle=True), or yaml.load without SafeLoader
P03: eval() or exec() of anything but a fixed string
P04: a password, token, secret or API key written as a string, or a private key in the code
REVIEW (check before release)
P11: TLS verification turned off (verify=False, CERT_NONE, check_hostname=False)
P12: a JWT decoded without checking its signature
P13: MD5, SHA-1 or SHA-2 used to hash a password
P14: Flask, Dash, FastAPI or Starlette debug mode on
P15: tempfile.mktemp()
P16: the random module used for a token, password, OTP, salt or key
What's included
The scanner (Python 3.9+, standard library only)
A rules guide with the reason and safer approach for each rule
A risky and a safe example app, and the real report the scanner produces on the risky one
Limits
It follows values within one function, so data that crosses functions or files is not traced. It does not check dependencies, subprocess calls or templates. NOT FLAGGED is not a guarantee.
Contents
One ZIP file with 8 files: SKILL.md, the scanner in scripts/ (3 Python files), references/rules.md (every rule with its reason and safer approach), and examples/ (2 example files plus report.md, the real scanner output on the risky example).
How to use: This is an agent skill: a folder with a SKILL.md file and Python scripts that an AI coding agent such as Claude Code, Cursor, or Codex CLI can run. Unzip it into your agent's skills folder (for Claude Code: ~/.claude/skills/), then ask your agent to check your project. The scripts also run on their own with Python 3.9 or newer, with nothing to install. They read your files only: no network access, and nothing is sent anywhere.
What you get
1 file · 21.24 KB
- python-code-safety-check-1.0.0.zipZIP · 21.24 KB
AI Tools & Scripts
Python Code Safety Check
Check Python code before you merge: SQL built from strings, pickle and yaml.load on untrusted data, eval and exec, hardcoded secrets, verify=False, unverified JWTs, MD5 on passwords, debug mode, mktemp and random tokens.
Included in Getly ProGet Pro
Tags
Frequently asked questions
Do I get access instantly?
Yes. This is a digital product - you can download it right after checkout, straight from your library.
Can I use it for commercial projects?
Yes. Commercial use is allowed: use it in your own business and in things you sell. You may not resell or redistribute the file itself.
What's your refund policy?
You can request a refund within 30 days. If something isn't right, request it from your order and the Getly team reviews it.
What file formats and sizes will I get?
You'll download 1 file - ZIP - 21.24 KB in total.
Do I get free updates?
Yes - when the seller ships a new version, you can re-download the latest files from your library at no extra cost. Check the changelog for recent updates.
Price
$5.00



