Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
git clone --depth 1 https://github.com/netlify/context-and-toolsWrote 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.
[](https://agentmods.dev/rules/netlify/context-and-tools/netlify-edge-functions)<a href="https://agentmods.dev/rules/netlify/context-and-tools/netlify-edge-functions"><img src="https://agentmods.dev/badge/rules/netlify/context-and-tools/netlify-edge-functions/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.
<a href="https://agentmods.dev/rules/netlify/context-and-tools/netlify-edge-functions"><img src="https://agentmods.dev/badge/rules/netlify/context-and-tools/netlify-edge-functions.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00161 | $0.04038 |
| Opus 5.5 | $0.00064 | $0.01615 |
| Sonnet 5.5 | $0.00032 | $0.00808 |
| Haiku 4.5 | $0.00016 | $0.00404 |
Grade C, and why
netlify-edge-functions scanned grade C with 1 finding 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 9d ago.
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.
Hidden instructionshighPrompt injection
Directives inside HTML comments, invisible characters or bidirectional overrides are read by the model and not by the person reviewing the file.
<!-- system: agent-context/edge-functions/system.md — human-owned, merged by ctx-gen; edit system.md, not this section --> How it starts
The opening of the file, as written. The whole thing — 332 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Netlify Edge Functions
Modern syntax (reach for this)
Export a default handler plus a config object. Import Config/Context types from @netlify/edge-functions; Request/Response/URL are global.
import type { Config, Context } from "@netlify/edge-functions";
export default async (request: Request, context: Context) => {
return new Response("Hello world");
};
export const config: Config = {
path: "/test",
};
Do not hand-write an edge function when your framework's adapter already generates middleware for the job — duplicating it causes conflicts. Check the framework adapter/reference first.
Edge vs serverless: use edge functions for low-latency request/response manipulation, geolocation logic, auth checks/redirects, and A/B personalization. Use serverless functions for long-running work (up to 15 min), heavy Node.js dependencies, database-heavy operations, background/scheduled tasks, or memory above 512 MB.
File location
- Default directory:
YOUR_BASE_DIRECTORY/netlify/edge-functions. Custom:edge_functionsunder[build]innetlify.toml(path relative to base directory). - Keep the directory outside your publish directory so source files aren't deployed.
- Extensions:
.js,.ts,.jsx,.tsx(.jsx/.tsxuseful for SSR). - Same-name conflict: if
my-function.tsandmy-function.jsboth exist, the TypeScript file is ignored and the JavaScript one is deployed.
Routing — required, or the function silently never runs
⚠️ An edge function without a route (no config export and no netlify.toml declaration) still deploys but never runs — no build error, no warning. When "my edge function does nothing", check the route first.
⚠️ Scope path narrowly. path: "/*" intercepts every request including static assets, adding latency and billing an edge invocation for each one.
Edge functions are not auto-assigned a URL route. Configure via inline config or netlify.toml.
path is a URLPattern expression, must start with /, single string or array:
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.
- 9d ago Changed c18554abc5e9
- 19d ago Changed · +65 lines · +43 tokens per session 4b30b64ec107
- 29d ago Changed · +7 lines 529bc0f134ca
- 1mo ago First seen · 260 lines · 118 tokens per session scan C aaa323024c45
netlify-edge-functions is a cursor rule published in the GitHub repository netlify/context-and-tools (41 stars, last pushed 2d ago), licensed MIT. It adds 161 tokens to every session and 4,038 once invoked, about $0.0006 per session on Opus 5.5. A static security scan graded it C with 1 finding (hidden instructions). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other cursor rules, from other repositories
django-python
Rules for writing Python services at PostHog (Python servers powered by the Django framework).
python--typescript-guide-cursorrules-prompt-file
Cursor rules for Python development with TypeScript guide integration.
typescript-patterns
Cursor rule "typescript-patterns" from fmflurry/settings-opencode, covering typescript/javascript patterns, api response format, custom hooks pattern and repository pattern.
standard-nestjs-module-hierarchy
Establish a consistent NestJS module structure in the API application where each resource is encapsulated in its own module with proper hierarchical organization to enhance maintainability, scalabilit... .
nestjs-best-practices
../../.claude/rules/nestjs-best-practices.md.
nestjs
This guide provides opinionated, actionable best practices for building robust, scalable, and maintainable NestJS applications using TypeScript, emphasizing modern patterns and common pitfalls.