agentleFS
danygigueredanygiguere/audit-skills/AGENTS.md

audit-skills

AGENTS.md7 starsChanged 2 days agoMITView on GitHub

Apply the invariants below to all code you review, audit, or generate. For an in-depth audit, use the audit skill (/audit): it maps each topic to its detailed checklist under references/. - Authorization — every state-changing or sensitive action is permission-checked server-side at the point of action, not only in the UI or routing layer. - Authentication & sessions — sessions are regenerated on login and invalidated on logout; credential and reset flows do not reveal whether an account exists.…

The file

We split this AGENTS.md into the rules it gives an agent

1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    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:

    Do not manufacture findings for topics that do not apply (e.g., CSRF on a token-authenticated API).

    line 98

≈ “Common” is an estimate: at least 1 in 5 of the 42,283 AGENTS.md 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
AGENTS.md

Engineering audit digest

Apply the invariants below to all code you review, audit, or generate. For an in-depth audit, use the audit skill (/audit): it maps each topic to its detailed checklist under references/.

Invariants (always apply)

Access & data security

  • Authorization — every state-changing or sensitive action is permission-checked server-side at the point of action, not only in the UI or routing layer.
  • Authentication & sessions — sessions are regenerated on login and invalidated on logout; credential and reset flows do not reveal whether an account exists.
  • Token & webhook validation — stateless credentials (JWTs, API keys, signed URLs, webhook signatures) are cryptographically verified before any claim is trusted: algorithm pinned, exp/aud/iss validated, webhook HMACs computed over the raw body within a bounded timestamp window.
  • IDOR — any resource looked up by an identifier from the request is verified as owned by or visible to the current principal; a valid ID is not authorization.
  • Data exposure — responses, errors, and logs contain only fields explicitly intended for the consumer; never whole models, stack traces, or PII by default.
  • Crypto & data protection — passwords use adaptive hashing; tokens come from a CSPRNG; secret comparisons are constant-time; no homemade crypto.
  • Output encoding — every user-controlled value rendered into HTML, JS, CSS, URLs, headers, or emails is encoded for that exact context.
  • Tenant isolation — in multi-tenant code, every query, cache key, and background job is scoped by tenant; no implicit global reads.
  • CSRF — state-changing endpoints authenticated by cookies verify a CSRF token or origin (not applicable to pure token-based APIs).
  • Mass assignment — request data is never bound wholesale onto models; every binding site has an explicit, per-context allowlist of writable fields (allowlists, never denylists).

Input, API & dependencies

  • Injection — queries, shell commands, templates, and paths are built with parameterization or escaping APIs, never by concatenating input.
  • Configuration — production config denies by default: debug off, CORS explicit, security headers present, cookies Secure/HttpOnly.
  • Secrets — credentials live in env vars or secret managers; never hardcoded, logged, or committed; rotation is possible.
  • API contract & validation — every input is validated at the boundary for type, bounds, and allowed fields; unknown fields are rejected or ignored explicitly.
  • File handling — file paths are never derived from raw input; uploads are constrained by type, size, and storage location; served files cannot escape their root.
  • SSRF — server-side requests to user-influenced URLs validate the destination against an allowlist; redirect targets count as destinations.
  • Parser differentials — a gate must interpret input exactly as its consumer does: anchored matches, exact-host allowlists, validate the parsed object and pass that object on — never validate raw input and re-parse it.
  • Insecure deserialization — untrusted bytes are never fed to a deserializer that can instantiate arbitrary types or run code; parse data-only formats into known target types, or restrict to a type allowlist plus a verified signature.
  • Dependencies & supply chain — third-party code is installed from a committed lockfile with verified hashes, from the intended registry; CI actions, base images, and downloaded scripts are pinned to immutable references; versions with known vulnerabilities on a reachable path are not shipped.

Correctness

  • Atomicity — writes that must succeed together run in one transaction or have explicit compensation; partial state never survives a failure.
  • Idempotency — any handler that can run twice (retries, webhooks, double submits) produces the same outcome as running once.
  • Background work — jobs have bounded retries, dead-letter handling, and timeouts, and tolerate duplicate or out-of-order delivery.
  • State management — no check-then-act on shared state without a lock, atomic primitive, or database constraint backing it.
  • Cardinality — any operation that assumes a predicate matches exactly one row is backed by a uniqueness guarantee (primary key or UNIQUE constraint); every UPDATE/DELETE is provably single-target or deliberately bounded, never fanning out on a non-unique or missing WHERE clause.
  • Exception handling — errors are handled or propagated, never swallowed; catches are narrow, causes preserved, resources released; HTTP boundaries return the status the condition means (404/401/403/422/409, never 200-with-error).
  • Discarded async work — every promise, future, task, or publisher is awaited, returned, composed, or deliberately detached with error handling; a cold producer that is never subscribed silently never runs.
  • Numeric & money precision — money and exact quantities use decimal or integer minor units, never binary float; rounding happens once with an explicit mode; division remainders, overflow, and unit/currency mismatches are handled.
  • Time, timezone & clock — instants are stored in UTC and localized only at display; durations and expiry read a monotonic clock, not wall time; aware and naive values are never mixed, and calendar math respects DST and month length.

Operability

  • N+1 queries — never query inside a loop over a collection; load related data in bulk.
  • Observability — every failure path logs with context; new endpoints and jobs emit enough signal for their failures to be visible in production.
  • Migration safety — schema changes deploy without downtime: no long locks, destructive changes split across releases, rollback considered.
  • Resource limits — all work driven by input size is bounded: pagination, body and upload caps, rate limits, no catastrophic regex; IN lists and bulk statements built from growing data are chunked or passed as one array parameter.
  • Algorithmic complexity — in-memory work over growing collections uses a structure that fits the access pattern: hash map or set for exact lookups and joins, sorted data with binary search for ranges; no linear scan inside a loop, no hidden quadratic copies; binary search runs only on data sorted by the same comparator.
  • Blocking I/O in async code — code on a cooperative scheduler (event loop, coroutines, reactor) never blocks: no sync I/O, sleeps, or CPU-heavy work on the loop; blocking work is offloaded and outbound calls have timeouts.
  • Schema design — relationships enforced by real foreign keys with deliberate ON DELETE; hot query paths backed by indexes; integrity rules (NOT NULL, unique, checks) live in the schema, not only in app validation.
  • Statelessness — in replicated apps, state lives in process memory or local disk only if losing it is harmless and no peer replica needs it; sessions, counters, locks, uploads, and schedules live in shared stores.
  • Caching — cache keys include every dimension the value varies on (principal, tenant, locale); entries are invalidated when their source changes; misses don't stampede the origin; per-user data never lands in a shared or CDN cache.

Do not manufacture findings for topics that do not apply (e.g., CSRF on a token-authenticated API). Verify every finding against surrounding code (middleware, base classes, callers) before reporting it.


From audit-skills — the digest and the audit skills are maintained there; check its tags for newer releases.

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.