agentleFS
silvioventresilvioventre/lovable-skills/skills/security/secure/SKILL.md

secure

Skill4 starsChanged 4 months agoMITView on GitHub

Use when the user asks about the security of their app, wants a security review or audit, is about to publish or go live, or is building anything that handles credentials, payments, personal data, roles, or permissions — "is this secure", "review my security", "check for vulnerabilities", "am I safe to publish", "where do I put my API key", "set up RLS", "add authentication", "can users see each other's data", "protect this route". Also use when a change touches secrets, API keys, edge functions, row-level security, login, sessions, or role checks. Routes the concern to the right layer — frontend, edge function, database policy, or authentication — and applies the rule that belongs there. Not for platform account security or general web security theory; this is about the code in this app.

4 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

3 rules. 0 are common, 3 are distinctive, and 0 are very specific to this project.

  • 0

    Common

    Most of the 3 edited versions we read keep these.

  • 3

    Distinctive

    This author's own choices. Worth a look.

  • 0

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    If the request spans layers — most real ones do — start at reference/review.md and let it dispatch.

    line 35
  2. Distinctive:

    Assume all client input is hostile: Not because the user is, but because the request can be replayed, edited, or forged by anyone …

    line 41
  3. Distinctive:

    Secrets never reach the browser: Not in code, not in a config file, not in a build-time variable, not in a comment.

    line 49

“Common” is measured: kept by at least 6 in 10 of the 3 edited versions of this file we could read. “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
SKILL.md

Secure

Lovable apps have three layers, and each has exactly one security job. Nearly every real vulnerability comes from putting a decision in the wrong layer.

LayerRunsTrustJob
FrontendIn the user's browserNone. Public, inspectable, modifiablePresentation only. Never decides access
Edge functionsServer-side, isolatedTrustedValidation, authorisation, business logic, external calls
Database (RLS)In the databaseTrustedEnforces row access even when the layers above fail

The frontend is not a weak line of defence — it is not a line of defence at all. Anything shipped to the browser is readable and changeable by anyone who wants to.

Route the concern

The question or taskPlaybook
Where do I put an API key, token, or secret?reference/frontend.md
Is there anything sensitive exposed in my client code?reference/frontend.md
Is form or input validation enough as written?reference/frontend.md
What belongs server-side rather than in a component?reference/edge-functions.md
Calling an external or paid API safelyreference/edge-functions.md
Payments, uploads, registration, anything multi-stepreference/edge-functions.md
Can users see or change each other's data?reference/rls.md
Setting up or reviewing row-level securityreference/rls.md
Team, organisation, or shared-record access rulesreference/rls.md
Login, sessions, roles, protecting a routereference/auth.md
Admin areas and privileged actionsreference/auth.md
Full security review, or "am I safe to publish?"reference/review.md

If the request spans layers — most real ones do — start at reference/review.md and let it dispatch.

The rules that hold everywhere

Every security decision is made server-side. Authentication, authorisation, validation, pricing, quotas, role checks. The browser may reflect a decision; it may never make one.

Assume all client input is hostile. Not because the user is, but because the request can be replayed, edited, or forged by anyone regardless of what your UI allows.

Hiding is not protecting. A button that is not rendered, a route not linked, a field disabled — none of these stop the underlying request. If the API allows it, it is allowed.

RLS is the floor, not the fallback. Policies enforce access even when a function has a bug or a query is wrong. An app whose safety depends on every query being written correctly has no floor.

Never widen a policy to unblock a feature. A policy relaxed during development is a data leak that ships. Express the real rule instead.

Secrets never reach the browser. Not in code, not in a config file, not in a build-time variable, not in a comment. A secret that was ever shipped to a client must be treated as compromised and rotated, not deleted and forgotten.

When you find something

Report by severity, and be specific about what an attacker can actually do — not "the key is exposed", but "any visitor can read this key from the bundle and issue paid API calls on your account".

SeverityMeaning
CriticalExploitable now, with real consequences: exposed live secrets, data readable across users, an unprotected privileged action
HighA decision made in the wrong layer that is currently reachable
MediumMissing defence in depth — the exposure is not reachable today, but only by accident
LowHardening, and practices worth changing before they matter

Fix critical findings immediately and say what needs rotating. Never report an app as secure because a scan passed: automated checks cover configuration and known patterns, not whether your access rules express what you actually meant.

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.