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.
npx skills add PracticalSwan/agent-skills --skill netlify-edge-functionsgit clone --depth 1 https://github.com/PracticalSwan/agent-skillsWrote 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/skills/practicalswan/agent-skills/netlify-edge-functions)<a href="https://agentmods.dev/skills/practicalswan/agent-skills/netlify-edge-functions"><img src="https://agentmods.dev/badge/skills/practicalswan/agent-skills/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/skills/practicalswan/agent-skills/netlify-edge-functions"><img src="https://agentmods.dev/badge/skills/practicalswan/agent-skills/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.00123 | $0.05028 |
| Opus 5.5 | $0.00049 | $0.02011 |
| Sonnet 5.5 | $0.00025 | $0.01006 |
| Haiku 4.5 | $0.00012 | $0.00503 |
Grade D, and why
netlify-edge-functions scanned grade D with 3 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 18d 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 --> Sends data to an external URLmediumData exfiltration
A POST to an outside endpoint may be telemetry or may be exfiltration; either way the mod talks to somewhere, and you should know where.
context.waitUntil(fetch("https://analytics.example.com/event", { method: "POST" })); Makes network callslowCapability
Not a fault in itself. Listed so you know the mod talks to something, and to what.
async fetch(request: Request, context: Context) { This is a copy
95% identical to netlify-edge-functions — 55 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.
How it starts
The opening of the file, as written. The whole thing — 421 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Netlify Edge Functions
Use this form
// netlify/edge-functions/hello.ts
import type { Config, Context } from "@netlify/edge-functions";
export default async (request: Request, context: Context) => {
return new Response(`Hello from ${context.geo.country?.name ?? "somewhere"}`);
};
export const config: Config = { path: "/hello" };
- One file = one function: a default-export handler plus a named
configexport with the route. Alternatively, declare the route innetlify.toml. - The default export can also be a Fetchable module: an object with a
fetchmethod. Netlify callsfetchwith the same(request, context)arguments and uses its return value the same way; insidefetch,thisis the exported object. Use it to share one handler with other platforms that accept Fetchable modules.export default { async fetch(request: Request, context: Context) { return new Response("Hello"); }, }; export const config: Config = { path: "/hello" }; // still a named export RequestandResponseare global. ImportContextandConfigtypes from@netlify/edge-functions.- Read env vars with
Netlify.env.get().process.envworks only for Next.js middleware.
Avoid these:
- A file with no
config.pathorpatternand no[[edge_functions]]entry. It deploys but never runs. - Import maps in
deno.json. They are unsupported. Use a separate file with[functions] deno_import_map. - Variables set in
netlify.toml. They are invisible to edge functions. Netlify.env.set()orNetlify.env.delete()as persistence. They affect only the current invocation.fetch()to the same site for the current path. Usecontext.next()instead.
⚠️ Footguns
- No route = silent no-op. Edge functions get no automatic URL.
path: "/*"runs on every request, including assets. Narrow it, or addexcludedPath.- Caching needs both parts:
cache: "manual"in config AND cache headers on the returnedResponse. With only one, nothing is cached. - Cached functions shadow static files. A cached function on
/*serves/cat.pnginstead of the file. - Returning a
Responseends the chain. Redirect rules for that path never run. - Same-site
fetch()andURLrewrites start a new request chain. Matching edge functions run again. Usecontext.next()to reach the static asset or serverless function at the same path. - The request body can be read once. After
await req.json(), passnew Request(req, { body })tocontext.next(). - Same-named
foo.tsandfoo.js: the TS file is ignored and the JS file deploys. - 50 ms CPU per request, including
waitUntilwork. - Not executed on sites with Split Testing enabled.
- Custom Headers and basic-auth headers do not apply to edge functions.
- Not supported on HIPAA-compliant hosting.
netlify.appis on the Public Suffix List. Cross-subdomain cookies need a custom domain.
What ships with it
2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
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.
- 18d ago Changed · +38 lines scan C → D ef54a898940d
- 1mo ago Changed · +72 lines c923d876e26e
- 2mo ago Changed c0c8dcfa283f
- 2mo ago Changed 7c72170892e4
- 3mo ago First seen · 311 lines · 123 tokens per session scan C 6cf541b2a7f9
netlify-edge-functions is a skill published in the GitHub repository PracticalSwan/agent-skills (25 stars, last pushed 18d ago), licensed MIT. It adds 123 tokens to every session and 5,028 once invoked, about $0.0005 per session on Opus 5.5. A static security scan graded it D with 3 findings (hidden instructions, sends data to an external url, makes network calls). It is 95% identical to netlify-edge-functions, differing in 55 lines, and is treated as a copy.
netlify-edge-functions compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| netlify-edge-functionsPracticalSwan/agent-skills | Skill | 25 | 18d ago | MIT | D | 123 | Codex |
| cloud-native-cloudflare-workersj4flmao/agent-skills | Skill | 47 | 16d ago | MIT | A | 82 | Claude Code, Codex |
| hono-cloudflarebobmatnyc/claude-mpm-skills | Skill | 79 | 4mo ago | MIT | A | 29 | Claude Code |
| alchemy-providerpingdotgg/t3code | Skill | 89k | today | MIT | A | 153 | Claude Code, Codex |
| stripe-projectsNousResearch/hermes-agent | Skill | 268k | today | MIT | A | 15 | Claude Code, Codex |
| django-storages-s3Jeffallan/claude-skills | Skill | 13k | today | MIT | A | 138 | Claude Code |
| websocket-engineerJeffallan/claude-skills | Skill | 13k | today | MIT | A | 36 | Claude Code |