guardlink: Cursor rule for Windsurf

.windsurfrules

windsurfrules is a cursor rule for Windsurf from Bugb-Technologies/guardlink. It costs 2,616 tokens per session, scanned A, original, MIT.

This project carries a GuardLink threat model.

Cursor rule for Windsurf

Written for Windsurf: a Windsurf rule.

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.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.svg" alt="Measured on agentmods" height="20"></a>
Per session 2,616 This file is loaded in full into every session.
When invoked 2,616 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 unknown No closer match found 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.02616 $0.02616
Opus 5 $0.01308 $0.01308
Sonnet 5 $0.00523 $0.00523
Haiku 4.5 $0.00262 $0.00262

Measured today against content hash 7703ed7d81b6, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, 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 today.

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.

.windsurfrules · 133 lines

How it starts

The opening of the file, as written. The whole thing — 133 lines — stays where its author put it; the contents beside it link to each section on GitHub.

This project carries a GuardLink threat model.

Where annotations go

Annotation mode: inline. Annotations live in source-file comments, in the comment syntax of the file you are editing — the doc-block of the function or module they describe.

/**
 * @exposes #api to #sqli [critical] cwe:CWE-89 -- "email concatenated into SQL"
 * @mitigates #api against #sqli using #prepared-stmts -- "parameterized via pg"
 */
export function login(email: string) { … }

Do not create .gal sidecars under .guardlink/annotations/ in this mode; a repo with both is a mixed repo, and that is the failure this section exists to prevent.

Core Requirement

Every time you write or modify code that touches security-relevant behavior, you MUST add GuardLink annotations in the same change. This includes: new endpoints, auth logic, data validation, database queries, file I/O, external API calls, crypto, process spawning, user input handling, config parsing. Do NOT annotate code that never touches a security boundary — formatters, UI components, pure helpers. Business logic that makes an authorization or ownership decision IS in scope: an IDOR or a missing tenant check lives in business logic.

Key Rules

  • ANNOTATE NEW CODE. When you add a function or endpoint that handles user input, accesses data, or crosses a trust boundary — add @exposes, @mitigates, @flows, @handles, or at minimum @comment. This is not optional.
  • NEVER write @accepts — that is a human-only governance decision. For risks with no mitigation: write @exposes + @audit + @comment suggesting potential controls.
  • NEVER write @entitles either — propose it with guardlink entitle --propose and a human's acceptance writes it, under their name. It claims a privilege is supposed to have this effect, so an over-grant closes a real escalation as by-design. Cite the authz code as file:line or the claim is inert. Never propose one for an ownership question (IDOR, tenant isolation).
  • Use @confirmed for verified exploits. When pentest/scanning/manual reproduction proves a threat is exploitable: @confirmed #threat on Asset [severity] -- "evidence". Distinct from @exposes (theoretical) — @confirmed means real, verified, no false positives. Without evidence in hand, @exposes stands and you do not promote it — reading the code is not reproduction. To get evidence: bugb intake "<brief>" builds a plan an operator approves, never you.
  • Preserve existing annotations — do not delete or mangle them.
  • Definitions (@asset, @threat, @control with (#id)) live in .guardlink/definitions.ts. Reuse IDs — never redefine. Add new definitions there first, then reference in source files.
  • Source files use relationship verbs: @mitigates, @exposes, @confirmed, @flows, @handles, @boundary, @comment, @validates, @audit, @owns, @assumes, @transfers, @feature. (@actor is a definition — it lives with @asset/@threat/@control. @entitles is proposed, not written.)
  • Triggers for the four verbs everyone forgets: wrote a test that pins a control → @validates #control for Asset. Code trusts a caller/library/platform to hold a property it never checks → @assumes Asset -- "what must hold". A threat becomes a vendor's or another team's responsibility → @transfers #threat from Source to Target (both ends must be declared assets; a vendor needs an External.* asset first). You know the accountable team → @owns team-id for Asset (bare token — no quotes, no #).
  • Write coupled annotation blocks: risk + control (or audit) + data flow + context note — plus @boundary when that flow crosses a trust change, and @handles when the asset touches classified data.
  • Avoid @shield unless a human explicitly asks to hide code from AI.

Read the full file on GitHub · 133 lines

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. today First seen · 133 lines · 2,616 tokens per session scan A 7703ed7d81b6

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 2,616 tokens to every session, about $0.0131 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-06.