CodexGuild

Guides

Secure coding skills

CodexGuild's own security skills teach coding agents what to check before they write an endpoint, a query, auth code, an upload or an outbound request — matched to the project's framework, proposed by sync and advise, and reinforced by the pre-write hook.

Most vulnerabilities in agent-written code aren't exotic. An endpoint returns another user's record because the lookup uses only the id from the URL. A query is built from a string. A request body is passed straight into an update, so the client can set role or ownerId. The code works in the happy path, so nothing flags it.

CodexGuild attacks this at three points:

  1. Before the code is written — security skills the agent reads when it works on that kind of code.
  2. While it is written — the pre-write hook gives a short checklist the first time a session writes an endpoint, a query, auth code, an upload or an outbound request, and warns on known vulnerability patterns.
  3. Before the agent says "done" — the stop hook asks for codexguild_scan_security after code changes.

The skills

SkillForWhat it covers
codexguild-secure-codingany web or API projectthe per-handler checklist; access control and IDOR, input validation and mass assignment, SQL/NoSQL/command injection, XSS, CSRF, CORS, cookies, secrets and passwords, JWT, uploads, path traversal, SSRF — with a reference file per topic
codexguild-secure-nestjsNestJSglobal guards, ValidationPipe with whitelist/forbidNonWhitelisted, DTOs, ownership-scoped Prisma/TypeORM queries, $queryRaw vs $queryRawUnsafe, response shaping, throttling, uploads
codexguild-secure-nextjsNext.js App RouterServer Actions and Route Handlers as public endpoints, auth in a data access layer (not only middleware/proxy), zod validation, keeping server data out of client props, dangerouslySetInnerHTML, open redirects
codexguild-secure-expressExpress (not inside NestJS)middleware order, Helmet, body limits, schema validation, auth middleware, ownership-scoped queries, sessions, sendFile with root, error handling
codexguild-secure-djangoDjango / DRFget_queryset scoping, explicit serializer fields, raw SQL with params, CSRF, mark_safe, production settings and check --deploy
codexguild-secure-fastapiFastAPIauth dependencies on routers, ownership in SQLAlchemy queries, Pydantic extra="forbid", response_model, PyJWT with pinned algorithms, uploads, proxy headers

They are written and maintained by CodexGuild, pass the same security scan as every skill in the registry, and are served at https://api.codexguild.com/.well-known/skills/<name>/. Names start with codexguild-, so a registry skill can never take their place.

How an agent gets them

  • Sync lists the ones that fit the project's stack in securitySkills, each with installed: true|false:

    json
    "securitySkills": [
      { "name": "codexguild-secure-coding", "matches": ["nestjs"], "installed": true, "reason": "…", "url": "…" },
      { "name": "codexguild-secure-nestjs", "matches": ["nestjs"], "installed": false, "reason": "…", "url": "…" }
    ]
  • Advise (codexguild_advise) proposes installing the missing ones, with the exact commands for the agent's harness. Like every advise proposal, nothing is installed without your OK.

  • Installed ones are checked on every sync like any other skill, against the server's own scan.

The pre-write briefing

With the hooks set up, the first time in a session a write adds one of these, the agent gets the rules for it before it continues:

Kind of codeRecognized byThe briefing asks for
Endpoint@Get()/@Post(), router.post(, "use server", export async function POST, DRF views, controller/route filesserver-side auth, ids scoped to the caller, schema validation that rejects unknown fields, explicit response fields
QueryPrisma/TypeORM/SQLAlchemy/Django ORM calls, raw SQLparameters only, owner/tenant filter, allowlisted ORDER BY, capped page size
Authpassword hashing, JWT, sessions, cookies, auth-named filesargon2id/bcrypt, CSPRNG tokens stored hashed, pinned JWT algorithms, cookie flags, rate limits
Uploadmulter, FileInterceptor, UploadFile, FileFieldsize limits, type from the file bytes, generated names outside the web root
Outbound requestfetch(variable), axios, requests, httpxSSRF: host allowlist or private-address block, timeouts, no forwarded credentials

It names the skills to read — with their path when installed, or a pointer to codexguild_advise when not. Each kind is briefed once per session, it never blocks a write, and it runs locally (works without a key, sends nothing).

What it doesn't do

The skills and the briefing make an agent ask the right questions; they don't prove the code is safe. Pattern checks (codexguild_scan_security) find common shapes of a problem, not every instance. Keep code review and tests that prove the negative — another user's id returns 404, an unknown field is rejected — for anything that matters.