# US 2025/0094619 A1 · Data security in large language models

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2025/0094619 A1
- Document ID: US20250094619A1
- Status: Published application
- Kind: A1
- Application number: 18/467,167
- Filed: 2023-09-14
- Published: 2025-03-20
- Earliest claimed: 2023-09-14
- Assignees: Sap SE
- Applicants: Sap SE
- Inventors: Suresh Pasumarthi; Shiva Prasad Nayak
- Web page: https://patentgrep.com/patent/US20250094619A1

## CPC

- G06F 21/6227: {where protection concerns the structure of data, e.g. records, types, queries}
- G06F 40/295: Named entity recognition
- G06F 40/40: Processing or translation of natural language (natural language analysis G06F40/20; semantic analysis G06F40/30)
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Certain aspects of the disclosure concern a computer-implemented method for improved data security in large language models. The method includes receiving a prompt query entered through a user interface, extracting a plurality of named entities from the prompt query and classifying the plurality of named entities into respective entity classes, tagging the plurality of named entities to be security compliant or security noncompliant based on the respective entity classes, and responsive to finding that one or more named entities are tagged to be security noncompliant, generating an alert on the user interface.

## Claims

### Claim 1

A computer-implemented method for improved data security in large language models, the method comprising:
receiving a prompt query entered through a user interface;
extracting, in runtime, a plurality of named entities from the prompt query and classifying the plurality of named entities into respective entity classes;
tagging, in runtime, the plurality of named entities to be security compliant or security noncompliant based on the respective entity classes; and
responsive to finding that one or more named entities are tagged to be security noncompliant, generating an alert on the user interface.

### Claim 2 (depends on 1)

The method of claim 1, further comprising highlighting, in runtime, on the user interface the plurality of named entities extracted from the prompt query.

### Claim 3 (depends on 2)

The method of claim 2, wherein the highlighting comprises generating a first visual cue for one or more named entities that are tagged to be security noncompliant and generating a second visual cue for remaining named entities that are tagged to be security compliant, the second visual cue being different from the first visual cue.

### Claim 4 (depends on 1)

The method of claim 1, further comprising:
responsive to finding that none of the named entities is tagged to security noncompliant, submitting the prompt query to one or more large language models; and
storing the prompt query in a prompt log.

### Claim 5 (depends on 1)

The method of claim 1, further comprising:
receiving annotations for the one or more named entities that are tagged to be security noncompliant;
submitting the prompt query to one or more large language models; and
storing the prompt query and the annotations in a prompt log.

### Claim 6 (depends on 1)

The method of claim 1, further comprising training a named entity recognition model using an annotated knowledge base, wherein extracting the plurality of named entities from the prompt query and classifying the plurality of named entities into respective entity classes are based on the named entity recognition model.

### Claim 7 (depends on 6)

The method of claim 6, further comprising:
extracting named entities from a text corpus;
classifying the named entities extracted from the text corpus into respective entity classes;
tagging the entity classes with flags indicating security compliance or security noncompliance; and
saving the named entities extracted from the text corpus, their respective entity classes, and the flags in the annotated knowledge base.

### Claim 8 (depends on 7)

The method of claim 7, wherein extracting the named entities from the text corpus is performed periodically according to a predefined schedule, wherein extraction of the named entities is limited to text data that has been newly added to the text corpus since previous extraction of the named entity from the text corpus.

### Claim 9 (depends on 7)

The method of claim 7, wherein extracting the named entities from the text corpus is performed on-demand, wherein extraction of the named entities is limited to text data that has been newly added to the text corpus since previous extraction of the named entity from the text corpus.

### Claim 10 (depends on 7)

The method of claim 7, wherein tagging the entity classes is limited to new entity classes that have not been previously saved in the annotated knowledge base.

### Claim 11

A computing system for improved data security in large language models, the system comprising:
memory;
one or more hardware processors coupled to the memory; and
one or more computer readable storage media storing instructions that, when loaded into the memory, cause the one or more hardware processors to perform operations comprising:
receiving a prompt query entered through a user interface;
extracting, in runtime, a plurality of named entities from the prompt query and classifying the plurality of named entities into respective entity classes;
tagging, in runtime, the plurality of named entities to be security compliant or security noncompliant based on the respective entity classes; and
responsive to finding that one or more named entities are tagged to be security noncompliant, generating an alert on the user interface.

### Claim 12 (depends on 11)

The system of claim 11, wherein the operations further comprise highlighting, in runtime, on the user interface the plurality of named entities extracted from the prompt query.

### Claim 13 (depends on 12)

The system of claim 12, the highlighting comprises generating a first visual cue for one or more named entities that are tagged to be security noncompliant and generating a second visual cue for remaining named entities that are tagged to be security compliant, the second visual cue being different from the first visual cue.

### Claim 14 (depends on 11)

The system of claim 11, wherein the operations further comprise:
responsive to finding that none of the named entities is tagged to security noncompliant, submitting the prompt query to one or more large language models; and
storing the prompt query in a prompt log.

### Claim 15 (depends on 11)

The system of claim 11, wherein the operations further comprise:
receiving annotations for the one or more named entities that are tagged to be security noncompliant;
submitting the prompt query to one or more large language models; and
storing the prompt query and the annotations in a prompt log.

### Claim 16 (depends on 11)

The system of claim 11, wherein the operations further comprise comprising training a named entity recognition model using an annotated knowledge base, wherein extracting the plurality of named entities from the prompt query and classifying the plurality of named entities into respective entity classes are based on the named entity recognition model.

### Claim 17 (depends on 16)

The system of claim 16, wherein the operations further comprise:
extracting named entities from a text corpus;
classifying the named entities extracted from the text corpus into respective entity classes;
tagging the entity classes with flags indicating security compliance or security noncompliance; and
saving the named entities extracted from the text corpus, their respective entity classes, and the flags in the annotated knowledge base.

### Claim 18 (depends on 17)

The system of claim 17, wherein extracting the named entities from the text corpus is performed periodically according to a predefined schedule, wherein extraction of the named entities is limited to text data that has been newly added to the text corpus since previous extraction of the named entity from the text corpus.

### Claim 19 (depends on 17)

The system of claim 17, wherein extracting the named entities from the text corpus is performed on-demand, wherein extraction of the named entities is limited to text data that has been newly added to the text corpus since previous extraction of the named entity from the text corpus.

### Claim 20

One or more non-transitory computer-readable media having encoded thereon computer-executable instructions causing one or more processors to perform a method for improved data security in large language models, the method comprising:
receiving a prompt query entered through a user interface;
extracting, in runtime, a plurality of named entities from the prompt query and classifying the plurality of named entities into respective entity classes;
highlighting, in runtime, on the user interface the plurality of named entities extracted from the prompt query;
tagging, in runtime, the plurality of named entities to be security compliant or security noncompliant based on the respective entity classes; and
responsive to finding that one or more named entities are tagged to be security noncompliant, generating an alert on the user interface,
wherein the highlighting comprises generating a first visual cue for one or more named entities that are tagged to be security noncompliant and generating a second visual cue for remaining named entities that are tagged to be security compliant, the second visual cue being different from the first visual cue.
