Repository navigation
Addresses the Hermes plugin-catalog review blocker at 2070999.
- Fix a denial-of-service in the
environment_secretdetection regex
(llm_antidote/policy.py): the unbounded(?:\S*/)?env\balternative
backtracked quadratically on long single-line tool arguments (a ~100 KB run of
;took seconds perassess()while holding the GIL, stalling the whole
agent). Replaced with a bounded path form,
(?:^|[\s;&|])(?:[^\s;&|/]{0,256}/){0,16}env\b, which still detectsenv,
/usr/bin/env, and friends but in linear time. - Add
tests/test_policy_performance.py, timing the full sensitive-pattern set
plus_UPLOAD_SINK/_DOWNLOAD_EXECUTE(and_NETWORK_SINK/_REVERSE_SHELL)
on";"*150_000and"x=1;"*40_000, plus an end-to-end doubleassess(),
asserting a sub-second budget.
Before: ~4.4 s at 50 KB for the env pattern alone. After: ~34 ms at 150 KB.