feat(evaluators): add ATR threat detection evaluator#170
Open
eeee2345 wants to merge 2 commits intoagentcontrol:mainfrom
Open
feat(evaluators): add ATR threat detection evaluator#170eeee2345 wants to merge 2 commits intoagentcontrol:mainfrom
eeee2345 wants to merge 2 commits intoagentcontrol:mainfrom
Conversation
added 2 commits
April 9, 2026 22:57
Add contrib evaluator using ATR (Agent Threat Rules) community rules: - 20 regex rules covering OWASP Agentic Top 10 - Configurable severity threshold and category filtering - Pure regex, no API keys, <5ms evaluation time - Auto-discovered via entry points Source: https://agentthreatrule.org (MIT)
- _match_rules now returns all matching rules, not just first match - Add super().__init__(config) call - _coerce_to_string scans all priority dict fields, not just first - Add multi-match test and dict field scanning test - Backward-compatible: single-match fields still in metadata
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add a contrib evaluator using ATR (Agent Threat Rules) for regex-based AI agent threat detection. No API keys required.
Resolves #169
Evaluator details
atr.threat_rulesagent_control.evaluatorsentry pointATRConfigwithmin_severity,categories,block_on_match,on_errorConfig options
Key design decisions
findingsarray + backward-compatible single-match fields._coerce_to_string: Scans all priority dict fields (content,input,output,text,message), not just the first.on_errorpolicy — fail-open returnserrorfield, fail-closed returnsmatched=True.Files
Test plan
make test/make lint/make typecheck