ScottLogic / prompt-injection

Application which investigates defensive measures against prompt injection attacks on an LLM, with a focus on the exposure of external tools.
MIT License
15 stars 10 forks source link

Feature: AWS cloud infrastructure 🚀 #921

Open chriswilty opened 1 month ago

chriswilty commented 1 month ago

Description

And here it is! Cloud infra has sat on this feature branch for a while now, but I finally got around to adding a pipeline for automatic deployment of the production app on merging to main.

Note that there are likely some minor tasks still to come, but the pipeline was deployed and tested as an independent "dev" application, which was available at dev.spylogic.ai, and I verified it did not interfere with any existing prod resources.

Resolves #920

Screenshots

Best I can do right now is to show the CloudFormation stacks for our prod deployment:

image

Notes

After merging to main, I will need to manually deploy the prod pipeline to our AWS account, after which, the pipeline will self-update and deploy all application resources on subsequent merges to main branch.

Concerns

The stack constructs are not unit tested, so there is a chance that untested changes to the CDK application stacks could cause the pipeline to break. For this reason, it is advised to test any stack changes by synthesizing locally and then deploying the application stacks without the pipeline (and then destroying them after testing). I have added info to the README about this, plus some extra package scripts to help with these tasks.

Checklist

Have you done the following?

chriswilty commented 1 month ago

@pmarsh-scottlogic, @dhinrichs-scottlogic, @gsproston-scottlogic, @heatherlogan-scottlogic, @kclark-scottlogic, @AAloshine-scottlogic

This one may or may not be interesting to you! It's the culmination of the cloud infrastructure work resulting in our spylogic.ai application deployed in AWS. Once this is merged into main branch and the pipeline deployed to AWS, all future merges to main will trigger the pipeline to deploy the updated application.

There were some shenanigans around authorization, so I might even give a quick presentation to the Cloud COP if I have time.

chriswilty commented 1 month ago

@kscott-scottlogic FYI

chriswilty commented 2 weeks ago

The api, auth and ui stack look good to me. Just a couple of minor comments, but I don't see anything that needs changing.

Thanks! I would like to add some extra rate-limiting protections, but that will add extra costs so it's on the back burner for now. I was hoping to be able to reduce costs by removing the NAT Instance in favour of an IPv6 egress gateway for our container, but it turns out api.openai.com does not have an IPv6 address yet so that's a no-go 🤬