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 kensaurus/cursor-kenji --skill plan-llm-cost-guardrailsgit clone --depth 1 https://github.com/kensaurus/cursor-kenjiWrote 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/kensaurus/cursor-kenji/plan-llm-cost-guardrails)<a href="https://agentmods.dev/skills/kensaurus/cursor-kenji/plan-llm-cost-guardrails"><img src="https://agentmods.dev/badge/skills/kensaurus/cursor-kenji/plan-llm-cost-guardrails/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/kensaurus/cursor-kenji/plan-llm-cost-guardrails"><img src="https://agentmods.dev/badge/skills/kensaurus/cursor-kenji/plan-llm-cost-guardrails.svg" alt="Reviewed on agentmods" width="80" height="20"></a>- NVIDIA SkillSpector pass
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.00078 | $0.01796 |
| Opus 5 | $0.00039 | $0.00898 |
| Sonnet 5 | $0.00016 | $0.00359 |
| Haiku 4.5 | $0.00008 | $0.00180 |
Grade A, and why
plan-llm-cost-guardrails 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 8d 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 — 170 lines — stays where its author put it; the contents beside it link to each section on GitHub.
LLM Cost-Guardrail Audit + Remediation Plan
Degree of freedom: HIGH — inventory call sites, score unbounded paths, plan. Stay plan-only. No limits or routing changes until approved.
This skill vs neighbors
| Skill | Owns |
|---|---|
| plan-llm-cost-guardrails (this) | Token / quota / runaway-loop plan |
audit-langfuse-llm |
Quality and cost traces |
audit-infra-cost |
Hosting / egress bill |
audit-llm-security |
Unbounded consumption as an attack |
How to reason (every plan item)
- Propose — token cap, kill switch, breaker, or fallback
- Risk — worst-case spend × who can reach the path
- Keep-working — call sites that already bound tokens and account usage
- Phase — caps → breakers → fallback → visibility (do not execute)
Worked example
Propose: per-user daily token cap + hard daily-spend kill switch on
lib/ai.ts. Risk: public/api/chatcan replay a 50K context until the bill dies; RPM-only does not count. Keep-working: summarizer path already setsmax_tokens. Phase: Phase 1 — caps & kill switch.
Role: Senior platform engineer (LLM spend + abuse resistance).
Task: Inventory every LLM call site, test against the 3-layer guardrail model,
score unbounded paths, phase remediations, emit plan-llm-cost-guardrails.md.
Audit & plan only — no limits or routing changes until approved.
Find every path to a runaway bill. Cap it. Change nothing until approved.
Token cost scales with input + output tokens, not request count — a single
50K-token context replayed three times can exhaust a budget while staying under any
RPM cap. Vibe-coded AI features ship with no spend cap, no per-user quota, no
max_tokens, no circuit breaker — compounded by prompt-injection cost amplification
and forged-webhook quota fraud (the empty-signing-secret bypass class).
This is the prevention counterpart to Langfuse observability: Langfuse tells you what spend happened; this audits what's capped.
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.
- 8d ago First seen · 170 lines · 78 tokens per session scan A d9276e9aca1c
plan-llm-cost-guardrails is a skill published in the GitHub repository kensaurus/cursor-kenji (9 stars, last pushed 2d ago), licensed MIT. It adds 78 tokens to every session and 1,796 once invoked, about $0.0004 per session on Opus 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-03.
Other skills, from other repositories
ai-evals-builder
Build AI evals using the Husain-Shankar framework (error analysis, open/axial coding, LLM-as-judge). Use when a user needs to create, improve, or debug evals for an AI product — including defining failure modes, building LLM judges, or setting up production monitoring for an LLM application.
firebase-ai
Use when setting up firebaseai, generating text/chat with Gemini, streaming AI output, building multimodal prompts, or handling AI errors.
ai-cost-guard
Find every code path that can run up a paid-inference bill without a ceiling (loops, retries, fan-out, agent steps, queues) and require a written dollar cap both in code and at the provider. Use before shipping anything that calls an LLM, speech, or image API, or when a bill was larger than expected.
ai-service
A shared service for connecting applications to language and media AI models. It supports text conversations, streaming responses, image understanding, PDF, audio and video analysis, and image generation through configured providers.
embedding-pipeline-builder
Builds document embedding pipelines with text chunking, embedding generation, indexing, and retrieval optimization. Use when users request "embedding pipeline", "document indexing", "text chunking", "RAG preprocessing", or "semantic indexing".
langchain-workflow-builder
Builds LLM applications with LangChain including chains, agents, memory, tools, and RAG pipelines. Use when users request "LangChain setup", "LLM chain", "AI workflow", "conversational AI", or "RAG pipeline".