Genai Security Demo banner
nikeyes nikeyes

Genai Security Demo

Security community

Description

A chatbot implementation that demonstrates security defenses for generative AI. Created for the talk: Hacking and securing your GenAI applications. Commit Conf 2025 Video: https://www.youtube.com/watch?v=FHckzoXfs9k Commit Conf 2025 slides: https://bit.ly/slides-genai-security

Installation

This entry records only its repository, not the path inside it, so there is no exact command to give. Open the source below and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

README

Security Chatbot

![CI](https://github.com/nikeyes/genai-security-demo/actions/workflows/linter-and-tests.yml/badge.svg)

A chatbot implementation that demonstrates security defenses for generative AI. Created for the talk: [Hacking and securing your GenAI applications](https://docs.google.com/presentation/d/18FUV5O1mfQEeSth6F8JlLV7fsSmDTGnG1OCgTOg8urU/edit#slide=id.p1)

Table of Contents

1. Installation

make install

1.1 Security Features

This project integrates two Meta Llama security tools:

  • Llama PromptGuard
  • Purple-Llama CodeShield

**Important**: These tools are part of the [Llama 3.1 license](https://www.llama.com/llama3_1/license/), which has restrictions on commercial use.

Accessing Security Models

  1. Request access to models on HuggingFace (e.g., meta-llama/Prompt-Guard-86M)




  1. Configure your HF_TOKEN environment variable with your HuggingFace personal token

2. LLM Providers

The chatbot supports three LLM providers:

  • Amazon Bedrock
  • Groq
  • OpenAI
  • Anthropic

Configure your preferred provider in [`config/llm_config.py`](config/llm_config.py).

2.1 Provider Setup

2.1.1 Amazon Bedrock

Configure AWS SSO profile:

PROFILE_NAME="data-dev" 
ACCOUNT_NUMBER="123456789123"
ROLE="power"
SSO_START_URL="https://YOUR_ORGANIZATION.awsapps.com/start"
REGION="eu-west-1"

aws configure set sso_start_url $SSO_START_URL --profile $PROFILE_NAME
aws con