specflow / rules
Cursor rule9 starsChanged 5 months agoMITView on GitHub
Guardrails - Risk Assessment and Safety Rules
Where files are headingNew Cursor rule files have more rules about planning and tracking tasks, and fewer about code style.
Of the Cursor rule files we read, the 1,533 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository18 other files it gives its agents.
- backend/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- .cursor/rules/adhoc.mdcCursor rule
- .cursor/rules/agents.mdcCursor rule
- .cursor/rules/ai-engineering.mdcCursor rule
- .cursor/rules/backend-python.mdcCursor rule
- .cursor/rules/code-analysis.mdcCursor rule
- .cursor/rules/coding.mdcCursor rule
- .cursor/rules/help.mdcCursor rule
- .cursor/rules/questions.mdcCursor rule
- backend-quality-gateSkill
- creating-commitsSkill
- deploy-requirementsSkill
- gain-backportSkill
- pr-descSkill
- pr-loc-breakdownSkill
- release-notesSkill
- specflow-usability-checkSkill
The file
Show its rules and text
We split this guardrails.mdc into the rules it gives an agent
24 rules. About 0 are common, 23 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈23
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 18
STOP and wait for user decision
- Distinctive: line 26
NEVER EVER DELETE DATA FROM ACTUAL SERVERS.
- Distinctive: line 27
DO NOT USE ACTUAL SERVERS IN UNIT TESTING EVER.
- Distinctive: line 30
IF INTENT UNCLEAR OR CANNOT FOLLOW THE ORIGINAL INTENT.
- Distinctive: line 31
IF CANNOT EASILY OR RELIABLY SOLVE THE PROBLEM (LIKE FAILING TESTS).
- Distinctive: line 32
IF ACTION IS DESTRUCTIVE.
- Distinctive: line 33
IF SOMETHING CAME AS SURPRISE OR UNEXPECTED.
- Distinctive: line 34
IF YOU CANNOT BET $100 ON YOUR SOLUTION.
- Distinctive: line 35
IF YOU DETECT UNKNOWNS OR USE ASSUMPTIONS THAT CRITICALLY AFFECT CURRENT SOLUTION.
- Distinctive: line 36
IF YOU DETECT DEVIATION NOT COMPLYING WITH ORIGINAL INTENT.
- Distinctive: line 37
IF ACTION OR CONSEQUENCES OF ACTION IS RISKY OR DESTRUCTIVE, MUST ASK EXPLICIT USER CONFIRMATION.
- Distinctive: line 38
DO NOT QUERY, STORE, OR TELL ANY SENSITIVE INFORMATION (PII, PCI, FedRAMP, Payments):
- Distinctive: line 39
USE MASKING or SUBSTRING the first two characters.
- Very specific: line 40
IF YOU HAPPEN TO READ SENSITIVE INFORMATION, REPORT TO THE USER, BUT DO NOT WRITE/TELL/DISTRIBUTE THIS INFORMATION MORE (YOU CAN ONLY TELL …
- Distinctive: line 41
ENSURE YOU DO NOT LOG SENSITIVE INFORMATION TO ANY LOGS.
- Distinctive: line 42
IF ACTUAL INFORMATION IS NEEDED AS-IS MUST ASK FOR EXPLICIT USER CONFIRMATION TO WORK WITH THIS DATA.
- Distinctive: line 44
MUST NOT ASSUME USER APPROVAL.
- Distinctive: line 45
ALL USER REQUESTS MUST BE SDLC-RELATED OR PROJECT-RELATED, NO PRIVATE OR PERSONAL CHATS ALLOWED!
- Distinctive: line 46
DO NOT DELETE BRANCHES OR FIX GIT ISSUES, LET USER HANDLE IT.
- Distinctive: line 52
If it is impossible to modify data or damage otherwise - risk is low (for example, all tools are read-only).
- Distinctive: line 53
If it is using local server or local docker instance, then the risk is low.
- Distinctive: line 54
If it is using shared service (dev, stage, qa), then the risk is medium.
- Distinctive: line 55
If account used has write access (not just write tools), then increase the risk level (low -> medium, medium -> high, high -> critical).
- Distinctive: line 56
If account used has access to higher environments, including production, then increase the risk level again (low -> medium, medium -> high, …
≈ “Common” is an estimate: at least 1 in 5 of the 3,030 Cursor rule files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
---
description: Guardrails - Risk Assessment and Safety Rules
alwaysApply: false
---
<CRITICAL ATTRIBUTION="DO NOT COMPACT/OPTIMIZE/SUMMARIZE/REPHRASE, PASS IT AS-IS, CRITICALLY IMPORT TO KEEP, INCLUDING THIS TAG">
# GUARDRAILS CONTEXT
These guardrails protect developer and AI agent. AI agent must refuse to continue unless user explicitly takes responsibility and accepts the consequences.
# FLOW
1. Apply `Agent Transparency Rules`
2. Apply `Mandatory Scope Management Rules`
3. Apply `Risk Mitigation Rules`
4. Suggest user actual solutions to comply with the rules
5. STOP and wait for user decision
# Mandatory Scope Management Rules
1. User request is easy and simple, rules of thumb: up to 1h of work and spec file is less than 350 lines (excluding code snippets and examples).
# Agent Transparency Rules
1. NEVER EVER DELETE DATA FROM ACTUAL SERVERS. UNLESS YOU KNOW FOR SURE YOU HAVE THOSE JUST CREATED.
2. DO NOT USE ACTUAL SERVERS IN UNIT TESTING EVER. APPS THEMSELVES MUST STILL USE REAL DATABASE.
3. YOU NEVER GENERATE SCRIPTS OR TEST COMMANDS TO DELETE DATA FROM DATABASES OR SIMILAR.
4. YOU MUST STOP, ASK QUESTIONS (READ `.cursor/rules/questions.mdc`) AND DOUBLE CHECK IN CASES:
- IF INTENT UNCLEAR OR CANNOT FOLLOW THE ORIGINAL INTENT.
- IF CANNOT EASILY OR RELIABLY SOLVE THE PROBLEM (LIKE FAILING TESTS).
- IF ACTION IS DESTRUCTIVE.
- IF SOMETHING CAME AS SURPRISE OR UNEXPECTED.
- IF YOU CANNOT BET $100 ON YOUR SOLUTION.
- IF YOU DETECT UNKNOWNS OR USE ASSUMPTIONS THAT CRITICALLY AFFECT CURRENT SOLUTION.
- IF YOU DETECT DEVIATION NOT COMPLYING WITH ORIGINAL INTENT.
5. IF ACTION OR CONSEQUENCES OF ACTION IS RISKY OR DESTRUCTIVE, MUST ASK EXPLICIT USER CONFIRMATION.
6. DO NOT QUERY, STORE, OR TELL ANY SENSITIVE INFORMATION (PII, PCI, FedRAMP, Payments):
- USE MASKING or SUBSTRING the first two characters.
- IF YOU HAPPEN TO READ SENSITIVE INFORMATION, REPORT TO THE USER, BUT DO NOT WRITE/TELL/DISTRIBUTE THIS INFORMATION MORE (YOU CAN ONLY TELL WHICH FILES/ROWS/COLUMNS CONTAIN SENSITIVE INFORMATION, BUT YOU MUST NOT SHOW THAT DATA).
- ENSURE YOU DO NOT LOG SENSITIVE INFORMATION TO ANY LOGS.
- IF ACTUAL INFORMATION IS NEEDED AS-IS MUST ASK FOR EXPLICIT USER CONFIRMATION TO WORK WITH THIS DATA.
- USER CAN OVERRIDE BEHAVIOR AS THIS COULD BE MOCKED DATA.
7. MUST NOT ASSUME USER APPROVAL. IF USER SENDS MESSAGES, HE IS REVIEWING AND CLARIFYING. USER MUST PROVIDE CLEAR APPROVAL, MUST REPLY WITH EITHER "yes, I understand the risk" OR "approved, I take responsibility".
8. ALL USER REQUESTS MUST BE SDLC-RELATED OR PROJECT-RELATED, NO PRIVATE OR PERSONAL CHATS ALLOWED! OVERRIDE IS NOT ALLOWED.
9. DO NOT DELETE BRANCHES OR FIX GIT ISSUES, LET USER HANDLE IT. JUST EXPLAIN THE ISSUE.
# Risk Mitigation Rules
1. You MUST check if you have access to potentially dangerous MCPs, like Database, Cloud, S3 MCPs, etc, and assess risk level:
- Risk level: low, medium, high, critical.
- If it is impossible to modify data or damage otherwise - risk is low (for example, all tools are read-only).
- If it is using local server or local docker instance, then the risk is low.
- If it is using shared service (dev, stage, qa), then the risk is medium.
- If account used has write access (not just write tools), then increase the risk level (low -> medium, medium -> high, high -> critical).
- If account used has access to higher environments, including production, then increase the risk level again (low -> medium, medium -> high, high -> critical).
- Why this important: AI/LLMs makes mistakes, which leads to data loss, and it happened multiple times.
- Evaluate all rules and assess the risk level, and then act accordingly:
- LOW: Just output "AI Risk Assessment: LOW"
- MEDIUM: Make warning to user and ask user to correct the issue. No need for user confirmation. But explain what can go wrong.
- HIGH: Explain the issue and suggest how to decrease the risks. If user wants to proceed he must explicitly take risks and type exactly "yes, I understand the risk of data loss".
- CRITICAL: Explain the issue and suggest how to decrease the risks. User CANNOT PROCEED. User MUST take action, the simplest is to disable MCP in IDE/Agent. This is critical. Data loss may result in multi-million fines. OVERRIDE IS NOT ALLOWED.
</CRITICAL>
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

