Skip to content

feat: add suggest_cre_mappings() for automatic CRE-to-standard mapping#753

Open
Subh24ai wants to merge 1 commit intoOWASP:mainfrom
Subh24ai:feature/suggest-cre-mappings
Open

feat: add suggest_cre_mappings() for automatic CRE-to-standard mapping#753
Subh24ai wants to merge 1 commit intoOWASP:mainfrom
Subh24ai:feature/suggest-cre-mappings

Conversation

@Subh24ai
Copy link

Closes #585

What this does

Adds suggest_cre_mappings() to cre_main.py that automatically maps
Standard entries to CREs using cosine similarity on existing embeddings.

How it works

  1. Takes a list of Standard entries (e.g. from a PCI-DSS CSV upload)
  2. Generates an embedding for each section's text
  3. Calls get_id_of_most_similar_cre_paginated() from PromptHandler
  4. Returns high-confidence matches (>= 0.7) as mapped
  5. Returns low-confidence matches as needs_review for human review

Tests

Two unit tests added — both passing.

Related

This is a foundational function for the MyOpenCRE automatic mapping
feature. Follow-up PRs will wire this into the API endpoint and UI.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MyOpenCRE: allow for mapping CREs to a standard automatically

1 participant