agentleFS
fusebase-devfusebase-dev/fusebase-flow/.cursor/rules/fusebase-flow-security.mdc

fusebase-flow / rules

Cursor rule9 starsChanged 27 days agoMITView on GitHub

Fusebase Flow security/permissions rules. Use when changes touch auth, secrets, env files, deploy config, external messages, or production data.

  • Reads credentials

The file

We split this fusebase-flow-security.mdc into the rules it gives an agent

5 rules. About 0 are common, 1 is distinctive, and 4 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 4

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  • could be automatic: a setting could enforce it
  1. Distinctive:

    Never print secret values (FR-12).

    line 11
  2. Very specific:

    Never git add .env, credentials, private keys (FR-06).

    line 12
  3. Very specific:

    Never write a customer-visible external message without external_customer_visible_message approval artifact (FR-12).

    line 13
  4. Very specific:

    Never use a session key / cookie without session_key_or_cookie_use approval artifact (FR-12).

    line 14
  5. Very specific:

    Never modify auth/permission code without auth_or_permission_change approval artifact (FR-12).

    line 15

≈ “Common” is an estimate: at least 1 in 5 of the 6,668 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
fusebase-flow-security.mdc
---
description: Fusebase Flow security/permissions rules. Use when changes touch auth, secrets, env files, deploy config, external messages, or production data.
globs: ["**/auth/**", "**/middleware/**", "**/.env*", "**/secrets/**", "**/migrations/**", "**/*.sql", "**/deploy/**", ".github/workflows/**", "**/permissions/**"]
alwaysApply: false
---

# Fusebase Flow — security & permissions rules

## Hard prohibitions

- Never print secret values (FR-12). Redact in any output.
- Never `git add` `.env`, credentials, private keys (FR-06).
- Never write a customer-visible external message without `external_customer_visible_message` approval artifact (FR-12).
- Never use a session key / cookie without `session_key_or_cookie_use` approval artifact (FR-12).
- Never modify auth/permission code without `auth_or_permission_change` approval artifact (FR-12).

## Approval artifacts

If an action requires approval per `policies/approval-policy.yml`, an approval artifact must exist on disk. **The agent authors it on the operator's approval — never the operator by hand at a terminal.** For a Full-lane deploy, on the DP.6 phrase `approve deploy now` (forgiving — any case/spacing; legacy `APPROVE-DEPLOY-NOW` also passes) — the operator types only the phrase, never a composed sentence (Lightweight lane: a plain chat go-ahead, recorded via `approve-local.sh lightweight_deploy` — DP.12); for any other approval-gated action (protected-path edit, FR-25 baseline adoption, database migration, auth/permission change), once the operator OKs that specific action in chat. Authoring with NO operator authorization is self-approval and forbidden:

```
state/approvals/<action>-<slug>-<YYYYMMDD>.json
```

The agent runs this on that approval — the operator types no command: `bash hooks/local/approve-local.sh <action> <slug> "<reason>"`.

Hooks check for an unexpired artifact before allowing the action.

## Secret-pattern scanning

`policies/secret-patterns.yml` defines patterns that hooks block. If the operator pastes a secret-shaped string in chat, the `user_prompt_submit` hook surfaces a warning. If a write would persist a secret to disk, the `pre_tool_use` hook blocks.

## Categories that trigger this rule

- Auth middleware, permission checks, role/scope code, login/logout flows
- `.env`, secrets handling, credential storage, encryption code
- Outbound external messages (email, SMS, webhooks, public posts)
- Data export, bulk import, customer data movement
- Production DB writes outside the established repository pattern
- Deploy config, CI/CD pipeline, infra-as-code

## What this rule does NOT do

- General code review (use the `code-review` skill)
- Style/formatting concerns
- Performance (out of v0.1 scope)

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.