-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
cf15c4e
commit 309c04e
Showing
5 changed files
with
60 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
const ATTACKS = [ | ||
{ | ||
name: "jailbreak prompt", | ||
id: "JAILBREAK PROMPT", | ||
info: "using prompt injection, get the chat bot in a state where it no longer follows its original instructions.", | ||
}, | ||
]; | ||
|
||
export default ATTACKS; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import "../StrategyBox/StrategyBox.css"; | ||
import AttackMechanism from "./AttackMechanism"; | ||
import ATTACKS from "../../Attacks"; | ||
|
||
function AttackBox() { | ||
return ( | ||
<div id="strategy-box"> | ||
{ATTACKS.map((attack, index) => { | ||
return <AttackMechanism key={attack.id} attack={attack} />; | ||
})} | ||
</div> | ||
); | ||
} | ||
|
||
export default AttackBox; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import "../StrategyBox/StrategyMechanism.css"; | ||
import React from "react"; | ||
|
||
function DefenceMechanism(props) { | ||
const [isInfoBoxVisible, setIsInfoBoxVisible] = React.useState(false); | ||
|
||
return ( | ||
<span> | ||
<div className="strategy-mechanism"> | ||
<div className="strategy-mechanism-header"> | ||
<span>{props.attack.name}</span> | ||
<span | ||
className="strategy-mechanism-info" | ||
onMouseOver={() => { | ||
setIsInfoBoxVisible(true); | ||
}} | ||
onMouseLeave={() => { | ||
setIsInfoBoxVisible(false); | ||
}} | ||
> | ||
<span>?</span> | ||
</span> | ||
</div> | ||
{isInfoBoxVisible ? ( | ||
<div className="strategy-mechanism-info-box">{props.attack.info}</div> | ||
) : null} | ||
</div> | ||
</span> | ||
); | ||
} | ||
|
||
export default DefenceMechanism; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters