Create the signatures directory
.yaml files from this directory at startup and merges them with the shipped catalog.Write your signature YAML
Create a YAML file for your signature. The filename does not matter — only the
id field inside the YAML is used for catalog merging.Signature YAML format
Every signature is a single YAML file with four top-level sections. The full schema:Signature ID format
IDs follow the pattern{CATEGORY}-{SUBCATEGORY}-{NUMBER}. Use a number above 099 for custom signatures to avoid colliding with the shipped catalog.
| Category | Prefix | Subcategories |
|---|---|---|
| Prompt Injection | INJ | D (direct), I (indirect), O (obfuscation) |
| Content Safety | CS | T (toxicity), B (bias) |
| Data Leakage | DL | P (PII), S (secrets) |
| System Prompt | SP | — |
| Agentic | AG | — |
Pattern types
| Type | Engine | Description |
|---|---|---|
regex | Rust regex crate | Regular expression match; ReDoS-immune by design |
substring | Aho-Corasick | Exact substring match; fastest available pattern type |
semantic | FAISS + MiniLM | Embedding similarity against reference phrases; catches paraphrasing |
perplexity | Heuristic | Entropy-based detection for statistically unusual text |
encoding | Heuristic | Detects encoded content: base64, rot13, hex |
unicode | Heuristic | Detects Unicode obfuscation (homoglyphs, invisible characters) |
Detection engines
| Engine | Install | Latency | Use when |
|---|---|---|---|
heuristic | Lite (all installs) | <0.3ms p99 | You have explicit patterns (regex, substrings, encoding) |
classifier | Standard/Full | <80ms p99 | You need ML-backed category classification |
semantic | Standard/Full | <80ms p99 | The threat can be paraphrased and you need embedding similarity |
llm-judge | Full | <2s p99 | Borderline cases requiring reasoning |
composite | Any | Sum of stages | You want to chain multiple engines for layered detection |
Direction
Setdirection to control which side of the conversation the signature inspects:
input— scans only user-supplied prompts (inbound)output— scans only LLM responses (outbound)bidirectional— scans both
Overriding shipped signatures
If your custom signature has the sameid as a shipped signature, it completely replaces the shipped version at startup. Use this to tune severity, patterns, or scoring without forking the package.
For example, to lower the anomaly points for INJ-D-001, create ~/.inferwall/signatures/inj-d-001-override.yaml with id: INJ-D-001 and your modified scoring.anomaly_points. The filename is irrelevant — only the id controls which entry wins.
Using a custom directory path
By default InferenceWall loads custom signatures from~/.inferwall/signatures/. Override this with the IW_SIGNATURES_DIR environment variable:
.yaml files in the specified directory are loaded and merged with the shipped catalog.
Testing your signatures
Every signature should include at least 3 true positive and 3 true negative test cases. True positives confirm the signature fires on real attack payloads; true negatives confirm it doesn’t fire on benign inputs that share vocabulary with the attack. Run a quick manual test via the CLI:MITRE ATLAS mapping
Use the optionalmeta.atlas field to map your signature to the MITRE ATLAS adversarial AI threat taxonomy. This helps security teams assess detection coverage and identify gaps.
AML.T0051.000 not AML.T0051). See Concepts: Signatures for the full ATLAS mapping reference.
Community signatures are licensed under CC BY-SA 4.0. If you modify a community signature and redistribute it, you must share your modifications under the same license. Add the license header at the top of every community signature file:
Further reading
Signature catalog
Browse all 100 built-in signatures with their IDs, categories, and ATLAS mappings.
Signature concepts
Deep dive into the three-layer catalog merge, scoring model, and ATLAS taxonomy.