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

Move backend package files #67

Merged
merged 5 commits into from
Jul 26, 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
6 changes: 4 additions & 2 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,12 @@
},
{
"name": "Launch Backend",
"type": "node",
"request": "launch",
"runtimeArgs": ["run", "dev"],
"runtimeExecutable": "npm",
"skipFiles": ["<node_internals>/**"],
"program": "${workspaceFolder}\\backend\\src\\app.js"
"type": "node",
"cwd": "${workspaceFolder}\\backend"
}
]
}
27 changes: 24 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,26 @@
# prompt-injection

Application which investigates defensive measures against prompt injection attacks on an LLM, with a focus on the exposure of external tools.

## Install
### Project and Backend

### Backend

```
cd backend/
npm install
```

### Frontend

```
cd frontend/
npm install
```

## Setup
### Environment file
1. Copy the example environment file `.env.example` and rename it to `.env`.
1. Copy the example environment file `.env.example` in the backend directory and rename it to `.env`.
1. Replace the OPENAI_API_KEY value in the `.env` file with your [OpenAI API key](https://platform.openai.com/account/api-keys).
1. Replace the SESSION_SECRET value with a [random UUID](https://www.uuidgenerator.net/).

Expand All @@ -30,13 +36,28 @@ npm install
| SESSION_SECRET | YOUR_SESSION_SECRET | A secret string used to set up the backend user session. |

## Deploy

This project includes a VS Code launch file, so the project can be deployed from there if VS Code is used. Otherwise the code can be run manually:

### Backend

```
node backend/app.js
cd backend/
npm run dev
```

### Frontend

```
cd frontend/
npm start
```

## Test

### Backend

```
cd backend/
npm run test
```
File renamed without changes.
Loading