feat(classifier): harness risk classifier (split from #181) - #189
Open
raymondginger2018-sudo wants to merge 2 commits into
Open
feat(classifier): harness risk classifier (split from #181)#189raymondginger2018-sudo wants to merge 2 commits into
raymondginger2018-sudo wants to merge 2 commits into
Conversation
This was referenced Aug 22, 2026
Contributor
Author
|
@Zongwei9888 Per your 08-17 suggestion on #181, this is the risk classifier module split out as an independent PR: new files only ( CI status: Python CI / Desktop CI / Linting green; the Security CI failure is the repo-wide pip advisory (PYSEC-2026-3721 on the locked Ready for review. |
Prompt-injection defense: DEEPCODE_RISK_CLASSIFIER-gated classifier that scores incoming user/harness content before it reaches the loop. All new files; existing behavior untouched when the knob is off.
raymondginger2018-sudo
force-pushed
the
pr181/classifier
branch
from
August 25, 2026 07:01
55d4e63 to
f6e06a2
Compare
Contributor
Author
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
Splits the risk-classifier module out of #181 (maintainer suggestion). New files only — no existing behavior modified while
DEEPCODE_RISK_CLASSIFIERis unset.core/harness/classifier.pyis a prompt-injection defense: a fast rule-based scorer (keyword + boundary heuristics) that flags suspicious user/harness content before it reaches the loop, with aclassify(text) -> RiskDecisionAPI and an allowlist for expected patterns. Gated behindDEEPCODE_RISK_CLASSIFIERso behavior is opt-in.Tests
tests/test_harness_classifier.py— 14 passed locally.