fix(mcp): blunt slop oracle score output and add per-actor tool rate-limit#1194
Merged
Conversation
…limit
Two hardening changes for the gittensory_check_slop_risk /
gittensory_check_issue_slop MCP tools:
**Score blunting:** the exact numeric slopRisk (0–100) and the rubric
(which exposes band thresholds) are no longer returned. Callers now receive
only band (clean/low/elevated/high) and actionable findings. This prevents
systematic weight reverse-engineering via controlled inputs where an attacker
calls the tool with precisely one signal active, reads the score, and maps it
to the exact SLOP_WEIGHTS entry. The tool still accurately communicates
what would block a PR — only the enumerable internal weight values are
withheld. Existing tests updated to assert on band+findings, not the score.
**Per-actor rate-limit:** a tight per-actor cap (20 calls / 5 min) is now
enforced at tool-dispatch time using the RATE_LIMITER Durable Object, keyed
on `mcp-tool:{toolName}:{actor}`. Fails gracefully when RATE_LIMITER is
absent (test/local). This sits INSIDE the existing IP/token HTTP rate-limit
and catches actor rotation (same IP, multiple tokens).
Contributor
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1194 +/- ##
==========================================
- Coverage 94.80% 94.80% -0.01%
==========================================
Files 157 157
Lines 19090 19099 +9
Branches 6912 6915 +3
==========================================
+ Hits 18098 18106 +8
Misses 399 399
- Partials 593 594 +1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Closed
12 tasks
This was referenced Jul 2, 2026
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
Hardening for
gittensory_check_slop_riskandgittensory_check_issue_slop:Score blunting: the exact
slopRisk(0–100) andSLOP_RUBRIC_MARKDOWN(band thresholds) are no longer returned. Callers receive onlyband(clean/low/elevated/high) andfindings. Without the exact weight-per-signal and the band thresholds in the response, an adversary can't call the tool with one controlled signal active, read the score, and map it directly to aSLOP_WEIGHTSentry — they'd need many more experiments with no ground-truth to anchor on. The tool still fully communicates what would block a PR; only the enumerable internal constants are withheld.Per-actor rate-limit: a tight per-actor cap (20 calls / 5 min, keyed on
mcp-tool:{toolName}:{actor}) is enforced at tool-dispatch time using the existingRATE_LIMITERDurable Object. This sits inside the existing IP/token HTTP rate-limit and catches actor rotation (same IP, multiple tokens). Fails gracefully whenRATE_LIMITERis absent.Tool descriptions updated to not promise
slopRisk (0-100)or the rubric. Existing tests updated to assert onband + findings; new tests cover all four rate-limit branches.Scope
src/mcp/server.ts— blunt output, addenforceToolRateLimit, update descriptions, remove unused rubric importstest/unit/mcp-check-slop-risk.test.ts— update to assert band+findings (not score/rubric)test/unit/mcp-output-schemas.test.ts— 5 new tests covering score blunting + all rate-limit branchesValidation
npm run test:ci— 3 734 tests passSafety