agentleFS
strikersamstrikersam/autonomous-ai-agency/.claude/skills/risky-module-review/SKILL.md

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

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
  1. Distinctive:

    No module CLAUDE.md? Read the file header docstring carefully.

    line 37
  2. Distinctive:

    If a change would weaken an existing security check (e.g., remove path validation, make auth optional), stop and document the risk …

    line 93
  3. Distinctive:

    Prefer to add a feature flag rather than weaken a hard check.

    line 95

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Skill: risky-module-review

Risky Modules in This Repo

FileRiskWhat to check
admin_auth.pySession auth, admin identityNo secret leaks, session fixation prevention, proper expiry
key_store.pyAPI key persistenceKeys hashed before storage, no plaintext in logs, file permissions
agent/tools.pyFilesystem write surfacePath traversal prevention, content sanitization
proxy.py (auth middleware)Bearer token validationNo bypass paths, rate limit correctness
agent/loop.py (_local_safety_check)Security guardrailNot weakened or removed

Instructions

Step 1 — Read the module's CLAUDE.md

  • agent/ → agent/CLAUDE.md
  • router/ → 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_age or SESSION_MAX_AGE)
  • AdminIdentity is validated before any state-mutating action
  • No print() or log.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.json is 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_key returns the plaintext key exactly once, immediately

agent/tools.py checklist

  • apply_diff resolves paths with Path.resolve() and validates they stay within self.root
  • No .. traversal path accepted without rejection
  • File content is not eval()-ed or exec()-ed
  • search_code does not expose .env or keys.json content

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_KEYS from 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.py

Step 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 skill

Acceptance 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 ### Security added 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.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.