Skip to content

Responsible AI: output contract, program dashboard and AI-BOM cross-check (#131) - #208

Open
Shruti070107 wants to merge 1 commit into
secfoo-com:mainfrom
Shruti070107:feat/responsible-ai-contract-dashboard-131
Open

Shruti070107 wants to merge 1 commit into
secfoo-com:mainfrom
Shruti070107:feat/responsible-ai-contract-dashboard-131

Conversation

@Shruti070107

Copy link
Copy Markdown

Fixes #131.

What changed

  • Adds RESPONSIBLE_AI_OUTPUT_CONTRACT for responsible-ai-compliance, registered in SKILL_OUTPUT_CONTRACTS. The report now asks for an AI System Profile, a seven-row Dimension Coverage table, a Findings Register with Dimension / optional Framework instead of CWE / verdict, detailed ### [SEVERITY] Fn: blocks, a remediation roadmap and coverage notes. The skill text tells the agent to mark no-finding dimensions adequate with evidence and to stop emitting CWE IDs.
  • Adds a pure parser (src/secfoo/report/responsible_ai.py) for the profile, dimension rows, dimension/framework/stakes-tagged findings and the overall rating. Legacy CWE-shaped reports still yield findings and a rating, but their CWE column is never mislabelled as a dimension.
  • Persists runs.overall_rating, rai_dimensions and rai_findings in the same transaction as complete_run(). Adds a one-time migration that backfills the rating from stored reports. Badges and count_assessments_with_responsible_ai_risk() now read the stored column, so page loads no longer open N report files; a missing report file no longer un-rates an assessment.
  • Replaces the activity page's generic SAST-shaped cards with a dedicated dashboard when contract-shaped data exists: coverage, dimension × project heat map, stakes tier per system, open findings by dimension, framework mapping and AI-BOM mismatches. A fuller /activities/responsible-ai-compliance/dimensions view carries evidence and complete finding text. Legacy reports still show the generic cards until a contract-shaped run exists.
  • Adds moderate/low risk counts and a per-row dimensions link to /responsible-ai.
  • Includes attached AI-BOM items in the run brief as reference data and shows the code-vs-BOM diff on both the assessment page and the dashboard.
  • Documents the dashboard in docs/REFERENCE.md with a real screenshot of the seeded page (docs/assets/responsible-ai-dashboard.png).

Tests

  • New parser tests using a contract-shaped fixture, including legacy fallback and case-insensitive AI-BOM name comparison.
  • New storage tests for structured persistence, stored-rating badge behavior, migration backfill and assessment deletion with RAI evidence retained.
  • New web/end-to-end tests for the dashboard, dimension page, moderate-risk counts and the assessment AI-BOM cross-check.
  • Updated the legacy end-to-end test to assert that a deleted report file keeps the stored rating.

Targeted RAI, storage and assessment suites pass. The repository's pre-existing Python 3.14 baseline failures are unchanged by this PR.

Screenshot

Responsible AI program dashboard

This is a PR from a fork for maintainers to merge; the contributor does not have push rights on secfoo-com/secfoo.

@Shruti070107
Shruti070107 requested a review from vsn411 as a code owner November 27, 2026 19:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant