PostHog / PostHog/warlock

prompt injection obfuscation detection

Open
#4 0 comments 0 reactions 1 assignee View on GitHub

@sarahxsanders is already working on this.

Since Apr 22, 2026.

Dominant language
TypeScript
Stars
0
Forks
1
PR merge metrics
No merged PRs in 30d

Description

attackers obfuscate prompt injection payloads to bypass pattern-based filters. current prompt injection rules match only literal English phrases. known techniques include:

  • zero-width Unicode characters inserted between letters
  • leetspeak substitutions
  • reverse-string / backwards-text
  • homoglyph attack
  • base64 / hex encoding of the payload

pattern-based security tools are always in an arms race. this is just the reality of creating a tool like this.

proposal

  1. unicode normalization at scan time: before YARA matching, pre-process content to strip zero-width characters and apply NKFC Unicode normalization (this requires an engine change, NOT a rule change)
  2. leetspeak-tolerant patterns
  3. base64 detection outside comments: extend to a payload rule that fires on any sufficiently long base64 string in content, not just comments
  4. document reverse-text detection as a known gap: needs a consumer-side solution

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.