A software security skill that integrates with Project CodeGuard to help AI coding agents write secure code and prevent common vulnerabilities. Use this skill when writing, reviewing, or modifying code to ensure secure-by-default practices are followed.
rule_id: codeguard-0-framework-and-languages
Apply secure‑by‑default patterns per platform. Harden configurations, use built‑in protections, and avoid common pitfalls.
SecurityMiddleware, clickjacking middleware, MIME sniffing protection.SECURE_SSL_REDIRECT); configure HSTS; set secure cookie flags (SESSION_COOKIE_SECURE, CSRF_COOKIE_SECURE).CsrfViewMiddleware and {% csrf_token %} in forms; proper AJAX token handling.mark_safe unless trusted; use json_script for JS.django.contrib.auth; validators in AUTH_PASSWORD_VALIDATORS.get_random_secret_key; store in env/secrets manager.DEFAULT_AUTHENTICATION_CLASSES and restrictive DEFAULT_PERMISSION_CLASSES; never leave AllowAny for protected endpoints.self.check_object_permissions(request, obj) for object‑level authz.fields=[...]; avoid exclude and "__all__".APP_DEBUG=false; generate app key; secure file perms.http_only, same_site, secure, short lifetimes.$request->only() / $request->validated(); avoid $request->all().{!! ... !!} for untrusted data.file, size, and mimes; sanitize filenames with basename.|raw unless trusted.csrf_token() and isCsrfTokenValid() for manual flows; Forms include tokens by default.exec/shell_exec; use Filesystem component.#[File(...)]; store outside public; unique names.realpath/basename and enforce allowed roots.eval("ruby code here")
system("os command here")
`ls -al /` # (backticks contain os command)
exec("os command here")
spawn("os command here")
open("| os command here")
Process.exec("os command here")
Process.spawn("os command here")
IO.binread("| os command here")
IO.binwrite("| os command here", "foo")
IO.foreach("| os command here") {}
IO.popen("os command here")
IO.read("| os command here")
IO.readlines("| os command here")
IO.write("| os command here", "foo")sanitize_sql_like for LIKE patterns.raw, html_safe on untrusted data; use sanitize allow‑lists.config.force_ssl = true).protect_from_forgery for state‑changing actions.rack-cors carefully.[Authorize] attributes; perform server‑side checks; prevent IDOR.HttpOnly/Secure; short timeouts.PreparedStatement/named parameters; never concatenate input.LoginModule stanzas; implement initialize/login/commit/abort/logout; avoid exposing credentials; segregate public/private credentials; manage subject principals properly.eval, child_process.exec with user input; use helmet for headers; hpp for parameter pollution.secure, httpOnly, sameSite; set NODE_ENV=production.npm audit; use security linters and ReDoS testing.expose_php=Off, log errors not display; restrict allow_url_fopen/include; set open_basedir.Secure, HttpOnly, SameSite=Strict); enable strict session mode.tessl i cisco/software-security@1.2.5evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
rules