code-security

A code-security review guide for finding exposed passwords and keys, risky dependencies, unsafe code patterns, and common authentication or input-handling flaws.

In plain words
What is it for?
Use it to scan repositories for leaked secrets, check dependency vulnerabilities, review shell, Python, TypeScript, and Rust code, and assess software supply-chain risks.
Why use it?
It helps reveal security problems that could expose data, let attackers run unwanted actions, or bring vulnerable third-party code into a project.

Skill for Claude CodeCodex

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.

agentmods
npx agentmods add skills/firstp1ck/pi-coding-agent-forge/code-security
Any agent
npx skills add Firstp1ck/pi-coding-agent-forge --skill code-security
Clone the repo
git clone --depth 1 https://github.com/Firstp1ck/pi-coding-agent-forge

Made for: Claude Code, Codex.

Per session 48 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,190 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. Scan, not verified.
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 $0.00048 $0.02190
Opus 5 $0.00024 $0.01095
Sonnet 5 $0.00010 $0.00438
Haiku 4.5 $0.00005 $0.00219

Measured 2d ago against content hash f605db3cb233, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

code-security scanned grade A with 1 finding 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 2d 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.

Runs shell commandslowCapability

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

os.system(user_input)
pi-skill-code-security/skills/code-security/SKILL.md · 319 lines

How it starts

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

Code Security

Secret scanning, dependency vulnerability auditing, static analysis patterns, and supply chain security for the user's codebases.

Quick Start

Quick Repo Security Check

Run these in order for any repository:

# 1. Check for leaked secrets
grep -rn "sk-proj-\|sk-\|AKIA\|ghp_\|gho_\|github_pat_\|xoxb-\|xoxp-" --include="*.py" --include="*.ts" --include="*.js" --include="*.rs" --include="*.sh" --include="*.toml" --include="*.json" --include="*.yml" --include="*.yaml" --include="*.env" .

# 2. Check .gitignore covers sensitive files
cat .gitignore | grep -i "env\|secret\|key\|token\|credential"

# 3. Check for .env files in repo
find . -name ".env*" -not -path "./.git/*"

# 4. Run dependency audit (language-specific)
cargo audit          # Rust
npm audit            # JavaScript/TypeScript
pip-audit            # Python (via pip install pip-audit)

Secret Scanning

Patterns to Detect

Pattern Regex Severity
OpenAI API key sk-proj-[A-Za-z0-9_-]{20,} Critical
OpenAI legacy key sk-[A-Za-z0-9]{20,} Critical
AWS access key AKIA[0-9A-Z]{16} Critical
GitHub PAT ghp_[A-Za-z0-9]{36} Critical
GitHub OAuth gho_[A-Za-z0-9]{36} Critical
GitHub App token github_pat_[A-Za-z0-9_]{22,} Critical
Slack token xox[bpors]-[A-Za-z0-9-]{10,} High
Telegram bot token [0-9]{8,10}:AA[A-Za-z0-9_-]{33} High
Discord bot token [MN][A-Za-z0-9]{23,}\.[A-Za-z0-9_-]{6}\.[A-Za-z0-9_-]{27,} High
JWT token eyJ[A-Za-z0-9_-]*\.eyJ[A-Za-z0-9_-]*\.[A-Za-z0-9_-]* High
Generic API key [Aa]pi[_-]?[Kk]ey.*[=:]\s*["'][A-Za-z0-9]{20,} Medium
Password in URL ://[^:]+:[^@]+@ High
Private key header `-----BEGIN (RSA EC
Password assignment [Pp]assword\s*[=:]\s*["'][^"']{8,} High

Manual Secret Scan

# Comprehensive secret scan across a repo
grep -rn \
    -e "sk-proj-" \
    -e "sk-[A-Za-z0-9]\{20,\}" \
    -e "AKIA[0-9A-Z]\{16\}" \
    -e "ghp_" \
    -e "gho_" \
    -e "github_pat_" \
    -e "xox[bpors]-" \
    -e "BEGIN.*PRIVATE KEY" \
    -e "password\s*=" \
    -e "api_key\s*=" \
    -e "secret\s*=" \
    --include="*.py" --include="*.ts" --include="*.js" --include="*.rs" \
    --include="*.sh" --include="*.toml" --include="*.json" --include="*.yml" \
    --include="*.yaml" --include="*.env" --include="*.cfg" --include="*.ini" \
    .

Read the full file on GitHub · 319 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. 2d ago First seen · 319 lines · 48 tokens per session scan A f605db3cb233

Subscribe to this mod's changes

code-security is a skill published in the GitHub repository Firstp1ck/pi-coding-agent-forge (74 stars, last pushed 2d ago), licensed MIT. It adds 48 tokens to every session and 2,190 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 1 finding (runs shell commands). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.