policy_file to a YAML policy which supports:
networksentries withasn,cidr,prefixes,url, orfile- optional
jq-pathorregexextraction for URL/file sources conditionswith named reusable groups (($name)references)ruleswith ordered, first-match-wins behavior
policy_file takes priority over rules_file and inline rules
.matches() takes a quoted regular expression, which is compiled when the policy loads. An invalid pattern stops the policy from loading instead of silently never matching.
Conditions can use path, userAgent, method, ip, headers["Name"] and browserMismatch. browserMismatch is "fake" when the user agent claims Firefox or Safari but sends Chromium client hints, "no-hints" when it claims Chromium but sends no client hints over HTTPS, and "" otherwise: