security

A set of security rules for AI coding agents, covering secrets, file access, commands, dependencies, and generated code.

In plain words
What is it for?
Use it to guide safe file handling, secret management, input validation, database queries, dependency choices, and error reporting.
Why use it?
It reduces the chance of exposing credentials, weakening security checks, or running unsafe and destructive operations.

Cursor rule

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/packtman/ai-tools-secure-configs/security
Clone the repo
git clone --depth 1 https://github.com/packtman/AI-Tools-Secure-Configs
Per session 333 This file is loaded in full into every session.
When invoked 333 The same file — it is already loaded in full.
Security scan C 4 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 $0.00333 $0.00333
Opus 5 $0.00167 $0.00167
Sonnet 5 $0.00067 $0.00067
Haiku 4.5 $0.00033 $0.00033

Measured 2d ago against content hash 0bff060d3018, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade C, and why

security scanned grade C with 4 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.

Asks for rootlowPrivilege escalation

A mod that escalates privileges can change anything on the machine, not only the project.

- When creating Docker configurations, never run as root; use non-root users.

Downgraded: this mod is about security review, or the phrase is quoted, so it is likely naming the pattern rather than instructing it.

Downloads and executes remote codemediumSupply chain

curl | sh runs whatever the server returns today, which is not necessarily what it returned when this was reviewed.

- Never execute `curl | bash`, `wget | sh`, or piped-execution patterns.

Downgraded: this mod is about security review, or the phrase is quoted, so it is likely naming the pattern rather than instructing it.

Recursive force deletemediumDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

- Never run `rm -rf /`, `DROP DATABASE`, `FORMAT`, or other destructive commands without explicit user confirmation.

Downgraded: this mod is about security review, or the phrase is quoted, so it is likely naming the pattern rather than instructing it.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

- Never execute `curl | bash`, `wget | sh`, or piped-execution patterns.
cursor/rules/security.mdc · 35 lines

What it actually says

Security Rules

Never Do

  • Never read, display, log, or reference contents of .env, .env.*, or files under secrets/.
  • Never hard-code API keys, passwords, tokens, connection strings, or any credentials.
  • Never execute curl | bash, wget | sh, or piped-execution patterns.
  • Never run rm -rf /, DROP DATABASE, FORMAT, or other destructive commands without explicit user confirmation.
  • Never modify .ssh/, .aws/, .config/gcloud/, or other credential directories.
  • Never disable TLS verification, SSL checks, or certificate validation.
  • Never install packages from unverified sources or arbitrary URLs.

Always Do

  • Use environment variables for all secrets and configuration values.
  • Validate and sanitize all user inputs in generated code.
  • Use parameterized queries for database operations — never string concatenation.
  • Include error handling that does not leak sensitive information.
  • Follow the principle of least privilege for file permissions, IAM roles, and access grants.
  • Use well-maintained, actively-supported dependencies only.

Code Generation Standards

  • Add input validation to all public-facing functions.
  • Use secure defaults (HTTPS, strong encryption algorithms, secure cookie flags).
  • Generate code that passes common SAST tools (Semgrep, CodeQL, Bandit).
  • When creating Docker configurations, never run as root; use non-root users.
  • When generating CI/CD pipelines, never store secrets in plain text; use the platform's secrets mechanism.
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 · 35 lines · 333 tokens per session scan C 0bff060d3018

Subscribe to this mod's changes

security is a cursor rule published in the GitHub repository packtman/AI-Tools-Secure-Configs (4 stars, last pushed 2d ago), licensed MIT. It adds 333 tokens to every session, about $0.0017 per session on Opus 5. A static security scan graded it C with 4 findings (asks for root, downloads and executes remote code, recursive force delete). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.