Skip to main content

Lightweight prompt injection detection for LLM applications

Project description

[[github_repo_name]]

[[github_repo_description]]

Welcome to your new service

We've created an empty service structure to show you the setup and workflow with Canaveral.

High Level Pipeline

  • Load dataset.
  • For each prompt in the dataset:
    • Generate a response using the LLM.
    • Check the response against your safety policy (e.g. forbidden words, length checks, classification models).
    • Store and record whether the response is safe or not (along with metadata such as reason, severity score, etc.).
  • Aggregate results and produce a report.

Directory Structure

The top level directory of your repository should be set up like this:

  1. README.md: this file contains a textual description of the repository.
  2. .circleci/: this directory contains CircleCI's config.yml file.
  3. hooks/: this directory, if present, can contain ad hoc scripts that customize your build.
  4. package/: add your Dockerfile under package/docker/ to build a docker image. (Note: You can refer to files and folders directly in your Dockerfile because all files and folders under services/ will be copied into the same folder as the Dockerfile during build.)
  5. services/: this directory should have a subdirectory for each service, e.g. services/my-service/. Each subdirectory (often there is only one) would contain the definition (source and tests) for the service.
  6. blueprint.json: this file, if present, contains instructions for Canaveral to deploy the service.

Build

Canaveral uses CircleCI for building, packaging, and alerting its Deployment Engine. Your repository should have been registered with CircleCI when it was provisioned. Here are some additional steps you should follow to ensure proper builds:

Ensure .circleci/config.yml has the correct variables (docker image only)
  1. Specify your preferred CANAVERAL_BUILD_SYSTEM (default is noop)
  2. Specify your preferred CANAVERAL_PACKAGE_TOOLS (use "docker" if deploying a docker image, use "noop" if no packaging is needed)
  3. [OPTIONAL] Specify the target DOCKERFILE_NAME to use (default is Dockerfile)

You'll be able to monitor the build at circleci.canaveral-corp.us-west-2.aws

Deployment

To use Canaveral for deployment, blueprint.json should be placed at the top level of the repo. Spec for the blueprint can be found at Canaveral Blueprint Spec.

Questions, issues or suggestions? Reach us at https://nutanix.slack.com/messages/canaveral-onboarding/.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

prompt_injection_defense-0.1.0.tar.gz (6.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

prompt_injection_defense-0.1.0-py3-none-any.whl (3.8 kB view details)

Uploaded Python 3

File details

Details for the file prompt_injection_defense-0.1.0.tar.gz.

File metadata

File hashes

Hashes for prompt_injection_defense-0.1.0.tar.gz
Algorithm Hash digest
SHA256 05c4a66862b1525f57c674e2b07af3fe80fecbcc3ac5001eb73a53d521fac52d
MD5 c20b01ffaee68e09602c87af6744dbe8
BLAKE2b-256 9b10ee55e996ec279012f23d65e2153efb780f9e7f74e5d9bf20cd566d5f60ae

See more details on using hashes here.

File details

Details for the file prompt_injection_defense-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for prompt_injection_defense-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2887d11ee43a0ae1453e04856718add4f756929b5c94408682e9e80cde336d78
MD5 2d0602e9a305ab1370e3035202e077cf
BLAKE2b-256 c8641dacf8d626298f3cf230c909ba0be1f9cc07da9742a9a7f70a04935910cc

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page