risky-module-review
Skill12 starsChanged 29 days agoMITView on GitHub
Mandatory deep review for changes to security-sensitive modules: admin_auth.py, key_store.py, agent/tools.py, and any auth/session/key path. Do not skip this for any change to these files.
- Reads credentials
In this repository22 other files it gives its agents.
- AGENTS.mdAGENTS.md
- docs/agents.mdAGENTS.md
- agent/CLAUDE.mdCLAUDE.md
- CLAUDE.mdCLAUDE.md
- router/CLAUDE.mdCLAUDE.md
- .github/copilot-instructions.mdCopilot instructions
- .cursor/rules/verification.mdcCursor rule
- agentic-agileSkill
- agentic-portfolioSkill
- client-onboardingSkill
- cooldown-resumeSkill
- drillSkill
- ecc-harness-patternsSkill
- fabric-patternsSkill
- graphiti-temporalSkill
- managed-agents-dreamsSkill
- model-catalogue-updateSkill
- platform-setupSkill
- repowise-intelligenceSkill
- seo-audit-reportSkill
- user-researchSkill
- video-contextSkill
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 3 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 37
No module CLAUDE.md? Read the file header docstring carefully.
- Distinctive: line 93
If a change would weaken an existing security check (e.g., remove path validation, make auth optional), stop and document the risk …
- Distinctive: line 95
Prefer to add a feature flag rather than weaken a hard check.
≈ “Common” is an estimate: at least 1 in 5 of the 372,429 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Skill: risky-module-review
Risky Modules in This Repo
| File | Risk | What to check |
admin_auth.py | Session auth, admin identity | No secret leaks, session fixation prevention, proper expiry |
key_store.py | API key persistence | Keys hashed before storage, no plaintext in logs, file permissions |
agent/tools.py | Filesystem write surface | Path traversal prevention, content sanitization |
proxy.py (auth middleware) | Bearer token validation | No bypass paths, rate limit correctness |
agent/loop.py (_local_safety_check) | Security guardrail | Not weakened or removed |
Instructions
Step 1 — Read the module's CLAUDE.md
agent/→agent/CLAUDE.mdrouter/→router/CLAUDE.md- No module CLAUDE.md? Read the file header docstring carefully.
Step 2 — Checklist by module
admin_auth.py checklist
- Admin password is read from environment — never hardcoded
- Sessions expire (check
max_ageorSESSION_MAX_AGE) AdminIdentityis validated before any state-mutating action- No
print()orlog.debug()exposes the admin password or session token - CSRF protection present for state-mutating routes
key_store.py checklist
- API keys are stored hashed (SHA-256 or stronger) — never plaintext
keys.jsonis never committed (it is in.gitignore)- Key comparison uses constant-time comparison (
hmac.compare_digest) - No key value appears in any log line
issue_new_api_keyreturns the plaintext key exactly once, immediately
agent/tools.py checklist
apply_diffresolves paths withPath.resolve()and validates they stay withinself.root- No
..traversal path accepted without rejection - File content is not
eval()-ed orexec()-ed search_codedoes not expose.envorkeys.jsoncontent
proxy.py auth middleware checklist
verify_api_key()cannot be bypassed by setting a header to empty string- Rate limit is per-key, not per-IP (IP can be spoofed)
VALID_API_KEYSfrom env is populated — empty set should reject all requests
Step 3 — Run targeted tests
pytest -x tests/test_agent_api.py tests/test_agent_tools.pyStep 4 — Write a security note in the PR description
## Security note
- Changed: <what changed>
- Risk: <what could go wrong>
- Mitigation: <how it is addressed>
- Verified by: risky-module-review skillAcceptance Checks
- All relevant checklist items above checked
- No secrets in source
- Path traversal not possible in file-write code
- Tests pass for affected module
- Security note included in PR description or commit message
- Changelog entry under
### Securityadded if applicable
Escalation
If a change would weaken an existing security check (e.g., remove path validation, make auth optional), stop and document the risk explicitly before proceeding. Prefer to add a feature flag rather than weaken a hard check.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

