Skip to content

feat: add AI evaluation for SA-01.01, SA-02.01, SA-03.01, SA-03.02 - #480

Open
vinayada1 wants to merge 1 commit into
ossf:mainfrom
vinayada1:feat/ai-security-assessment-prompts
Open

feat: add AI evaluation for SA-01.01, SA-02.01, SA-03.01, SA-03.02#480
vinayada1 wants to merge 1 commit into
ossf:mainfrom
vinayada1:feat/ai-security-assessment-prompts

Conversation

@vinayada1

@vinayada1 vinayada1 commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

Summary

Add optional AI evaluation paths for four OSPS security-assessment requirements:

Requirement added to the AI path Evaluation focus
OSPS-SA-01.01: design documentation System actions, actors, and interactions
OSPS-SA-02.01: external interfaces Documentation of external software interfaces and their contracts
OSPS-SA-03.01: security assessment Identification and prioritization of likely and impactful security problems
OSPS-SA-03.02: threat modeling Attack surface, critical paths, threats, and mitigations

Scope

This PR's new AI paths only evaluate evidence explicitly declared in Security Insights; they do not look for additional evidence on their own. Design review uses the declared detailed guide; interface review uses the detailed and quickstart guides; security-assessment and threat-model review use the declared self and third-party assessment evidence.

The AI evaluates the contents of those artifacts rather than treating a filename or declaration as proof of sufficient documentation. This PR does not add repository-wide evidence discovery, source-code scanning, arbitrary external fetching, or downstream-link traversal. Existing deterministic checks remain separate from these new AI paths.

Evidence and result handling

  • Fetch only same-repository GitHub blob/raw text URLs through the configured Contents API client, preserving the declared ref. Validate paths, formats, regular-file content, and UTF-8; do not follow redirects or download URLs.
  • Cache successful and failed reads across checks. Bound retrieval to 64 KiB per document, 16 distinct URLs, and a 64 KiB assembled evidence packet.
  • Defer unsupported, unavailable, comment-only, or incomplete declared evidence to NeedsReview without asking the model to grade a partial packet.
  • Keep AI optional. Without AI configuration or relevant declarations, use the deterministic path. Configured-provider, configuration, and response-validation failures return NeedsReview/Low; they do not preserve an earlier Pass or Fail.
  • Require affirmative documentary support for AI failures; absent or unfetched evidence alone should defer. Tighten the risk rubric to distinguish explicit likelihood-and-impact prioritization from generic security posture.
  • Return Low confidence for AI NeedsReview results and cap design passes at Medium.

Important SA-02.01 limitation

Every SA-02.01 AI pass recommendation is returned as NeedsReview/Low, requiring human confirmation. Live grading sometimes accepted insufficient interface documentation despite prompt tightening, so this is enforced in code, not merely requested by the prompt.

The original AI verdict, explanation, citations, and supplied material remain in the evidence for human review. AI Failed and NeedsReview responses retain their normal result handling. This intentionally also defers otherwise valid AI pass recommendations.

Non-AI behavior changes

SA-01.01 now applies the published-release applicability gate already used by the other three checks and guards optional SI documentation fields. Its deterministic missing-design result now explicitly uses Medium confidence. Release detection still uses GitHub Releases, not tags alone or releases distributed elsewhere.

Validation

  • Passed focused security-assessment and reusable-step tests, including prompt goldens, optionality/fallbacks, and SA-02 pass deferral with Low/Medium/High model confidence while preserving original evidence.
  • Passed go test -race ./data ./evaluation_plans/osps/sec_assessment ./evaluation_plans/reusable_steps -count=1.
  • Passed targeted golangci-lint, make -B build, and git diff --check after the final policy change.
  • Passed the native .github/scripts/ci.sh integration with all four supported catalog IDs.
  • Full go test ./... -count=1 and golangci-lint run ./... passed on the updated upstream before the final SA-02 policy change; the related checks above were rerun afterward.
  • Replayed genuine SI-declared Meshery and FDC3-Sail evidence through gpt-5.4-mini three times each: all nine final scanner results matched the expected Meshery SA-03.01 NeedsReview, FDC3-Sail SA-01.01 Passed, and FDC3-Sail SA-02.01 NeedsReview outcomes.

The committed opt-in live test exercises production grading with caller-supplied captured fixtures; it does not replace full scanner retrieval tests or run in the normal unit suite. These finite examples do not establish general model accuracy. Existing SI reader rate limiting and legacy-schema incompatibilities remain outside this PR.

Add optional AI review for design, interface, security assessment, and threat-model documentation explicitly declared in Security Insights. Fetch bounded same-repository text artifacts at their declared refs without repository-wide discovery or downstream link traversal.

Defer incomplete evidence and AI failures to manual review. Require human confirmation of interface pass recommendations while retaining the original AI evidence, and calibrate risk assessment grading around explicit likelihood-and-impact prioritization.

Apply the published-release gate to design documentation and add retrieval, prompt, result-handling, and opt-in live replay tests.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Vinaya Damle <vinayada1@users.noreply.github.com>
@vinayada1
vinayada1 requested a review from a team as a code owner September 10, 2026 19:11
@vinayada1 vinayada1 changed the title feat(sec-assessment): review Security Insights evidence with AI feat: add AI evaluation for SA-01.01, SA-02.01, SA-03.01, SA-03.02 Sep 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant