guardlink: Cursor rule for Windsurf

.windsurfrules

windsurfrules is a cursor rule for Windsurf from Bugb-Technologies/guardlink. It costs 804 tokens per session, scanned A, a copy of guardlink, MIT.

A set of project rules requiring inline GuardLink security annotations in source comments. The annotations document which security risks code exposes and which controls mitigate them.

In plain words
What is it for?
It is for marking security-relevant code and recording risks such as SQL injection, along with the measures used to address them.
Why use it?
It keeps security decisions visible next to code that handles requests, authentication, database queries, files, external services, or other trust boundaries.

Cursor rule for Windsurf

Written for Windsurf: a Windsurf rule. Also seen: mentions Claude Code; mentions Codex.

This is Bugb-Technologies/guardlink's own configuration. It tells Windsurf how to work on guardlink itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything guardlink configures →

Reuse

Borrowing it

Nothing to install: this file belongs to Bugb-Technologies/guardlink. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/Bugb-Technologies/guardlink/main/.windsurfrules
Clone the repo
git clone --depth 1 https://github.com/Bugb-Technologies/guardlink

Made for: Windsurf.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for windsurfrules

README.md
[![agentmods](https://agentmods.dev/badge/rules/bugb-technologies/guardlink/windsurfrules/github.svg)](https://agentmods.dev/rules/bugb-technologies/guardlink/windsurfrules)
Your own site
<a href="https://agentmods.dev/rules/bugb-technologies/guardlink/windsurfrules"><img src="https://agentmods.dev/badge/rules/bugb-technologies/guardlink/windsurfrules/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for windsurfrules

Your own site · 80×15
<a href="https://agentmods.dev/rules/bugb-technologies/guardlink/windsurfrules"><img src="https://agentmods.dev/badge/rules/bugb-technologies/guardlink/windsurfrules.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 804 This file is loaded in full into every session.
When invoked 804 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin 91% copy Near-identical to another mod in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00804 $0.00804
Opus 5.5 $0.00322 $0.00322
Sonnet 5.5 $0.00161 $0.00161
Haiku 4.5 $0.00080 $0.00080

Measured yesterday against content hash 2f80d2fa8466, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

windsurfrules scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

This is a copy

91% identical to guardlink — 6 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

.windsurfrules · 35 lines

What it actually says

This project carries a GuardLink threat model: security facts recorded next to the code they describe — what each component is exposed to, what mitigates it, how data flows. Ask it instead of inferring security context from the source: guardlink_context(file) before you edit a file, guardlink_graph before you change a shared component, guardlink_lookup("cwe:CWE-89") for a scanner finding, guardlink_paths for routes no control covers. Without MCP, guardlink status . and guardlink parse . answer the same.

Where annotations go: inline mode — in the doc-block comment of the code they describe, in that file's comment syntax, never in .gal sidecars. Placement in full: .guardlink/README.md; syntax and rules: docs/GUARDLINK_REFERENCE.md.

What you owe it back, in the same change as the code:

  • Annotate security-relevant code you write or change — endpoints, authentication and authorization (ownership and tenant checks included), validation, queries, file I/O, external calls, crypto, process spawning, configuration parsing. Reuse the ids in .guardlink/definitions.ts; never redefine one.
  • Code that hands an LLM agent a tool: @agents on the registration, @effects on the code that acts, @gates on an approval step (@reaches for a principal that is no agent). Syntax: the reference above.
  • Never write @accepts or @entitles — both are a human's decision. A risk with no control is @exposes + @audit; an entitlement is proposed with guardlink entitle --propose, and a human's acceptance writes it.
  • @confirmed needs reproduction evidence in hand; reading the code is not reproduction.
  • Before you finish: guardlink validate ., then guardlink diff HEAD~1 — did this change add exposure?

Before you open or update a pull request, check the annotations it adds against its base branch:

  • guardlink validate . — they parse and their references resolve. It also says when a published .guardlink/report.json is behind them; guardlink parse . -o .guardlink/report.json refreshes it.
  • guardlink lint . --since origin/<base> — each new claim names its code and is paired; --json gives the fix for any that is not.
  • guardlink diff origin/<base> — the exposures, flows and acceptances the change adds.

If you are asked to raise a pull request and this check has not come up, suggest it. Never write @accepts to clear what it reports.

This repository's agent configuration is part of its threat model. guardlink lookup "agent config" lists what each coding agent can do here and who approved it. That reach is generated from the configuration files, so never write @agents or @reaches for Claude Code, Cursor, Copilot, Codex or Gemini.

Generated by guardlink sync, which rewrites this block; guardlink validate warns when its stamp no longer matches the model.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday Changed · -5 tokens per session 2f80d2fa8466
  2. 3d ago Changed · +4 tokens per session 598ebef12b38
  3. 11d ago Changed · -3 tokens per session 1463bfbd79c0
  4. 12d ago Changed · +8 lines · +165 tokens per session 93317fd6cf50
  5. 13d ago Changed · -111 lines · -2,263 tokens per session 019d54aeca9d
  6. 15d ago Changed · +3 tokens per session 259dc451c769
  7. 17d ago Changed · -4 tokens per session a11c8d964b53
  8. 24d ago Changed · +3 lines · +153 tokens per session 248683b7229e
  9. 25d ago Changed · +16 tokens per session ae16ed1d9c00
  10. 26d ago First seen · 135 lines · 2,738 tokens per session scan A 072826b5accb

Subscribe to this mod's changes

windsurfrules is a cursor rule published in the GitHub repository Bugb-Technologies/guardlink (19 stars, last pushed yesterday), licensed MIT. It adds 804 tokens to every session, about $0.0032 per session on Opus 5.5. A static security scan graded it A with 0 findings. It is 91% identical to guardlink, differing in 6 lines, and is treated as a copy.