Repository navigation
Description
Problem: responsible-ai-compliance is the only governance skill, and it is also the only one of the main activities without its own output contract or dashboard. It falls through to the generic OUTPUT_CONTRACT in skills/renderer.py, which is shaped for code findings: a register with a CWE column and a Confirmed/Conditional/Latent verdict. A real run against openai/openai-quickstart-python (Claude, 2026-11-15) shows the result: six findings about missing model cards, audit trails and user disclosure, tagged CWE-668, CWE-778 or "unverified". The skill's own seven dimensions (documentation, bias and fairness, human oversight, transparency, data provenance, framework alignment, auditability and recourse) and its severity rubric (stakes of the decision × missing safeguards) appear nowhere in the data. The Responsible AI page (web/routes/responsible_ai.py) can therefore only show one badge per assessment (high-risk / moderate / low-risk, provisional / confirmed), and /activities/responsible-ai-compliance is the generic severity view.
Goal: a Responsible AI report whose structure matches the skill, parsed into columns, and a dashboard that answers "which dimension is failing, for which system, at what stakes".
Build:
RESPONSIBLE_AI_OUTPUT_CONTRACTinskills/renderer.py(registered inSKILL_OUTPUT_CONTRACTS), keeping the two invariants every skill shares (**Overall risk rating:**line,### [SEVERITY] Fn:headings). Sections: AI system profile (models and providers in use, what the system decides or influences, who is affected, stakes tier), Dimension coverage table (one row per dimension:adequate/partial/missing/not applicable, evidence, finding IDs), Findings with a Dimension column instead of CWE and an optional Framework column (NIST AI RMF function, EU AI Act article or risk class, internal policy ID) instead of the verdict, Remediation roadmap, Coverage notes.- Parse and persist. A
report/responsible_ai.pyparser (pure functions, likereport/sast.py) extracting the profile, the dimension table and per-finding dimension/framework into new tables (rai_dimensions,rai_findings), written atcomplete_run. Store the overall rating on the run too, so the badge no longer re-reads every report file on every page load (_responsible_ai_badgesandcount_assessments_with_responsible_ai_riskopen N files per request today). - Dashboard.
/activities/responsible-ai-compliancegets a dedicated page like the SAST and threat-modeling ones: a dimension × project heat map, open findings grouped by dimension, stakes tier per system, and the framework mapping when present./responsible-aigains low-risk and moderate counts next to high-risk and links each row to the dimension view. - AI-BOM cross-check. Include the assessment's AI-BOM (
ai_bom_items) in the brief when one is attached; the system profile lists models found in code that are not in the AI-BOM and vice versa; show the diff on the assessment page. - Skill text. Keep the rubric; add the instruction to fill the dimension table even when a dimension has no finding ("adequate" with evidence), and say that CWE is not expected.
- Docs:
docs/REFERENCE.mdgains a "Responsible AI program dashboard" section like the others, with a screenshot.
Where to look: src/secfoo/skills/definitions/responsible-ai-compliance.md, src/secfoo/skills/renderer.py (OUTPUT_CONTRACT, SKILL_OUTPUT_CONTRACTS), src/secfoo/report/sast.py and report/severity.py (parser patterns), src/secfoo/storage/repository.py (_responsible_ai_badges, complete_run, ai_bom_items), src/secfoo/web/routes/responsible_ai.py, activities.py and the *_dashboard.py modules, src/secfoo/web/templates/responsible_ai.html, tests/test_web/test_assessment_routes.py.
Relation: PR #130 (a Low rating showed as "moderate") is the floor this builds on; the custom-skills dashboard work in #92 may share the "render a skill's table dynamically" piece.
Done when: a run with the new contract parses into the dimension table (tests with a fixture report); the badge comes from the stored rating, with a migration test; the dimension view renders with real data (screenshot in the PR); the AI-BOM diff shows on an assessment with an attached BOM; docs updated.
Activity
feat(rai): Responsible AI output contract, program dashboard and AI-B…