agentleFS
helloternhellotern/Sextant/skills/security/SKILL.md

security

Skill15 starsChanged 8 months agoMITView on GitHub

You MUST use this skill before approving or merging any code that touches auth, input handling, permissions, or external data. Use when the review focus is specifically on security vulnerabilities, attack surface, or compliance — not general code quality. Stronger signals: "security review", "check for vulnerabilities", "is this safe", "audit this", "OWASP", "injection", "auth check", "XSS", "SQL injection", "pentest", "threat model". Can run standalone or as a follow-up after sextant:review-code. Use sextant:review-code instead when the goal is general code quality without a security focus.

78 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use cost-reducer, trigger-dev and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • daianepepes-labSkill

    cost-reducer

    Analyze and reduce costs across cloud infrastructure, code, and services. Use when asked to cut costs, optimize spending, reduce bills, or improve cost efficiency.

    Also in 5 projects that use this

  • xfstudioSkill

    trigger-dev

    Trigger.dev expert for background jobs, AI workflows, and reliable async execution with excellent developer experience and TypeScript-first design. Use when: trigger.dev, trigger dev, background task, ai background job, long running task.

    Also in 4 projects that use this

  • ffsshhttiikkSkill

    scalability

    Core foundational concepts and principles for Scalability

    Also in 4 projects that use this

  • daianepepes-labSkill

    self-healing

    Detect, diagnose, and automatically fix recurring errors, memory issues, and system degradation. Use when a system has recurring failures, memory leaks, performance degradation, or needs automatic recovery mechanisms.

    Also in 5 projects that use this

  • xfstudioSkill

    customer-support

    Elite AI-powered customer support specialist mastering

    Also in 4 projects that use this

  • ffsshhttiikkSkill

    cicd

    Continuous integration and delivery pipelines

    Also in 4 projects that use this

  • +1 more from daianepepes-lab

The file

We split this skill into the rules it gives an agent

6 rules. 0 are common, 6 are distinctive, and 0 are very specific to this project.

  • 0

    Common

    Most of the 56 edited versions we read keep these.

  • 6

    Distinctive

    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:

    Scope: All public interfaces, API endpoints, and externally-controlled input paths.

    line 42
  2. Distinctive:

    Scope: All access-controlled endpoints, operations, and data reads/writes.

    line 66
  3. Distinctive:

    Scope: All data storage, transmission, logging, and serialization paths.

    line 92
  4. Distinctive:

    Do not run shell commands, execute scanners, or call external APIs

    line 154
  5. Distinctive:

    Do not mark a finding as "not a vulnerability" because "this code isn't reachable in production" without tracing the actual call path — …

    line 155
  6. Distinctive:

    Do not skip Dimension 2 for "internal-only" endpoints — network perimeters can be breached.

    line 156

“Common” is measured: kept by at least 6 in 10 of the 56 edited versions of this file we could read. “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

!../principles/SKILL_BODY.md

!../tool-gitnexus/SKILL_BODY.md


Security Audit Workflow

Core Principle

Security vulnerabilities are architectural violations in disguise: injection attacks are layer violations (untrusted data reaching logic without sanitization at the entry boundary); privilege escalation is an SRP violation (authorization logic entangled with business logic); secret leakage is a hidden dependency violation (credentials embedded in code rather than injected from outside). Fixing the architecture fixes the vulnerability.

Limitation declaration: This skill performs static code pattern analysis. It cannot execute npm audit, pip-audit, bandit, semgrep, trivy, or any other automated scanner. The dependency findings in Dimension 4 are a preliminary review — they do not substitute for running real tooling.


Audit Dimensions

Progress tracking: At the start of each dimension, output an updated progress block.

Security Audit Progress
✓ Dimension 1: Input Validation     — <Pass / Issues ⚠️ (N gaps)>
→ Dimension 2: Auth & Authorization — in progress
○ Dimension 3: Sensitive Data
○ Dimension 4: Dependencies

Replace ○ with → for the current dimension, and ✓ once complete.

Dimension 1: Input Validation

Scope: All public interfaces, API endpoints, and externally-controlled input paths.

CheckPass condition
Entry-layer validationAll external parameters (request body, query string, headers, file uploads) are validated before entering the logic layer
SQL parameterizationSQL is built with parameterized queries / prepared statements — never string concatenation
HTML output escapingAll user-controlled data is escaped before rendering in HTML (XSS prevention)
Shell command safetyShell invocations use argument arrays, not string interpolation of user input
Path canonicalizationFile paths are resolved (os.path.realpath() / .resolve()) before use to prevent path traversal
─── Input Validation Findings ───────────────────────
Interface / endpoint: <name>
  [ ] Validated at entry layer before logic layer
  [ ] SQL parameterized (no string concatenation)
  [ ] HTML output escaped
  [ ] Shell commands use argument arrays
  [ ] File paths canonicalized
  Gaps: <list any failing checks>
─────────────────────────────────────────────────────

Dimension 2: Authentication and Authorization

Scope: All access-controlled endpoints, operations, and data reads/writes.

CheckPass condition
AuthN at entry layerAuthentication checks are performed at the entry layer (route handler / controller) — not inside the logic layer
AuthZ at entry layerAuthorization checks are performed at the entry layer alongside authentication
Both checkedBoth authentication (who are you?) AND authorization (are you allowed to do this?) are verified — not just one
No bypass pathNo path to protected resources exists that skips the auth check (e.g., internal endpoint, direct service call)
Tokens out of logsSession tokens, JWTs, and auth credentials are excluded from application logs
Tenant isolationFor multi-tenant systems: tenant isolation is enforced at the data query level, not only in the UI
─── Auth Findings ───────────────────────────────────
Endpoint / operation: <name>
  [ ] AuthN check at entry layer
  [ ] AuthZ check at entry layer
  [ ] Both AuthN and AuthZ verified
  [ ] No bypass path identified
  [ ] Session / auth tokens excluded from logs
  [ ] Tenant isolation enforced (if applicable)
  Gaps: <list any failing checks>
─────────────────────────────────────────────────────

Dimension 3: Sensitive Data Handling

Scope: All data storage, transmission, logging, and serialization paths.

CheckPass condition
No hardcoded credentialsNo literal credential values assigned to variables matching: password, api_key, secret, token, private_key, access_key (case-insensitive)
PII out of logsPersonally identifiable information (names, emails, phone numbers, national IDs) is not written to logs
Sanitized error messagesError messages returned to external callers do not expose stack traces, file paths, SQL queries, or internal structure
Response field maskingSensitive fields (passwords, tokens, PII) are stripped or masked from API response objects before serialization
Secrets from environmentSecrets are loaded from environment variables or a secrets manager — not from committed config files
─── Sensitive Data Findings ─────────────────────────
  [ ] No hardcoded credentials (password/key/secret/token literals)
  [ ] PII excluded from logs
  [ ] Error messages sanitized for external callers
  [ ] Sensitive fields stripped from API responses
  [ ] Secrets sourced from env vars / secrets manager (not committed config)
  Gaps: <list any failing checks>
─────────────────────────────────────────────────────

Dimension 4: Dependency Review

Scope: Dependency manifest files (package.json, requirements.txt, go.mod, Cargo.toml, pom.xml, pyproject.toml).

Scope boundary: The agent cannot query live CVE databases or confirm current compromise status of packages. This dimension covers checks that can be performed reliably from the manifest file alone. For vulnerability scanning, authoritative tooling is required (see note below).

CheckPass condition
Exact version pinningAll production dependencies use exact versions — no ^, ~, *, or latest ranges; floating ranges in production create non-reproducible builds
Lock file committedA lock file exists and is committed: package-lock.json, yarn.lock, pnpm-lock.yaml, poetry.lock, Cargo.lock, go.sum
Dev/prod separationDev tools, test frameworks, and linters are in devDependencies / [dev-dependencies] — not in production dependencies
No self-referential or phantom importsNo dependencies listed that are not used by the codebase, and no imports used in code that are absent from the manifest

Authoritative scan required: Run npm audit, pip-audit, cargo audit, or trivy to check for known CVEs and supply-chain issues. The agent cannot reliably identify compromised or vulnerable packages from the manifest text alone.

─── Dependency Review Findings ──────────────────────
  [ ] Production dependencies use exact version pinning (no ^ ~ * latest)
  [ ] Lock file exists and is committed
  [ ] Dev dependencies correctly separated from production dependencies
  [ ] No unused or phantom dependencies found
  Gaps: <list any failing checks>
  ⚠️ Authoritative scan required: run npm audit / pip-audit / cargo audit / trivy
─────────────────────────────────────────────────────

Finding Severity Levels

LevelMeaningAction
CRITICALDirectly exploitable with no prerequisites (SQL injection, auth bypass, hardcoded admin credential)Block merge; fix immediately
HIGHExploitable under specific but realistic conditions (missing auth on an endpoint reachable with a valid session)Fix before shipping
MEDIUMDefense-in-depth gap (error message leaks stack trace, no direct exploit path)Fix in near-term follow-up
LOWBest-practice gap with no current exploit path (PII in debug logs, dev dependency in prod bundle)Track as tech debt

Forbidden Actions

  • Do not run shell commands, execute scanners, or call external APIs
  • Do not mark a finding as "not a vulnerability" because "this code isn't reachable in production" without tracing the actual call path — reachability must be verified, not assumed
  • Do not skip Dimension 2 for "internal-only" endpoints — network perimeters can be breached; internal endpoints without auth checks are still vulnerabilities

Reply Format

Security Audit Summary:

#ItemDetail
[1]Scope<files / endpoints / modules reviewed>
[2]FindingsCRITICAL: <count> · HIGH: <count> · MEDIUM: <count> · LOW: <count>
[3]Dimension statusInput validation: ✅/⚠️ · Auth/AuthZ: ✅/⚠️ · Sensitive data: ✅/⚠️ · Dependencies: ✅/⚠️
[4]Needs your input<CRITICAL / HIGH items requiring immediate decision before merge>

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.