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-database)<a href="https://agentmods.dev/rules/netlify/context-and-tools/netlify-database"><img src="https://agentmods.dev/badge/rules/netlify/context-and-tools/netlify-database/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-database"><img src="https://agentmods.dev/badge/rules/netlify/context-and-tools/netlify-database.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.00153 | $0.03687 |
| Opus 5.5 | $0.00061 | $0.01475 |
| Sonnet 5.5 | $0.00031 | $0.00737 |
| Haiku 4.5 | $0.00015 | $0.00369 |
Grade C, and why
netlify-database scanned grade C with 2 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 11d 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/database/system.md — human-owned, merged by ctx-gen; edit system.md, not this section --> Makes network callslowCapability
Not a fault in itself. Listed so you know the mod talks to something, and to what.
`--prod`); if a preview also fails, report and stop. Never curl How it starts
The opening of the file, as written. The whole thing — 331 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Netlify Database
Managed Postgres built into Netlify. Netlify provisions the database, applies migrations on deploy, and creates a database branch for every deploy preview and agent run.
Use this, not that
// ✅ Modern: auto-configured, branch-aware
import { getDatabase } from "@netlify/database";
const db = getDatabase();
const users = await db.sql`SELECT * FROM users WHERE id = ${id}`;
// ✅ Drizzle: native adapter, connection configured automatically
import { drizzle } from "drizzle-orm/netlify-db";
export const db = drizzle({ schema });
// ❌ Legacy Neon extension: do not write new code with it
import { neon } from "@netlify/neon"; // reads NETLIFY_DATABASE_URL
Netlify Database reads NETLIFY_DB_URL. It does not read NETLIFY_DATABASE_URL.
Install
npm install @netlify/database # required: its presence triggers provisioning
npm install drizzle-orm@beta && npm install -D drizzle-kit@beta # Drizzle: @beta is mandatory
npm install -g netlify-cli # CLI 26.0.0+, Node 20.12.2+
Or run netlify database init --yes. It is non-interactive: it installs packages, scaffolds a starter migration, and verifies connectivity.
⚠️ No
@netlify/databaseinstalled means no database. Automatic provisioning only happens when the package is in the project. Without it, nothing is provisioned on deploy.
⚠️ Costs credits. Netlify Database is available on Credit-based plans only. An active database consumes credits for compute and bandwidth. Storage is currently free. Every active deploy preview uses one branch toward the plan's branch limit.
File layout
netlify/database/migrations/ # auto-applied on deploy; do not move
├── 20260301143000_create_users.sql # SQL-file format
└── 20260318091500_add_posts/migration.sql # subdirectory format
netlify/functions/*.ts # query from here or from edge functions
drizzle.config.ts # if using Drizzle
db/schema.ts, db/index.ts # Drizzle schema and client
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.
- 11d ago Changed · -58 lines · +47 tokens per session 7e3cefea4909
- 2mo ago Changed 6eeb21c806bb
- 3mo ago First seen · 389 lines · 106 tokens per session scan C 12322745c9d2
netlify-database is a cursor rule published in the GitHub repository netlify/context-and-tools (58 stars, last pushed today), licensed MIT. It adds 153 tokens to every session and 3,687 once invoked, about $0.0006 per session on Opus 5.5. A static security scan graded it C with 2 findings (hidden instructions, makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
netlify-database compared with cursor rules from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| netlify-databasenetlify/context-and-tools | Cursor rule | 58 | today | MIT | C | 153 | Cursor |
| aws-rds-best-practicesbeettlle/pi-spine | Cursor rule | 3 | today | MIT | A | 0 | Cursor |
| aws-rds-best-practicesbeettlle/CursorRules | Cursor rule | 2 | 15d ago | none | A | 0 | Cursor |
| rds-proxyGoranErhartic/cursor-development-rules | Cursor rule | 20 | 9mo ago | MIT | A | 18 | Cursor |
| planning-and-delegationprest/prest | Cursor rule | 4.6k | today | MIT | A | 912 | Cursor |
| integration-testsprest/prest | Cursor rule | 4.6k | today | MIT | A | 0 | Cursor |
| postgresqlPatrickJS/awesome-cursorrules | Cursor rule | 41k | 6mo ago | CC0-1.0 | A | 318 | Cursor |