# cost-control
2 articlestagged with “cost-control”
MCP Denial of Wallet: Preventing Token Consumption Attacks
A defense-focused guide to understanding denial-of-wallet attacks via MCP -- how malicious servers create overthinking loops causing 142.4x token amplification -- and implementing budget controls, rate limiting, and cost monitoring to protect LLM endpoints.
mcpdenial-of-wallettoken-amplificationcost-controldefenserate-limiting
Rate Limiting and Abuse Prevention for LLM APIs
Walkthrough for implementing rate limiting and abuse prevention systems for LLM API endpoints, covering token bucket algorithms, per-user quotas, cost-based limiting, anomaly detection, and graduated enforcement.
rate-limitingabuse-preventionapi-securitytoken-bucketcost-controldefensewalkthrough