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.
curl -O https://raw.githubusercontent.com/sebastienrousseau/pain001/main/.github/agents/python-security.mdgit clone --depth 1 https://github.com/sebastienrousseau/pain001Wrote 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.
[](https://agentmods.dev/agents/sebastienrousseau/pain001/python-security)<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.
<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>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.
| Model | Per session | Once 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 |
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 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()andlogger.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
# nosecor are environment variable references
- Result must be empty or all entries have
-
XML Security (XXE Prevention - OWASP #5)
- MANDATORY: Use
defusedxml.ElementTreeexclusively; NEVERxml.etree.ElementTreefor 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:
- MANDATORY: Use
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.
- 1mo ago Changed · +21 lines 9260aa0aea9b
- 1mo ago First seen · 264 lines · 47 tokens per session scan A d7ed95cbd1fa
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.
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.
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.
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…
script-operator
Specialized in bash and Python. Can inspect/modify the environment and create/edit/execute scripts.
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.
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.