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/KaelSensei/MagicAIBuilderWrote 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/kaelsensei/magicaibuilder/security)<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.
<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>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.00622 | $0.00622 |
| Opus 5.5 | $0.00249 | $0.00249 |
| Sonnet 5.5 | $0.00124 | $0.00124 |
| Haiku 4.5 | $0.00062 | $0.00062 |
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.
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
- Authenticate when the action needs a user:
requireAuthorrequireDeckOwner(src/lib/auth/helpers.ts),authenticateApiKeyandrequireApiScopefor API keys (src/lib/api/authenticate.ts),requireModeratorfor moderation (src/lib/auth/require-moderator.ts). - 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.
- Parse input with Zod, with limits on string length, array size and quantities.
- Return an allowlist of fields, never a whole Prisma row.
- Rate-limit expensive or abusable endpoints (AI, import, provider proxies) with
checkRateLimit(src/lib/rate-limit.ts). - 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, nonew Function, no dynamic import built from input. - No
dangerouslySetInnerHTMLwith user or provider data. React escapes everything else. - Prefer well-known dependencies. CI blocks on a high-severity
pnpm audit --prodfinding. - No analytics, tracking or telemetry without the owner's decision.
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.
- 17d ago Changed · -1 lines · +82 tokens per session 3b8c0edd5920
- 2mo ago First seen · 56 lines · 540 tokens per session scan A 79660aac89e7
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.
security compared with cursor rules from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| securityKaelSensei/MagicAIBuilder | Cursor rule | 2 | today | MIT | A | 622 | Codex, Cursor |
| server-actionskrivoox/agent-stack-template | Cursor rule | 30 | 2mo ago | MIT | A | 0 | Cursor |
| projectkrivoox/agent-stack-template | Cursor rule | 30 | 2mo ago | MIT | A | 656 | Cursor |
| ui-design-systemkrivoox/agent-stack-template | Cursor rule | 30 | 2mo ago | MIT | A | 0 | Cursor |
| performancekrivoox/agent-stack-template | Cursor rule | 30 | 2mo ago | MIT | A | 0 | Cursor |
| prisma-schemakrivoox/agent-stack-template | Cursor rule | 30 | 2mo ago | MIT | A | 0 | Cursor |
| git-flowkrivoox/agent-stack-template | Cursor rule | 30 | 2mo ago | MIT | A | 302 | Cursor |