agentleFS
griddynamicsgriddynamics/specflow/.cursor/rules/guardrails.mdc

specflow / rules

Cursor rule9 starsChanged 5 months agoMITView on GitHub

Guardrails - Risk Assessment and Safety Rules

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
  1. Distinctive:

    STOP and wait for user decision

    line 18
  2. Distinctive:

    NEVER EVER DELETE DATA FROM ACTUAL SERVERS.

    line 26
  3. Distinctive:

    DO NOT USE ACTUAL SERVERS IN UNIT TESTING EVER.

    line 27
  4. Distinctive:

    IF INTENT UNCLEAR OR CANNOT FOLLOW THE ORIGINAL INTENT.

    line 30
  5. Distinctive:

    IF CANNOT EASILY OR RELIABLY SOLVE THE PROBLEM (LIKE FAILING TESTS).

    line 31
  6. Distinctive:

    IF ACTION IS DESTRUCTIVE.

    line 32
  7. Distinctive:

    IF SOMETHING CAME AS SURPRISE OR UNEXPECTED.

    line 33
  8. Distinctive:

    IF YOU CANNOT BET $100 ON YOUR SOLUTION.

    line 34
  9. Distinctive:

    IF YOU DETECT UNKNOWNS OR USE ASSUMPTIONS THAT CRITICALLY AFFECT CURRENT SOLUTION.

    line 35
  10. Distinctive:

    IF YOU DETECT DEVIATION NOT COMPLYING WITH ORIGINAL INTENT.

    line 36
  11. Distinctive:

    IF ACTION OR CONSEQUENCES OF ACTION IS RISKY OR DESTRUCTIVE, MUST ASK EXPLICIT USER CONFIRMATION.

    line 37
  12. Distinctive:

    DO NOT QUERY, STORE, OR TELL ANY SENSITIVE INFORMATION (PII, PCI, FedRAMP, Payments):

    line 38
  13. Distinctive:

    USE MASKING or SUBSTRING the first two characters.

    line 39
  14. Very specific:

    IF YOU HAPPEN TO READ SENSITIVE INFORMATION, REPORT TO THE USER, BUT DO NOT WRITE/TELL/DISTRIBUTE THIS INFORMATION MORE (YOU CAN ONLY TELL …

    line 40
  15. Distinctive:

    ENSURE YOU DO NOT LOG SENSITIVE INFORMATION TO ANY LOGS.

    line 41
  16. Distinctive:

    IF ACTUAL INFORMATION IS NEEDED AS-IS MUST ASK FOR EXPLICIT USER CONFIRMATION TO WORK WITH THIS DATA.

    line 42
  17. Distinctive:

    MUST NOT ASSUME USER APPROVAL.

    line 44
  18. Distinctive:

    ALL USER REQUESTS MUST BE SDLC-RELATED OR PROJECT-RELATED, NO PRIVATE OR PERSONAL CHATS ALLOWED!

    line 45
  19. Distinctive:

    DO NOT DELETE BRANCHES OR FIX GIT ISSUES, LET USER HANDLE IT.

    line 46
  20. Distinctive:

    If it is impossible to modify data or damage otherwise - risk is low (for example, all tools are read-only).

    line 52
  21. Distinctive:

    If it is using local server or local docker instance, then the risk is low.

    line 53
  22. Distinctive:

    If it is using shared service (dev, stage, qa), then the risk is medium.

    line 54
  23. Distinctive:

    If account used has write access (not just write tools), then increase the risk level (low -> medium, medium -> high, high -> critical).

    line 55
  24. Distinctive:

    If account used has access to higher environments, including production, then increase the risk level again (low -> medium, medium -> high, …

    line 56

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
guardrails.mdc
---
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>

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.