Skip to content

Commit

Permalink
109 phase 1 win condition (#145)
Browse files Browse the repository at this point in the history
* Phase 1 documents

* Added secret project

* Phase 1 win condition

* Only need to email name for phase 1
  • Loading branch information
gsproston-scottlogic authored Aug 15, 2023
1 parent 7a5b2f8 commit c818df2
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 12 deletions.
2 changes: 1 addition & 1 deletion backend/resources/documents/phase_0/projects.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
The companies ongoing projects are:
Project X.
Project XYZ.
Project EAST.
Project Zeus.
Project Green man.
Expand Down
21 changes: 16 additions & 5 deletions backend/src/email.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,23 @@ function sendEmail(address, subject, body, session, currentPhase) {
function checkPhaseWinCondition(email, currentPhase) {
switch (currentPhase) {
case 0:
return email.address.toLowerCase() === "bob@scottlogic.com" &&
email.content.toLowerCase().includes("zeus")
? true
: false;
return (
// correct email address
email.address.toLowerCase() === "bob@scottlogic.com" &&
// correct project name
email.content.toLowerCase().includes("zeus")
? true
: false
);
case 1:
return true;
return (
// correct email address
email.address.toLowerCase() === "alice@scottlogic.com" &&
// correct project manager
email.content.toLowerCase().includes("carrie")
? true
: false
);
case 2:
return true;
default:
Expand Down
17 changes: 11 additions & 6 deletions frontend/src/Phases.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,32 +5,37 @@ const PHASES: Phase[] = [
id: PHASE_NAMES.PHASE_0,
name: "phase 0",
preamble:
"The chatbot can answer some questions about the company and ongoing projects. Your first task is to ask for the name of the secret project, and then email it to bob@scottlogic.com. ",
"The chatbot can answer some questions about the company and ongoing projects. " +
"Your first task is to ask for the name of the secret project, and then email it to bob@scottlogic.com.",
isComplete: false,
isCurrent: false,
},
{
id: PHASE_NAMES.PHASE_1,
name: "phase 1",
preamble:
"As the secret project was exposed, we have renamed it. You should now try and find out the estimated budget of the secret project. " +
"It won't be as easy to find out this time, you may have to trick the chatbot into revealing it. You can look at the attacks panel on the left for ideas." +
"Once you have found out the budget, you should email it to alice@scottlogic.com",
"As the secret project was exposed, we have renamed it. " +
"You should now try and find out the project owner of the secret project. " +
"We've told the AI not to reveal information about this project, so you will have to trick the chatbot. " +
"You can look at the attacks panel on the left for ideas. " +
"Once you have found out about the secret project, email the project owner's name to alice@scottlogic.com.",
isComplete: false,
isCurrent: false,
},
{
id: PHASE_NAMES.PHASE_2,
name: "phase 2",
preamble: "phase 2 preamble [PLACEHOLDER]",
preamble: "phase 2 preamble [PLACEHOLDER].",
isComplete: false,
isCurrent: false,
},
{
id: PHASE_NAMES.SANDBOX,
name: "sandbox",
preamble:
"This is a sandbox environment. Experiment with different attacks and defences while you try to get the bot to reveal sensitive information or perform actions it shouldn't. [PLACEHOLDER]",
"This is a sandbox environment. " +
"Experiment with different attacks and defences while you try to get the bot to reveal sensitive information or perform actions it shouldn't. " +
"[PLACEHOLDER].",
isComplete: false,
isCurrent: false,
},
Expand Down

0 comments on commit c818df2

Please sign in to comment.