Skip to content
vibespell

.cursor/rules/security.mdc

Cursor security rule for Godot

A focused Cursor `.mdc` rule for auth, secrets, and untrusted input. It attaches when those files change, instead of repeating security policy in every chat. This copy is written for a Godot project. This repository is a Godot 4 project. Scenes compose nodes, GDScript is statically typed where the file already types it, and gameplay reacts to signals instead of polling.

The example uses a balanced, readable style, pragmatic tests, and comments only where the intent is not obvious. Open the generator to make the agent stricter, switch to test-first, quiet the comments, or pick a different file.

The example assumes Godot 4 and GDScript. It does not assume C# or a third-party framework. If the repo is a Godot 3 project, do not use Godot 4-only APIs.

Example file

Balanced strictness, readable style, pragmatic tests. Download name: security.mdc

---
description: "Security rules for a Godot repository"
globs: "**/*{auth,Auth,secret,config,Config}*"
alwaysApply: false
---

# Security rules

Attach these rules when editing auth, config, or secret-handling code in this Godot repository.
This repository is a Godot 4 project. Scenes compose nodes, GDScript is statically typed where the file already types it, and gameplay reacts to signals instead of polling.

## Secrets and trust

- Do not put keys in an exported variable that ships with the game.
- Validate multiplayer RPCs on the server. The peer can send anything.
- Do not trust a client-reported score or inventory.

## Errors

- Fail at the boundary. Do not swallow errors.
- Use `push_error` for a broken setup and return early. Do not `assert` on a situation a missing export can cause in the editor.

## Done when

- Untrusted input is validated before a side effect.
- No secret was added to source, logs, or a client bundle.
- The script has no parser errors, and the scene you changed runs without a red error in the debugger.

Add it to the project

  1. 01

    Copy a starting file

    Copy the example Cursor security rule on this page, or open the generator if you want different testing, strictness, or comment rules.

  2. 02

    Save it at .cursor/rules/security.mdc

    Save it at `.cursor/rules/security.mdc` in the Godot repo. Narrow the globs if your auth and config files live in a known folder.

  3. 03

    Start a fresh agent session

    Rules files are read when a session starts. A chat that is already open may still be using the old instructions.

  4. 04

    Give it one small task

    Ask for one change a Godot agent often gets wrong, such as a node that connects a signal in code instead of checking a flag inside _process. If it ignores the file, confirm the path and start a new session.

Questions about this file

Where do I put Cursor security rule in a Godot repo?

Save it at `.cursor/rules/security.mdc` in the Godot repo. Narrow the globs if your auth and config files live in a known folder.

Which tools read this Cursor security rule?

Cursor loads `.cursor/rules/security.mdc` for files that match its globs. Pair it with the always-on project rule. It is not a substitute for code review.

What does the Godot example assume?

The example assumes Godot 4 and GDScript. It does not assume C# or a third-party framework. If the repo is a Godot 3 project, do not use Godot 4-only APIs.

Does VibeSpell upload my repository?

No. Recipe pages are static, and the generator builds the file in your browser from the options you pick. Your source code never leaves the machine.

Other files for Godot

Cursor security rule for other stacks