Ai proxy guard
Build a server-side proxy for LLM calls with response caching, rate-limiting, context caps, and per-call cost logging — keeping API keys off the client. Use whenever an app calls an LLM.From its SKILL.md
npx -y skills add prasadmogulothu/agent-skills --skill ai-proxy-guardAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
1.6 KB, 326 tokens by cl100k_base, as published. Nobody here has run it
ai-proxy-guard
Stop apps from calling LLM providers directly from the client (which leaks keys and blows up cost). Route every model call through a small server-side proxy with guardrails.
Build
- Server-side route that forwards requests to your LLM provider. The provider API key lives ONLY in server env vars — never in the client bundle.
- Auth check — only authenticated/authorised callers can hit the proxy.
- Input validation — validate and bound the request (schema + max input size). Treat user free-text as untrusted (consider prompt-injection).
- Context cap — trim the input to the minimum needed (e.g. a recent window), not everything.
- Caching — cache responses for inputs that repeat or change slowly; serve cache hits cheaply.
- Rate-limiting — per-user/IP limits to stop abuse-driven spend.
- Cost logging — log tokens + cost per call so spend is observable and capped.
- Batch where possible — prefer scheduled/batched calls over per-keystroke calls for non-interactive features.
Done when
No key is in any client bundle; cache + rate-limit + cost-cap are verified by tests; a sample call logs its cost.
Token tactics
This skill IS token optimisation: caching + context caps + batching are the levers. Build the proxy once; every feature reuses it. Bake any static prompt templates as files (built once), not regenerated at runtime.
What ships with it
Read from the repository
Just SKILL.md. No reference files, no scripts.