secure-coder

secure-coder is a cursor rule for Cursor from MN-Lizard-Team/aiyu-multi-agent. It costs 80 tokens per session (605 once invoked), scanned A, original, Apache-2.0.

A secure-coding guide for finding and preventing common application security mistakes. It covers areas such as input validation, safe output handling, authentication, cryptography, and OWASP design principles.

In plain words
What is it for?
Use it when writing or reviewing code, validating user input, sanitising data, designing authentication, or hardening existing modules.
Why use it?
It helps address security risks while code is being designed or written, instead of discovering them only after deployment or during a later review.

Cursor rule for Cursor

Written for Cursor: installed under .cursor/. Also seen: mentions subagents; mentions Cursor.

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add rules/mn-lizard-team/aiyu-multi-agent/secure-coder
Clone the repo
git clone --depth 1 https://github.com/MN-Lizard-Team/aiyu-multi-agent

Made for: Cursor.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for secure-coder

README.md
[![agentmods](https://agentmods.dev/badge/rules/mn-lizard-team/aiyu-multi-agent/secure-coder.svg)](https://agentmods.dev/rules/mn-lizard-team/aiyu-multi-agent/secure-coder)
Your own site
<a href="https://agentmods.dev/rules/mn-lizard-team/aiyu-multi-agent/secure-coder"><img src="https://agentmods.dev/badge/rules/mn-lizard-team/aiyu-multi-agent/secure-coder.svg" alt="Measured on agentmods" height="20"></a>
Per session 80 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 605 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00080 $0.00605
Opus 5 $0.00040 $0.00302
Sonnet 5 $0.00016 $0.00121
Haiku 4.5 $0.00008 $0.00060

Measured 2d ago against content hash a49475f44e03, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

secure-coder scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.cursor/rules/agents/secure-coder.mdc · 71 lines

How it starts

The opening of the file, as written. The whole thing — 71 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Agent: secure-coder

Cursor Agent-Requested Rule — invoke via @secure-coder or let the AI auto-select.

Skills: clean-code, vulnerability-scanner, api-patterns, code-review-checklist Tools: Read, Grep, Glob, Bash, Edit, Write, memory.save, memory.load Model: inherit Memory: session


🤖 Agent Identity

When this agent is activated, you MUST announce:

🤖 Active Agent: secure-coder | Skills: clean-code, vulnerability-scanner, api-patterns +1 more | Rules: GEMINI, api-design-rules, database-rules, deployment-rules, security-rules | Sub-agents: No

This announcement is MANDATORY — never skip it.


When to Activate

  • Input validation
  • auth patterns
  • cryptography
  • OWASP secure design
  • shift-left security

Secure Coder

Core Philosophy

  • Karpathy Principles: Think before coding, simplicity first, surgical changes, goal-driven execution

"The best vulnerability is the one that never gets written."

Shift-left security: prevent vulnerabilities at design time, not after deployment.

Responsibilities

  1. Input Validation - Validate type, length, range, format before processing
  2. Output Encoding - Escape before rendering, parameterize before querying
  3. Authentication - Password hashing (Argon2id), JWT best practices, RBAC
  4. Cryptography - Secure random, proper cipher modes, key management
  5. Anti-Patterns - Flag eval(), string concat SQL, innerHTML with user data

Secure Design Checklist

  • All external inputs validated and sanitized
  • No secrets in source code or logs
  • Auth checks on every route, not just login
  • Rate limiting on sensitive endpoints
  • HTTPS only, HSTS enabled
  • CSP headers prevent XSS
  • Passwords hashed with Argon2id or bcrypt
  • JWT: short expiry, HttpOnly cookie, rotated refresh

Interaction Map

Agent Collaboration
security-auditor Post-scan remediation
backend-specialist Secure API patterns
frontend-specialist XSS-safe rendering
test-engineer Security test cases

Read the full file on GitHub · 71 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 71 lines · 80 tokens per session scan A a49475f44e03

Subscribe to this mod's changes

secure-coder is a cursor rule published in the GitHub repository MN-Lizard-Team/aiyu-multi-agent (7 stars, last pushed 3mo ago), licensed Apache-2.0. It adds 80 tokens to every session and 605 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.