Skip to main content
Policies separate detection configuration from detection logic. Instead of changing code to raise a block threshold or demote a noisy signature to monitor-only, you edit a YAML file. InferenceWall auto-discovers policy files at startup, so changes take effect on the next restart without any package modification.
1

Copy the default policy

This gives you the exact policy that ships with InferenceWall as a starting point, with all five thresholds and an empty signatures map.
2

Edit thresholds, mode, and per-signature overrides

Open ~/.inferwall/policies/my-policy.yaml and modify the values you want to change:
3

Point InferenceWall at your policy

Drop the file into ~/.inferwall/policies/ and InferenceWall will auto-discover it on the next startup. To explicitly select a specific file, set IW_POLICY_PATH:
IW_POLICY_PATH is useful in CI/CD pipelines or container deployments where you want deterministic policy selection rather than auto-discovery.

Policy YAML fields

Top-level fields

Thresholds

Enforcement modes

Per-signature overrides

Override individual signatures within the signatures map:

Override precedence

When multiple sources could set a signature’s action, InferenceWall resolves them in this order (highest wins):
  1. Per-signature overridesignatures.<ID>.action in the policy file
  2. Global policy mode — the top-level mode field
  3. Signature default actiontuning.default_action in the signature YAML

Environment variable

When set, InferenceWall loads exactly this file and skips auto-discovery. When unset, it discovers all .yaml files in ~/.inferwall/policies/.

Auto-discovery

Drop any .yaml file into ~/.inferwall/policies/ and InferenceWall will pick it up on the next startup. Use this when managing multiple policy profiles (e.g., strict.yaml, permissive.yaml) and switching between them by setting IW_POLICY_PATH.
Recommended rollout workflowRoll out new policies gradually to avoid unexpected blocking in production:
1

Deploy in monitor mode

Set mode: monitor. All signatures run and log matches, but no requests are blocked.
2

Observe logged matches

Watch the scan logs for 1–2 weeks. Identify which signatures fire most often and which generate false positives.
3

Allowlist false positives

For signatures that fire on known-benign traffic, set action: monitor in the per-signature overrides.
4

Enforce high-confidence signatures individually

Flip signatures you trust to action: enforce one at a time, monitoring the effect of each change.
5

Switch global mode to enforce

Once you’re confident in the policy, set mode: enforce to activate blocking globally.

Further reading

Policy concepts

How InferenceWall resolves policies, applies overrides, and manages the policy lifecycle.

Scoring concepts

The anomaly scoring model: confidence weighting, diminishing corroboration, and threshold math.