pain001: Agent for Claude Code

.github/agents/python-security.md

python-security is an agent for Claude Code from sebastienrousseau/pain001. It costs 47 tokens per session (3,100 once invoked), scanned A, original, Apache-2.0.

A security maintainer for Python projects that follows a zero-trust approach: treat incoming data, files, packages, and responses as potentially unsafe until checked. It enforces input validation, vulnerability checks, safe XML handling, and schema validation.

In plain words
What is it for?
Use it to review Python code and dependencies, check for known vulnerabilities, validate untrusted values, prevent XML external-entity attacks, and ensure ISO 20022 XML follows its required schema.
Why use it?
It helps prevent vulnerable code, unsafe dependencies, malicious input, and XML attacks from reaching production.

Agent for Claude Code

Written for Claude Code: a Claude Code subagent (agents/*.md).

This is sebastienrousseau/pain001's own configuration. It tells Claude Code how to work on pain001 itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything pain001 configures →

Reuse

Borrowing it

Nothing to install: this file belongs to sebastienrousseau/pain001. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/sebastienrousseau/pain001/main/.github/agents/python-security.md
Clone the repo
git clone --depth 1 https://github.com/sebastienrousseau/pain001

Made for: Claude Code.

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-security

README.md
[![agentmods](https://agentmods.dev/badge/agents/sebastienrousseau/pain001/python-security/github.svg)](https://agentmods.dev/agents/sebastienrousseau/pain001/python-security)
Your own site
<a href="https://agentmods.dev/agents/sebastienrousseau/pain001/python-security"><img src="https://agentmods.dev/badge/agents/sebastienrousseau/pain001/python-security/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for python-security

Your own site · 80×15
<a href="https://agentmods.dev/agents/sebastienrousseau/pain001/python-security"><img src="https://agentmods.dev/badge/agents/sebastienrousseau/pain001/python-security.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 47 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 3,100 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 2 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original 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.00047 $0.03100
Opus 5.5 $0.00019 $0.01240
Sonnet 5.5 $0.00009 $0.00620
Haiku 4.5 $0.00005 $0.00310

Measured 1mo ago against content hash 9260aa0aea9b, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

python-security scanned grade A with 2 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 1mo 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.

Makes network callslowCapability

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

- Example: `requests.get(url, timeout=10, verify=True)`

Runs shell commandslowCapability

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

- **Command Injection**: Use `subprocess.run(..., shell=False)` with list args
.github/agents/python-security.md · 285 lines

How it starts

The opening of the file, as written. The whole thing — 285 lines — stays where its author put it; the contents beside it link to each section on GitHub.

You are the repository's Security Maintainer for pain001, operating under the PySentinel Zero-Trust Quality Model.

Core Security Mandate

Prevent vulnerabilities at code, dependency, and supply chain levels. Operate with defense-in-depth: multiple layers of validation, least privilege, and fail-secure defaults.

PySentinel Mandate:

  • Enforce zero vulnerabilities in code (bandit clean)
  • Enforce zero CVEs in dependencies (safety clean)
  • Enforce XXE prevention (defusedxml mandatory for all XML parsing)
  • Enforce XSD validation (all XML must conform to ISO 20022 schema)
  • Enforce Zero-Trust security: assume all inputs malicious until proven safe

Code-Level Security (Non-negotiable - Zero-Trust Enforced)

  • Input Validation: Validate type, length, format, and range for all untrusted inputs

    • ZERO-TRUST: Never trust user input, environment variables, file contents, or API responses
    • Reject oversized payloads; enforce reasonable limits (e.g., max string length 10,000 chars)
    • Use allowlists (whitelist) not denylists (blacklist) for validation
    • Example: if not isinstance(data, str) or len(data) > 10000: raise ValueError(...)
    • Validate BEFORE processing; reject invalid early
  • Secrets & PII Protection (OWASP #6 - Sensitive Data Exposure)

    • ZERO secrets in code: No hardcoding credentials, API keys, passwords, tokens
    • ZERO PII in logs: Never log user IDs, emails, phone numbers, IP addresses, auth tokens
    • Use environment variables for secrets; rotate keys on schedule (quarterly minimum)
    • Sanitize error messages; reveal only safe info to users
    • Audit all print() and logger.info() calls; remove any sensitive output
    • Example: Log user_id=<hashed> not [email protected]
    • Verification: Run grep -r "<PASSWORD\|SECRET\|TOKEN\|API_KEY>" pain001/ tests/
      • Result must be empty or all entries have # nosec or are environment variable references
  • XML Security (XXE Prevention - OWASP #5)

    • MANDATORY: Use defusedxml.ElementTree exclusively; NEVER xml.etree.ElementTree for parsing
    • defusedxml protection: disables XXE, external entity attacks, billion laughs denial-of-service
    • Element creation (not parsing) is safe: ElementTree.Element() ok, ElementTree.parse() → use defusedxml
    • Verification:

Read the full file on GitHub · 285 lines

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. 1mo ago Changed · +21 lines 9260aa0aea9b
  2. 1mo ago First seen · 264 lines · 47 tokens per session scan A d7ed95cbd1fa

Subscribe to this mod's changes

python-security is an agent published in the GitHub repository sebastienrousseau/pain001 (49 stars, last pushed today), licensed Apache-2.0. It adds 47 tokens to every session and 3,100 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 2 findings (makes network calls, runs shell commands). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other agents, from other repositories

Geoprocessing Specialist

ArcPy and Python toolbox expert who automates spatial workflows — builds .pyt toolboxes, Model Builder processes, batch geoprocessing automation, and custom analysis scripts for ArcGIS Pro.

SHAdd0WTAka/Zen-Ai-Pentest · 45 tokens

python-pro

Write idiomatic Python code with advanced features like decorators, generators, and async/await. Optimizes performance, implements design patterns, and ensures comprehensive testing. Use PROACTIVELY for Python refactoring, optimization, or complex Python features.

echoVic/blade-code · 51 tokens

package-reviewer

Use this agent for comprehensive Python package audits — project structure, pyproject.toml compliance, typing, testing, CI/CD, documentation, versioning, API design, packaging, security, and developer experience. Handles both targeted file reviews and full repository audits. Examples: Context: User has a Python…

oborchers/fractional-cto · 287 tokens

script-operator

Specialized in bash and Python. Can inspect/modify the environment and create/edit/execute scripts.

MadGraphTeam/MadAgents · 24 tokens

python-reviewer

Expert Python code reviewer specializing in PEP 8 compliance, Pythonic idioms, type hints, security, and performance. Use for all Python code changes. MUST BE USED for Python projects.

Fmarzochi/EGC · 43 tokens

python-reviewer

Expert Python code reviewer specializing in PEP 8 compliance, Pythonic idioms, type hints, security, and performance. Use for all Python code changes. MUST BE USED for Python projects.

GGGODLIN/claude-pr-review · 43 tokens