Reference cards behind the 57blocks security trigger tables. A trigger line names a card section such as `web3/accounting#7`; read that section when the line matches what you are building and you are not sure how to write it correctly. Cards cover web and API backends (access, input, query, auth, outbound requests, files, money, browser, interpreters, config, plus Node, Next.js, Python, Spring, Go and Laravel specifics) and smart contracts (access and lifecycle, accounting, external calls, pr...
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Sec Code?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/57blocks-sec-code)
---
name: "sec-code"
description: "Reference cards behind the 57blocks security trigger tables. A trigger line names a card section such as `web3/accounting#7`; read that section when the line matches what you are building and you are not sure how to write it correctly. Cards cover web and API backends (access, input, query, auth, outbound requests, files, money, browser, interpreters, config, plus Node, Next.js, Python, Spring, Go and Laravel specifics) and smart contracts (access and lifecycle, accounting, external calls, prices, signatures, plus Solidity specifics)."
user-invocable: false
---
# sec-code: reference cards for writing code securely
The always-on rule and the per-domain trigger tables (written by `sec-init`) are the coding guidance. This skill is
the reference they point to. Read only what a matched trigger line points to, not whole cards or framework files.
- A reference `web3/accounting#7` means requirement 7 of [refs/web3/accounting.md](refs/web3/accounting.md). The
card's template, wrong-vs-right example and negative tests show the same requirement in code; the framework file
(`fw-*`) has the section of the same name for one stack.
- Build what was asked. Never reject a value or case the request or the interface allows (a zero slippage bound the
caller passes, short codes, tokens with any number of decimals, acting for another account where the feature offers
it); protect that path instead. A control that refuses a requested case is a functional bug.
- Self-check: when the change matched a trigger line, end the reply with `Security self-check: ...` naming each
matched line and the fact that shows it is done (the code line, the test that covers it); fix P0/P1 on the spot.
Otherwise end with `Security self-check: pass (no sensitive changes)`. Do not run scanners or start `sec-check` or
`sec-audit` for this; those are separate steps.
## Cards
A card holds: when it applies, the requirements (with the pack item IDs they come from), the secure template, wrong-vs-right code, and the negative tests to write. Framework files hold the same cards as concrete code for one stack.
### Web, API and backend
| Building | Card |
|---|---|
| Any endpoint, resolver, server action; who may call it and which objects they may touch; multi-tenancy | [web/access.md](refs/web/access.md) |
| Request bodies, query params, DTOs, numbers, amounts, enums, mass assignment | [web/input.md](refs/web/input.md) |
| SQL, ORM, NoSQL, search filters, sort and column parameters | [web/query.md](refs/web/query.md) |
| Login, passwords, sessions, JWT, API keys, password reset, OAuth/SSO | [web/auth.md](refs/web/auth.md) |
| Fetching a URL the user influences, webhooks you send, redirects, calling third-party APIs | [web/outbound.md](refs/web/outbound.md) |
| Upload, download, file paths, archives, image/PDF processing | [web/files.md](refs/web/files.md) |
| Payments, balances, coupons, inventory, incoming webhooks and callbacks, idempotency, state machines | [web/money.md](refs/web/money.md) |
| HTML rendering, templates, rich text, CSRF, CORS, cookies, security headers | [web/browser.md](refs/web/browser.md) |
| Shell commands, dynamic code, deserialization, XML, template engines fed by users | [web/interpreters.md](refs/web/interpreters.md) |
| Secrets, env config, error handling, logging, debug and admin surfaces, dependencies, Docker/CI | [web/config.md](refs/web/config.md) |
| Framework | File |
|---|---|
| Node: Express, NestJS, Fastify | [web/fw-node.md](refs/web/fw-node.md) |
| Next.js / React (server components, route handlers, server actions) | [web/fw-nextjs.md](refs/web/fw-nextjs.md) |
| Python: Django, DRF, FastAPI, Flask | [web/fw-python.md](refs/web/fw-python.md) |
| Java/Kotlin: Spring Boot, Spring Security | [web/fw-spring.md](refs/web/fw-spring.md) |
| Go: net/http, Gin, Echo | [web/fw-go.md](refs/web/fw-go.md) |
| PHP: Laravel | [web/fw-laravel.md](refs/web/fw-laravel.md) |
### Smart contracts (every chain)
| Building | Card |
|---|---|
| Admin and role functions, initialize, upgrade, pause, parameter setters | [web3/access-lifecycle.md](refs/web3/access-lifecycle.md) |
| Deposits, withdrawals, shares, fees, rewards, interest; rounding and precision | [web3/accounting.md](refs/web3/accounting.md) |
| Calling other contracts or tokens, callbacks, user-supplied addresses | [web3/external-calls.md](refs/web3/external-calls.md) |
| Prices, oracles, swaps, slippage and deadlines | [web3/prices.md](refs/web3/prices.md) |
| Signed messages, permits, meta-transactions, claims and Merkle drops | [web3/signatures.md](refs/web3/signatures.md) |
| Chain / language | File |
|---|---|
| EVM: Solidity with Foundry or Hardhat, OpenZeppelin | [evm/fw-solidity.md](refs/evm/fw-solidity.md) |
## Domains without cards
Solana, Soroban, Move, TON, AI/LLM, mobile and wallet/dApp trigger lines point straight to knowledge-pack items
(`../sec-<domain>/`); read the cited `### ID` item when you need the detail.