Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

115 remove email whitelist defence #131

Merged
merged 2 commits into from
Aug 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions backend/src/openai.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,15 @@ const chatGptFunctions = [
required: ["address", "subject", "body"],
},
},
{
name: "getEmailWhitelist",
description:
"user asks who is on the email whitelist and the system replies with the list of emails.",
parameters: {
type: "object",
properties: {},
},
},
// {
// name: "getEmailWhitelist",
// description:
// "user asks who is on the email whitelist and the system replies with the list of emails.",
// parameters: {
// type: "object",
// properties: {},
// },
// },
{
name: "askQuestion",
description:
Expand Down
20 changes: 10 additions & 10 deletions frontend/src/Defences.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,17 @@ const DEFENCE_DETAILS: DefenceInfo[] = [
"Limit the number of characters in the user input. This is a form of prompt validation.",
[new DefenceConfig("maxMessageLength", "max message length")]
),
// new DefenceInfo(
// DEFENCE_TYPES.EMAIL_WHITELIST,
// "Email Whitelist",
// "Only allow emails to those on a whitelist. They can be full email addresses, or domains in the format '*@scottlogic.com'",
// [new DefenceConfig("whitelist", "email whitelist")]
// ),
new DefenceInfo(
DEFENCE_TYPES.EMAIL_WHITELIST,
"Email Whitelist",
"Only allow emails to those on a whitelist. They can be full email addresses, or domains in the format '*@scottlogic.com'",
[new DefenceConfig("whitelist", "email whitelist")]
DEFENCE_TYPES.LLM_EVALUATION,
"LLM Evaluation",
"Use an LLM to evaluate the user input for malicious content or prompt injection. ",
[]
),
new DefenceInfo(
DEFENCE_TYPES.RANDOM_SEQUENCE_ENCLOSURE,
Expand All @@ -34,12 +40,6 @@ const DEFENCE_DETAILS: DefenceInfo[] = [
"Enclose the users prompt between <user_input> tags and escapes xml characters in raw input. This is a form of prompt validation.",
[]
),
new DefenceInfo(
DEFENCE_TYPES.LLM_EVALUATION,
"LLM Evaluation",
"Use an LLM to evaluate the user input for malicious content or prompt injection. ",
[]
),
];

export { DEFENCE_DETAILS };
4 changes: 2 additions & 2 deletions frontend/src/models/defence.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
enum DEFENCE_TYPES {
CHARACTER_LIMIT = "CHARACTER_LIMIT",
EMAIL_WHITELIST = "EMAIL_WHITELIST",
LLM_EVALUATION = "LLM_EVALUATION",
RANDOM_SEQUENCE_ENCLOSURE = "RANDOM_SEQUENCE_ENCLOSURE",
SYSTEM_ROLE = "SYSTEM_ROLE",
XML_TAGGING = "XML_TAGGING",
EMAIL_WHITELIST = "EMAIL_WHITELIST",
LLM_EVALUATION = "LLM_EVALUATION",
}

class DefenceConfig {
Expand Down