Skip to content

fix: exclude GenericLFI_BODY WAF rule for LLM agent requests#39

Merged
koljahuang merged 1 commit into
mainfrom
fix/waf-and-model-aliases
Apr 25, 2026
Merged

fix: exclude GenericLFI_BODY WAF rule for LLM agent requests#39
koljahuang merged 1 commit into
mainfrom
fix/waf-and-model-aliases

Conversation

@koljahuang

Copy link
Copy Markdown
Contributor

Summary

  • Add GenericLFI_BODY rule override (count mode) to AWSManagedRulesCommonRuleSet in WAF configuration
  • LLM agent system prompts contain file path patterns like ../../ that trigger the Generic Local File Inclusion detection rule, causing legitimate inference requests to be blocked with 403 Forbidden
  • Confirmed root cause via aws wafv2 get-sampled-requests: OpenCode agent requests (157KB body) were being blocked by GenericLFI_BODY

Test plan

  • Confirmed fix via WAF sampled requests analysis
  • Verified OpenCode Prometheus agent requests now succeed through proxy
  • Apply Terraform and verify WAF rule change in AWS console

…LM agent requests

Agent system prompts contain file path patterns (../../) that trigger the
GenericLFI_BODY rule in AWSManagedRulesCommonRuleSet, blocking legitimate
inference requests with 403 Forbidden. Switch to count mode to log without blocking.
@koljahuang koljahuang merged commit 9cd3202 into main Apr 25, 2026
11 checks passed
@koljahuang koljahuang deleted the fix/waf-and-model-aliases branch May 30, 2026 09:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant