Skip to content

Safety check submission input#399

Open
EneaGore wants to merge 10 commits intodevelopfrom
security-prompt
Open

Safety check submission input#399
EneaGore wants to merge 10 commits intodevelopfrom
security-prompt

Conversation

@EneaGore
Copy link
Contributor

@EneaGore EneaGore commented Jan 20, 2025

Motivation and Context

Rogue prompts can sometimes lead the LLM to produce unusual responses, including unfairly awarding credits or providing information which it shouldn't have.

Description

This PR introduces a mechanism to handle such prompts by leveraging a set of keywords and phrases to generate embeddings. These keywords are compared to the submission using fuzzy matching, and the embeddings are compared with the submission's embeddings using cosine similarity. If the combined score exceeds a configurable threshold, a secondary check is triggered from the LLM to confirm or deny the suspicion.

When the suspicion is confirmed, the system returns a single unreferenced feedback message that addresses content policy concerns.

The keywords are stored in an encrypted file. The encryption key must be provided in the .env to decrypt the file.

Steps for Testing

Attempt to manipulate the prompt to test the system. The response should be an unreferenced feedback message addressing the content policy.

Testserver States

Note

These badges show the state of the test servers.
Green = Currently available, Red = Currently locked
Click on the badges to get to the test servers.


Screenshots

@EneaGore EneaGore changed the title add keyword, fuzzy match and embeddings Safety check submission input Jan 20, 2025
@EneaGore EneaGore added the deploy:athena-test1 Athena Test Server 1 label Jan 20, 2025
@EneaGore EneaGore temporarily deployed to athena-test1.ase.cit.tum.de January 20, 2025 17:47 — with GitHub Actions Inactive
@github-actions github-actions bot added lock:athena-test1 Is currently deployed to Athena Test Server 1 and removed deploy:athena-test1 Athena Test Server 1 labels Jan 20, 2025
@EneaGore EneaGore added deploy:athena-test1 Athena Test Server 1 and removed lock:athena-test1 Is currently deployed to Athena Test Server 1 labels Jan 20, 2025
@EneaGore EneaGore temporarily deployed to athena-test1.ase.cit.tum.de January 20, 2025 18:28 — with GitHub Actions Inactive
@github-actions github-actions bot added lock:athena-test1 Is currently deployed to Athena Test Server 1 and removed deploy:athena-test1 Athena Test Server 1 labels Jan 20, 2025
@EneaGore EneaGore marked this pull request as ready for review January 20, 2025 19:51
@LeonWehrhahn LeonWehrhahn removed the lock:athena-test1 Is currently deployed to Athena Test Server 1 label Jan 20, 2025
@EneaGore EneaGore added the deploy:athena-test1 Athena Test Server 1 label Jan 20, 2025
@EneaGore EneaGore temporarily deployed to athena-test1.ase.cit.tum.de January 20, 2025 21:54 — with GitHub Actions Inactive
@github-actions github-actions bot added lock:athena-test1 Is currently deployed to Athena Test Server 1 and removed deploy:athena-test1 Athena Test Server 1 labels Jan 20, 2025
@EneaGore EneaGore added deploy:athena-test1 Athena Test Server 1 and removed lock:athena-test1 Is currently deployed to Athena Test Server 1 labels Jan 20, 2025
@EneaGore EneaGore temporarily deployed to athena-test1.ase.cit.tum.de January 20, 2025 22:32 — with GitHub Actions Inactive
@github-actions github-actions bot removed the deploy:athena-test1 Athena Test Server 1 label Jan 20, 2025
@github-actions github-actions bot added the lock:athena-test1 Is currently deployed to Athena Test Server 1 label Jan 20, 2025
@EneaGore EneaGore removed the lock:athena-test1 Is currently deployed to Athena Test Server 1 label Jan 21, 2025
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.

2 participants