production-security

production-security is a cursor rule for Cursor from brendadeeznuts1111/betting-brain-v3. It costs 1,542 tokens per session, scanned A, original, MIT.

A set of rules for writing security-focused code for production systems, including services that handle real money at scale. It covers the same searchable risk patterns as unsafe parsing, SQL injection, date handling, and WebAssembly memory use.

In plain words
What is it for?
Use it to inspect production code for known risky patterns and to apply security practices while building or reviewing large-scale applications.
Why use it?
It helps prevent security and reliability problems that can affect live users and financial transactions. The rules provide consistent checks for code review and development.

Cursor rule for Cursor

Written for Cursor: installed under .cursor/.

Good fit Use it to inspect production code for known risky patterns and to apply security practices while building or reviewing large-scale applications.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/brendadeeznuts1111/betting-brain-v3/production-security
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.

Clone the repo
git clone --depth 1 https://github.com/brendadeeznuts1111/betting-brain-v3

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 production-security

README.md
[![agentmods](https://agentmods.dev/badge/rules/brendadeeznuts1111/betting-brain-v3/production-security/github.svg)](https://agentmods.dev/rules/brendadeeznuts1111/betting-brain-v3/production-security)
Your own site
<a href="https://agentmods.dev/rules/brendadeeznuts1111/betting-brain-v3/production-security"><img src="https://agentmods.dev/badge/rules/brendadeeznuts1111/betting-brain-v3/production-security/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for production-security

Your own site · 80×15
<a href="https://agentmods.dev/rules/brendadeeznuts1111/betting-brain-v3/production-security"><img src="https://agentmods.dev/badge/rules/brendadeeznuts1111/betting-brain-v3/production-security.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 1,542 This file is loaded in full into every session.
When invoked 1,542 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.01542 $0.01542
Opus 5 $0.00771 $0.00771
Sonnet 5 $0.00308 $0.00308
Haiku 4.5 $0.00154 $0.00154

Measured 11d ago against content hash 482254017f25, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

production-security 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 11d 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/production-security.mdc · 249 lines

How it starts

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

Production Security Patterns

Metadata:

  • Status: ✅ Active
  • Always Apply: true
  • Topics: #security #production #scale
  • Last Updated: 2025-10-07

🔍 Code Searchability Patterns

Find security-patterns Issues with ast-grep

# Find parseFloat($$$)
# Find env.$DB.prepare(`SELECT $QUERY`)
# Find new Date()
# Find WASM.*exports
ast-grep --pattern 'parseFloat($$$)' src/
ast-grep --pattern 'env.$DB.prepare(`SELECT $QUERY`)' src/
ast-grep --pattern 'new Date()' src/
ast-grep --pattern 'WASM.*exports' src/
sg -p 'parseFloat($$$)' src/
sg -p 'env.$DB.prepare(`SELECT' src/
sg -p 'new' src/
sg -p 'WASM.*exports' src/

security-patterns Discovery Commands

sg search "parseFloat" src/
sg search "SELECT" src/
sg search "new Date()" src/
sg search "WASM" src/

Search Examples

# Find parseFloat usage (security risk)
sg search 'parseFloat($$$)' src/
# Find SQL injection risks
sg search 'env.$DB.prepare(`SELECT' src/
# Find timezone issues
sg search 'new' src/
# Find WASM memory leaks
sg search 'WASM.*exports' src/

Overview

This rule enforces production-ready security patterns for sports betting platforms handling real money at scale.

All patterns are enforced via ast-grep rules in the rules/ directory.

Critical Security Rules

1. No parseFloat on Stakes (CRITICAL)

Rule: rules/no-parsefloat-stake.yaml

Why: parseFloat("100abc") returns 100, accepting garbage input. For betting stakes, this is catastrophic.

// ❌ DANGEROUS
const stake = parseFloat(userInput);  // Accepts "100abc" → 100

// ✅ SAFE
const stake = Number(userInput);
if (isNaN(stake) || stake <= 0) {
  throw Errors.validationError('Invalid stake amount');
}

Enforcement:

sg scan --filter "no-parsefloat-stake" --error

2. D1 SQL Injection Prevention (CRITICAL)

Rule: rules/d1-sql-injection.yaml

Why: Template literal interpolation bypasses D1's parameterization.

// ❌ SQL INJECTION RISK
const userId = request.query.id;
await env.ANALYTICS.prepare(`SELECT * FROM users WHERE id = '${userId}'`).all();

// ✅ PARAMETERIZED QUERY
await env.ANALYTICS.prepare(`SELECT * FROM users WHERE id = ?`)
  .bind(userId)
  .all();

Read the full file on GitHub · 249 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. 11d ago First seen · 249 lines · 1,542 tokens per session scan A 482254017f25

Subscribe to this mod's changes

production-security is a cursor rule published in the GitHub repository brendadeeznuts1111/betting-brain-v3 (8 stars, last pushed 11mo ago), licensed MIT. It adds 1,542 tokens to every session, about $0.0077 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-08-31.