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.
git clone --depth 1 https://github.com/matank001/cursor-security-rulesWrote 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.
[](https://agentmods.dev/rules/matank001/cursor-security-rules/secure-dev-php)<a href="https://agentmods.dev/rules/matank001/cursor-security-rules/secure-dev-php"><img src="https://agentmods.dev/badge/rules/matank001/cursor-security-rules/secure-dev-php/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.
<a href="https://agentmods.dev/rules/matank001/cursor-security-rules/secure-dev-php"><img src="https://agentmods.dev/badge/rules/matank001/cursor-security-rules/secure-dev-php.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00000 | $0.00564 |
| Opus 5.5 | $0.00000 | $0.00226 |
| Sonnet 5.5 | $0.00000 | $0.00113 |
| Haiku 4.5 | $0.00000 | $0.00056 |
Grade A, and why
secure-dev-php 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 1mo 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.
How it starts
The opening of the file, as written. The whole thing — 46 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Secure PHP Development
These rules apply to all PHP code in the repository and aim to prevent common security vulnerabilities through strict handling of input, output, and execution.
All violations must include a clear explanation of which rule was triggered and why, to help developers understand and fix the issue effectively.
if code is in violation add a comment explaining why. don't generate code that violates these rules.
1. Do Not Use User Input in File Paths
- Rule: Never use
$_GET,$_POST, or any unsanitized input directly in file paths or file operations.
2. Always Sanitize User Input Before Use
- Rule: All external input (e.g.,
$_GET,$_POST,$_COOKIE,$_SERVER) must be sanitized before being used in logic, queries, or output.
3. Escape Output to Prevent XSS
- Rule: Always escape output when rendering user-controlled data into HTML.
4. Do Not Log Sensitive Input or Secrets
- Rule: Avoid logging passwords, tokens, or personal user data.
5. Use Constant-Time Comparison for Secrets
- Rule: Secrets such as tokens, signatures, or passwords must be compared using constant-time functions (e.g.,
hash_equals) to prevent timing attacks.
6. Use Strong Defaults for Encryption
- Rule: Default encryption settings must use secure algorithms and sufficient key lengths (e.g., RSA ≥ 2048 bits, AES-256).
7. Do Not Use unserialize() on Untrusted Input
- Rule: The
unserialize()function must not be used on data from user input or external sources. Usejson_decode()as a safer alternative.
8. Restrict File Includes to Known Values
- Rule:
include,require,include_once, andrequire_oncemust only be used with hardcoded or explicitly whitelisted file paths, not values derived from user input.
9. Do Not Create Files Based on Untrusted Input
- Rule: File creation functions (e.g.,
fopen,file_put_contents) must not use filenames derived from untrusted input without strict validation.
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.
- 1mo ago First seen · 46 lines · 564 tokens per session scan A a38710bdfbd4
secure-dev-php is a cursor rule published in the GitHub repository matank001/cursor-security-rules (381 stars, last pushed 1y ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 564 tokens. 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-30.
Other cursor rules, from other repositories
laravel-php-83-cursorrules-prompt-file
Cursor rules for Laravel development with PHP 8.3 integration.
laravel-package-development-guidelines
A set of coding rules for building Laravel packages, which are reusable extensions for Laravel applications. It covers package structure, code style, helper functions, type safety, editor suggestions, and documentation.
laravel-package-coding-standards
A set of coding rules for Laravel packages, with conventions for names and code across several development areas.
laravel-package-structure
A set of coding rules for organising a Laravel package, a reusable extension for Laravel applications.
laravel
Laravel: Eloquent, Form Requests, policies.
php
PHP 8.x+: typed properties, PSR standards.