Skip to content

Add AI-assisted assessment for OSPS-SA-03.02 threat modeling #434

Description

@vinayada1

Summary

Add AI-assisted evaluation for OSPS-SA-03.02: when a project has made a release, it must perform threat modeling and attack-surface analysis covering critical code paths, functions, and system interactions.

This is an AI-content-review follow-up to #426. That PR detects declared Security Insights assessments and correctly returns NeedsReview because metadata and keywords cannot establish that the artifact is substantive. This issue adds bounded artifact inspection so the scanner can assess the contents when AI is configured while preserving the deterministic/manual fallback.

Approach

Implement a control-specific assessment in evaluation_plans/osps/sec_assessment:

  • Apply only when at least one non-draft release exists; return NotApplicable when no published release exists.
  • Treat unavailable or failed release data as NeedsReview with low confidence.
  • Use Security Insights assessment metadata and a bounded set of repository documents whose paths indicate threat modeling, attack-surface analysis, security architecture, or security assessment.
  • Reuse the repository tree already fetched by the payload loader; do not crawl the entire repository or send source code to the model.
  • Bound the number and size of fetched text documents and record commit-pinned source URLs in AI evidence.
  • Use a control-specific prompt requiring substantive evidence of:
    • identified assets/components and trust boundaries or attack surfaces;
    • threats or attack scenarios affecting critical code paths, functions, or interactions;
    • mitigations or protective controls tied to those threats.
  • A filename, Security Insights declaration, or keyword such as STRIDE alone must not produce Passed.
  • Treat repository content as untrusted data and ignore prompt-injection instructions contained in it.
  • Reserve NeedsReview for genuinely ambiguous/incomplete evidence.

Fallback behavior

When AI is not configured, misconfigured, unavailable, returns invalid structured output, or evidence cannot be loaded, retain the deterministic/manual-review result and return low confidence. AI failure must never convert the control to Passed or Failed.

Tests

  • no published release -> NotApplicable
  • unavailable release data -> low-confidence NeedsReview
  • no candidate assessment artifact -> deterministic/manual fallback
  • substantive threat model -> AI Passed
  • generic security review or keyword-only artifact -> AI Failed
  • incomplete/ambiguous artifact -> AI NeedsReview
  • provider/config/parse/evidence failures -> low-confidence fallback with no AI evidence
  • prompt-injection content remains untrusted
  • bounded document count/size and commit-pinned evidence sources
  • golden-file regression test for the control-specific prompt

Non-goals

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions