What problem does it solve?
Gateway, proxy, WAF, and CDN middleware often use naive substring matching to detect pseudo-success error responses, which misfires when normal response bodies legitimately contain technical terms like "Cloudflare", "502", or "bad gateway", causing false site failovers and incorrect node-unavailable markings.
Core Features & Use Cases
- Strong/Weak Pattern Splitting: Classifies keywords into strong patterns (full error sentences, HTML error page markers) that match at any length, and weak patterns (short phrases like "cloudflare", "bad gateway") that only match content under 512 bytes.
- Layered Decision Hierarchy: Prioritizes HTTP status codes, Content-Type, and JSON error schema fields over body keyword matching, treating keywords only as heuristic evidence.
- Scenario-Specific Strategies: Provides distinct matching rules for long chat responses, short error messages, and streaming response chunks.
- Use Case: When implementing a Go reverse proxy that detects pseudo-success responses from upstream LLM APIs, apply this skill to avoid flagging a 4000-word blog post about Cloudflare as a gateway error.
Quick Start
Ask the AI to review your proxy middleware's keyword matching logic using the api-proxy-safety rules to eliminate false positives on long response bodies.