security

security is a cursor rule for Codex, Cursor from KaelSensei/MagicAIBuilder. It costs 622 tokens per session, scanned A, original, MIT.

A set of security rules for a React Native app that uses JavaScript or TypeScript, HTML scraping, SQLite, and local device storage.

In plain words
What is it for?
Use it to guide development and merge checks for this app, including its Moxfield and Scryfall data access.
Why use it?
It defines limits for code execution, filesystem access, dependencies, and network connections so changes can be reviewed against privacy and security requirements.

Cursor rule for CodexCursor

Written for Cursor: a Cursor rule (.mdc). Also seen: installed under .agents/ (shared by several agents).

Good fit Use it to guide development and merge checks for this app, including its Moxfield and Scryfall data access.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/kaelsensei/magicaibuilder/security
Install

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.

Clone the repo
git clone --depth 1 https://github.com/KaelSensei/MagicAIBuilder

Made for: Codex, Cursor.

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 security

README.md
[![agentmods](https://agentmods.dev/badge/rules/kaelsensei/magicaibuilder/security/github.svg)](https://agentmods.dev/rules/kaelsensei/magicaibuilder/security)
Your own site
<a href="https://agentmods.dev/rules/kaelsensei/magicaibuilder/security"><img src="https://agentmods.dev/badge/rules/kaelsensei/magicaibuilder/security/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 security

Your own site · 80×15
<a href="https://agentmods.dev/rules/kaelsensei/magicaibuilder/security"><img src="https://agentmods.dev/badge/rules/kaelsensei/magicaibuilder/security.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 622 This file is loaded in full into every session.
When invoked 622 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 original 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.00622 $0.00622
Opus 5.5 $0.00249 $0.00249
Sonnet 5.5 $0.00124 $0.00124
Haiku 4.5 $0.00062 $0.00062

Measured 17d ago against content hash 3b8c0edd5920, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

security 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 17d 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.

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.

.agents/rules/security.mdc · 55 lines

How it starts

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

Security

MagicAIBuilder is a public web app with user accounts, personal API keys (/api/v1), moderation and paid AI calls. Treat every request as hostile until it is parsed and authorised.

Every route handler

  1. Authenticate when the action needs a user: requireAuth or requireDeckOwner (src/lib/auth/helpers.ts), authenticateApiKey and requireApiScope for API keys (src/lib/api/authenticate.ts), requireModerator for moderation (src/lib/auth/require-moderator.ts).
  2. Authorise by ownership. Query with the caller's user id. Never trust an owner id from the body or the URL. Never return another user's private data, not even in an error message.
  3. Parse input with Zod, with limits on string length, array size and quantities.
  4. Return an allowlist of fields, never a whole Prisma row.
  5. Rate-limit expensive or abusable endpoints (AI, import, provider proxies) with checkRateLimit (src/lib/rate-limit.ts).
  6. Test the signed-out case and the other-user case for every new or changed handler.

Secrets

  • Secrets live in environment variables read by server code only. Never give a secret a NEXT_PUBLIC_ name. Model API keys never reach the browser.
  • Never log secrets, tokens, cookies, API keys or whole request bodies. Log through src/lib/logger.ts.

Outbound requests

  • The server calls only documented provider hosts, through their adapter. Never fetch a URL taken from user input (SSRF). The card-image proxy accepts https://cards.scryfall.io/… only.
  • A new host the browser must reach goes into the Content Security Policy in src/lib/security-headers.ts, with the reason in the PR.

Code

  • No eval, no new Function, no dynamic import built from input.
  • No dangerouslySetInnerHTML with user or provider data. React escapes everything else.
  • Prefer well-known dependencies. CI blocks on a high-severity pnpm audit --prod finding.
  • No analytics, tracking or telemetry without the owner's decision.

Read the full file on GitHub · 55 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. 17d ago Changed · -1 lines · +82 tokens per session 3b8c0edd5920
  2. 2mo ago First seen · 56 lines · 540 tokens per session scan A 79660aac89e7

Subscribe to this mod's changes

security is a cursor rule published in the GitHub repository KaelSensei/MagicAIBuilder (2 stars, last pushed today), licensed MIT. It adds 622 tokens to every session, about $0.0025 per session on Opus 5.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-04.

Related

security compared with cursor rules from other repositories

security next to 6 cursor rules from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
securityKaelSensei/MagicAIBuilderCursor rule2todayMITA622Codex, Cursor
server-actionskrivoox/agent-stack-templateCursor rule302mo agoMITA0Cursor
projectkrivoox/agent-stack-templateCursor rule302mo agoMITA656Cursor
ui-design-systemkrivoox/agent-stack-templateCursor rule302mo agoMITA0Cursor
performancekrivoox/agent-stack-templateCursor rule302mo agoMITA0Cursor
prisma-schemakrivoox/agent-stack-templateCursor rule302mo agoMITA0Cursor
git-flowkrivoox/agent-stack-templateCursor rule302mo agoMITA302Cursor