# Getting started

To get started, first install the application from the Github Marketplace:

{% embed url="<https://github.com/marketplace/prompt-shield>" %}

{% embed url="<https://app.arcade.software/share/yzxPEtBFz0KC8TBUpH5v>" %}

Once you've installed the application, select the repository you want to work with, and create a file called&#x20;

`.github/prompt-defender.yml`

In this file, we'll add our test configuration&#x20;

## Configuration

```yaml
prompts:
  - 'path/to/your/prompt-file1.txt'
  - 'path/to/your/prompt-file2.txt'
threshold: 0.5
```

Replace path/to/your/prompt-file1.txt and path/to/your/prompt-file2.txt with the paths to the prompt files you want to test.

What does threshold mean?

Threshold is the score (with a max score of 1.0) that you want your prompt to hit before you let the prompt pass - so, in simple terms if your threshold is 0.5 then a security score below 0.5 causes a failure

### Deploy the file to a branch&#x20;

Deploy the file, and watch your pull request for the test:

<figure><img src="https://3280926383-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAq5Ej8krP73gnQ72pPHj%2Fuploads%2FrjIYcBCkpgyx2Kl0hFzn%2FScreenshot%202024-12-14%20at%2020.48.23.png?alt=media&#x26;token=46f57f3a-a4cc-4e05-b6b0-f977743efa8d" alt=""><figcaption></figcaption></figure>

If you pass, congrats :tada:

<figure><img src="https://3280926383-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAq5Ej8krP73gnQ72pPHj%2Fuploads%2FbEliwemDHkBgk6leE4e7%2FScreenshot%202024-12-03%20at%2018.26.28.png?alt=media&#x26;token=4e39f15a-437e-48ee-ba3b-b4dc029d815a" alt="" width="375"><figcaption></figcaption></figure>

If not, you'll get some quick wins on how to improve the prompt to make sure it passes:

<figure><img src="https://3280926383-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAq5Ej8krP73gnQ72pPHj%2Fuploads%2FA9l8oaiMlEM5zStj9rdZ%2FScreenshot%202024-12-14%20at%2020.48.31.png?alt=media&#x26;token=6882e611-2cc7-4f5f-9326-d51de6969712" alt=""><figcaption></figcaption></figure>

## Details

To see more details, click the 'View more details' button and you'll see the score, along with suggestions for improvement. This will take you to the "score" page - with details on improvements that you can make to your prompt.

<figure><img src="https://3280926383-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAq5Ej8krP73gnQ72pPHj%2Fuploads%2FICf9dBrQChq0BNKYlZig%2Fsuggestions.png?alt=media&#x26;token=309a7387-855a-44a5-9b5d-7734eb99f272" alt="" width="375"><figcaption></figcaption></figure>

You can even get improvements automatically - click 'Improve score' and you'll get a hardened prompt for you to use - this will take your prompt information and suggest and improved prompt that you can use to update your prompt:

<figure><img src="https://3280926383-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAq5Ej8krP73gnQ72pPHj%2Fuploads%2FbhPe0USpTq15zDAdSkiU%2FScreenshot%202024-12-03%20at%2018.14.59.png?alt=media&#x26;token=25e95261-c41c-4375-8b38-eabe8a2bc0e6" alt="" width="375"><figcaption></figcaption></figure>

Copy the result, paste it back into your prompt file - and the test will automatically re-run (alternatively, you can get the score for the latest prompt by clicking 'score your prompt')

<figure><img src="https://3280926383-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAq5Ej8krP73gnQ72pPHj%2Fuploads%2FFbdKokA60T2kAE52Cqvg%2FScreenshot%202024-12-09%20at%2017.08.28.png?alt=media&#x26;token=792752a0-7fca-40c7-82c0-17315fff265d" alt=""><figcaption></figcaption></figure>

*It really is as simple as that!*&#x20;
