plan-llm-cost-guardrails

plan-llm-cost-guardrails is a skill for Claude Code from kensaurus/cursor-kenji. It costs 78 tokens per session (1,796 once invoked), scanned A, original, MIT.

A security and cost review plan for apps that use large language models (LLMs). It finds requests, agent loops, and other paths that could consume unlimited tokens or quota.

In plain words
What is it for?
Use it before launch or during an incident to review LLM call sites and plan controls for per-user usage, daily spending, and repeated failures.
Why use it?
One public endpoint, repeated request, or runaway agent can create an unexpectedly large bill. It plans token limits, spending cutoffs, breakers, fallbacks, and usage visibility.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the cursor-kenji plugin — 123 skills, 56 commands, 6 agents, 3 MCP servers shipped together

Good fit Use it before launch or during an incident to review LLM call sites and plan controls for per-user usage, daily spending, and repeated failures.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/kensaurus/cursor-kenji/plan-llm-cost-guardrails
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.

Any agent
npx skills add kensaurus/cursor-kenji --skill plan-llm-cost-guardrails
Clone the repo
git clone --depth 1 https://github.com/kensaurus/cursor-kenji

Made for: Claude Code.

Or install cursor-kenji, the plugin that ships this one along with the rest of its 123 skills, 56 commands, 6 agents, 3 MCP servers.

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 plan-llm-cost-guardrails

README.md
[![agentmods](https://agentmods.dev/badge/skills/kensaurus/cursor-kenji/plan-llm-cost-guardrails/github.svg)](https://agentmods.dev/skills/kensaurus/cursor-kenji/plan-llm-cost-guardrails)
Your own site
<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.

agentmods 80×15 button for plan-llm-cost-guardrails

Your own site · 80×15
<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>
Per session 78 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,796 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.00078 $0.01796
Opus 5 $0.00039 $0.00898
Sonnet 5 $0.00016 $0.00359
Haiku 4.5 $0.00008 $0.00180

Measured 8d ago against content hash d9276e9aca1c, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

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.

skills/plan-llm-cost-guardrails/SKILL.md · 170 lines

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)

  1. Propose — token cap, kill switch, breaker, or fallback
  2. Risk — worst-case spend × who can reach the path
  3. Keep-working — call sites that already bound tokens and account usage
  4. 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/chat can replay a 50K context until the bill dies; RPM-only does not count. Keep-working: summarizer path already sets max_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.

Read the full file on GitHub · 170 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. 8d ago First seen · 170 lines · 78 tokens per session scan A d9276e9aca1c

Subscribe to this mod's changes

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.

Related

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.

luisabwk/kraken · 72 tokens

firebase-ai

Use when setting up firebaseai, generating text/chat with Gemini, streaming AI output, building multimodal prompts, or handling AI errors.

evanca/flutter-ai-rules · 30 tokens

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.

timurgaleev/vibestack · 73 tokens

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.

nongjun/feishu-cursor-claw · 67 tokens

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".

patricio0312rev/skills · 51 tokens

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".

patricio0312rev/skills · 58 tokens