Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIDeepSeekDeepSeekMuseMuse+22 more

    LLM App Cost, Guardrail & Rate-Limit Auditor

    1

    Plug unbounded max_tokens, infinite agent loops, missing timeouts/rate limits, and system-prompt injection across OpenAI, Anthropic, Gemini, LangChain, and Vercel AI SDK apps in Python and TypeScript.

    $9

    Secure checkout via Stripe

    Money-back guarantee

    Converts to your local currency at checkout

    Security scanned
    LLM App Cost, Guardrail & Rate-Limit Auditor

    LLM App Cost, Guardrail & Rate-Limit Auditor

    Example session with this skill installed

    Audit our Next.js (route.ts) and FastAPI (agent.py) OpenAI/Anthropic support bot before launch. Flag runaway token-cost traps, prompt injection, and missing timeouts/rate limits before editing any files.

    • Read your context and instructions
    • Compiled the llm app cost

    LLM App Cost, Guardrail & Rate-Limit Audit

    LLM Ops Readiness Score: 0 / 100 (Grade F) · Runaway-Cost Risk Tier: CRITICAL
    Detected SDKs: openai, anthropic, ai (Vercel AI SDK) · Findings: 3 Critical · 3 High · 2 Medium

    RuleSeverityLocationTrap DetectedGuardrail Fix
    LLM-COST-001Criticalagent.py:19client.responses.create(...) missing max_output_tokens capSet explicit max_output_tokens=800
    LLM-COST-002Criticalagent.py:14while True: tool loop has no max_steps or dollar budget capBound loop to for step in range(MAX_STEPS) + token budget check
    LLM-SEC-001Criticalroute.ts:22Untrusted ${userQuery} interpolated directly into system promptKeep system static; pass user input strictly in role: "user"
    LLM-COST-003Highroute.ts:9POST /api/chat has no per-user rate limit or daily token quotaAdd sliding-window rate limiter + per-user token cap
    LLM-REL-001Highagent.py:19Missing request timeout & retry backoffPass timeout=25.0 and bounded exponential backoff

    Hardened Python Agent Loop (Preview)

    MAX_STEPS = 6
    MAX_TOTAL_TOKENS = 12_000
    total_tokens = 0
    for step in range(MAX_STEPS):
        resp = client.chat.completions.create(
            model=MODEL_ID, max_tokens=800, timeout=25.0,
            messages=[{"role": "system", "content": STATIC_SYSTEM_PROMPT}, *history],
        )
        total_tokens += resp.usage.total_tokens
        if total_tokens > MAX_TOTAL_TOKENS:
            raise BudgetExceededError("Session token budget reached")
    

    Next Steps (Approval Required)

    Reply

    "Apply LLM cost & guardrail patches" to add token caps, bounded loops, rate-limit middleware, and usage telemetry (Grade F →

    Grade A / 100/100).

    Connects securely to your tools. The creator never sees your data.

    About this skill

    Ship Production AI Apps Without Runaway Token Bills or Prompt Injection

    Shipping an OpenAI, Anthropic, Gemini, Vercel AI SDK, or LangChain app to real users? One unbounded while True agent loop or missing max_tokens + rate limit can burn thousands of dollars overnight. LLM App Cost, Guardrail & Rate-Limit Auditor pairs a strictly read-only Python static analyzer (scripts/audit_llm_app.py) with production LLM FinOps and guardrail playbooks for Python and TypeScript.

    What It Catches (8 LLM Ops & Security Rules)

    • LLM-COST-001 (Critical): LLM calls missing explicit output caps (max_tokens, max_output_tokens, maxTokens, max_completion_tokens).
    • LLM-COST-002 (Critical): Agent/tool execution loops (while True, while (true), AgentExecutor, recursive runners) missing max_steps / maxSteps / max_iterations or budget caps.
    • LLM-COST-003 (High): Public LLM API routes (@app.post, export async function POST, router.post) missing per-user rate limiting or token quota checks.
    • LLM-REL-001 & 002 (High/Medium): Missing explicit request timeout / retry backoff (hung upstream worker exhaustion) and hardcoded model strings without fallback handling.
    • LLM-SEC-001 (Critical): Direct untrusted user-input interpolation inside system prompts / systemInstruction (high-risk prompt injection).
    • LLM-SEC-002 (High): Unvalidated LLM output passed straight into dangerous sinks (eval, exec, SQL interpolation, dangerouslySetInnerHTML, shell commands) without Zod/Pydantic validation.
    • LLM-OBS-001 (Medium): Missing token usage, cost, and latency telemetry (usage, prompt_tokens, input_tokens, usageMetadata).

    How to Use

    Ask your AI agent before launching any LLM-powered feature or agent workflow:

    • "Audit our Python & TypeScript LLM code for runaway token costs, missing rate limits, and prompt injection."
    • "Harden our AI support agent loop with max_tokens, max_steps, timeouts, and per-user rate limiting."

    Or invoke the read-only analyzer directly:

    python3 scripts/audit_llm_app.py --path src/ --format markdown
    

    What's Inside (15 Files)

    • SKILL.md — Deterministic 5-step LLM Ops & FinOps audit with 0–100 score & A–F grade
    • scripts/audit_llm_app.py — Pure Python 3 stdlib analyzer for Python & JS/TS across 6 major LLM SDKs (--fail-on CI gate)
    • references/ — LLM FinOps & rate-limiting playbook, prompt-injection & Zod/Pydantic output guardrails, and rule catalog
    • templates/ & examples/ — Audit report template, copy-paste Python/TS budget middleware, and worked AI support-bot audit
    • tests/ — Risky & hardened Python/TS LLM fixtures + runnable unit tests

    Security & Privacy Guarantee

    • 100% read-only & offline — never calls live LLM APIs, never opens .env* or API key files, zero network calls.

    Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for LLM Ops.

    Static source-code analysis of Python and JavaScript/TypeScript files; does not run live prompt-injection red-team probes or inspect provider billing dashboards.

    How to use

    1. 1

      Connect your agent to the Agensi MCP

      Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup

    2. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before buying a skill.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill goes through the trust checks below.

    Security scanned

    Checked by our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    Money-back guarantee

    Doesn't do what its page promises? You get your money back.

    Trust & safety

    Security scan

    Security scan passed 2 days ago

    Software
    Python 3.9+ (stdlib only)Node.js

    Permissions

    Terminal / Shell
    Read Files
    Write Files

    Bundled analyzer is 100% offline and read-only; never calls LLM APIs and never opens .env files. Write Files is only used after explicit user approval to apply guardrail patches.

    Listed2 days ago

    What's inside

    Frequently Asked Questions

    The skill performs a deterministic, read-only static analysis of your source code; it never executes your code, makes live API calls to LLM providers, or accesses your sensitive .env files.

    It supports both Python and JavaScript/TypeScript codebases, with native detection for major SDKs like OpenAI, Anthropic, Gemini, LangChain, and the Vercel AI SDK.

    Beyond just identifying risks, the skill generates ready-to-use Python and TypeScript code diffs so you can immediately patch missing rate limits or token caps.

    While LLMs are good at general review, this skill uses a specialized rule catalog designed to catch 'compounding' risks, such as how unauthenticated routes interact with agentic loops to create massive billing spikes.

    No, this is a static audit tool intended for pre-deployment checks or periodic security reviews; it does not provide real-time traffic filtering or active firewalling for running apps.

    You receive the full deterministic auditing engine, the production guardrail rule catalog, and the reporting module that generates executive readiness scores and blast-radius assessments.

    New in LLM Ops