Repository navigation
fix(responsible-ai): a Low rating showed as "moderate" risk - #130
Merged
Merged
Conversation
The Responsible AI badge was derived with `"high-risk" if rating == "high" else "moderate"`, so a system the skill rated Low showed as "moderate" risk on the Responsible AI page, the assessment page, the assessments list and `secfoo assessment show`. Found on a real run against openai/openai-quickstart-python: "Overall risk rating: Low", badge "moderate". A Critical rating would have been downgraded the same way, and an unparsable rating became a tier instead of "not rated". Map critical/high -> high-risk, medium -> moderate, low -> low-risk (green badge), anything else -> not rated. Tests cover every tier, the unknown rating, the coverage count, and the dashboard pages for a Low run. Co-Authored-By: Claude Fable 5.1 <[email protected]>
This was referenced Nov 15, 2026
Co-Authored-By: Claude Fable 5.1 <[email protected]>
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
While verifying the Responsible AI activity end to end (real
secfoo run --skill responsible-ai-compliance --agent claudeagainst openai/openai-quickstart-python, thensecfoo serve), the run rated the system Low and every view showed moderate with an amber badge:/responsible-ai,/assessments/1, the assessments list, andsecfoo assessment show.Cause:
RunRepository._responsible_ai_badgesdid"high-risk" if rating == "high" else "moderate". Only High was mapped; Low, Medium, Critical and even an unparsable rating all became "moderate".Fix
RESPONSIBLE_AI_RISK_BY_RATING: critical/high →high-risk, medium →moderate, low →low-risk; anything else → not rated (None, so the assessment is not listed or counted).low-riskgetsbadge--successin the templating filter.low-risk(green) and never "moderate" on/responsible-aiand the assessment page.Verified working (no change needed)
**Overall risk rating:** Low, six### [Low] Fn:findings, register and coverage notes; CLI counted 0/0/0/6.assessment update --status completedflips provisional → confirmed./,/responsible-ai,/activities/responsible-ai-compliance,/assessments,/assessments/1,/runs/<id>all 200 with no server errors.Gaps that are bigger than a fix are filed as hackathon issues (Responsible AI output contract and per-dimension dashboard; persisted rating and end-to-end tests).
🤖 Generated with Claude Code