Skip to content

fix: apply Agent Detector confidence slider to the confidence filter - #20

Merged
codelion merged 3 commits into
securade:mainfrom
Emart29:fix/agent-detector-confidence-threshold
Oct 2, 2026
Merged

codelion merged 3 commits into
securade:mainfrom
Emart29:fix/agent-detector-confidence-threshold

Conversation

@Emart29

@Emart29 Emart29 commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

The "Detection Confidence" slider on the Plugins page was passed to non_max_suppression as the IoU threshold, while the confidence filter was hardcoded at 0.5. Raising the slider therefore let more overlapping boxes through and never filtered on confidence.

This change uses the slider value for the confidence filter and leaves NMS at its default IoU of 0.5. The comparison is now >=, so a slider at 1.0 doesn't drop a detection with confidence 1.0.

Checked with a stubbed model reply of four boxes (confidences 0.9, 0.6, 0.3, plus a 0.7 box overlapping the 0.9 one):

Slider Before After
0.2 2 boxes 3 boxes
0.5 2 boxes 2 boxes
0.8 3 boxes (incl. the overlap) 1 box

Not tested against the live Gemini endpoint.

@CLAassistant

CLAassistant commented Oct 2, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

The "Detection Confidence" slider was passed to non_max_suppression as
the IoU threshold while the confidence filter was hardcoded at 0.5, so
raising the slider let more overlapping boxes through and never
filtered on confidence.

Use the slider value for the confidence filter and leave NMS at its
default IoU of 0.5.
@Emart29
Emart29 force-pushed the fix/agent-detector-confidence-threshold branch from f821864 to 361b8c8 Compare October 2, 2026 00:31
@codelion
codelion force-pushed the fix/agent-detector-confidence-threshold branch from 69e1277 to aaf6128 Compare October 2, 2026 01:41
It was not working and would fail PR checks.
@codelion
codelion force-pushed the fix/agent-detector-confidence-threshold branch from aaf6128 to 83b2a44 Compare October 2, 2026 01:41
Unit tests use a fake OpenAI client, including regression tests for the
confidence slider. A model-marked test runs the plugin end to end against
Qwen3.5-0.8B on CPU. GitHub Actions runs both.
@codelion
codelion merged commit 32a8f9a into securade:main Oct 2, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants