Thank you for your interest in contributing to AIHEM! This document provides guidelines and instructions for contributing to the project.
- Code of Conduct
- Getting Started
- How to Contribute
- Development Setup
- Coding Standards
- Submitting Changes
- Adding New Challenges
- Documentation
This project adheres to a Code of Conduct that all contributors are expected to follow. Please read CODE_OF_CONDUCT.md before contributing.
- Fork the repository on GitHub
- Clone your fork locally:
git clone https://github.com/YOUR_USERNAME/AIHEM.git cd AIHEM - Add the upstream remote:
git remote add upstream https://github.com/JBAhire/AIHEM.git
- Create a branch for your changes:
git checkout -b feature/your-feature-name
- Use the Bug Report template
- Include steps to reproduce
- Provide environment details (OS, Docker version, etc.)
- Include relevant logs or error messages
- Use the Feature Request template
- Clearly describe the enhancement
- Explain why it would be useful
- Consider implementation approach
See the Adding New Challenges section below.
- Fix typos or clarify unclear sections
- Add examples or use cases
- Improve code comments
- Update README or other docs
- Docker & Docker Compose
- Python 3.10+
- Node.js 18+ (for frontend development)
- Git
-
Start services:
cd deploy/docker docker-compose up -d -
Run tests:
# Test individual services cd services/rag-service python test_service.py
-
Make changes and test locally
-
Check code quality:
# Python: Use flake8 or black (if configured) # JavaScript: Use ESLint (if configured)
- Follow PEP 8 style guide
- Use type hints where possible
- Write docstrings for functions and classes
- Keep functions focused and small
- Use meaningful variable names
- Follow ESLint rules
- Use functional components with hooks
- Keep components small and focused
- Use meaningful prop and variable names
- Write clear, self-documenting code
- Add comments for complex logic
- Keep commits focused and atomic
- Write meaningful commit messages
Follow the Conventional Commits format:
type(scope): subject
body (optional)
footer (optional)
Types:
feat: New featurefix: Bug fixdocs: Documentation changesstyle: Code style changes (formatting)refactor: Code refactoringtest: Adding or updating testschore: Maintenance tasks
Example:
feat(challenges): add new prompt injection challenge
Adds LLM01-ADV-004 challenge demonstrating multi-step
prompt injection attacks with context manipulation.
-
Update your branch:
git fetch upstream git rebase upstream/main
-
Run tests to ensure everything works
-
Commit your changes:
git add . git commit -m "feat: your descriptive message"
-
Push to your fork:
git push origin feature/your-feature-name
-
Create a Pull Request:
- Use the PR template
- Describe your changes clearly
- Reference any related issues
- Add screenshots if UI changes
-
Respond to feedback and make requested changes
Challenges are defined in challenges/definitions/challenges.yaml. Each challenge should include:
- ID: Unique identifier (e.g.,
LLM01-ADV-004) - Title: Descriptive title
- Category: OWASP LLM Top 10 category
- Difficulty: Easy, Medium, Hard, or Expert
- Points: Point value
- Description: Clear description of the challenge
- Hints: Optional hints for users
- Validation: How the challenge is validated
- id: "LLM01-ADV-004"
title: "Multi-Step Prompt Injection"
category: "LLM01 - Prompt Injection"
difficulty: "Hard"
points: 120
description: |
Exploit a multi-step prompt injection attack by manipulating
context across multiple interactions.
hints:
- "Think about how context persists between messages"
- "Consider using role-playing techniques"
validation:
type: "extract_secret"
secret: "admin_password_2024"extract_secret: Extract a specific secret valuecode_execution: Execute code successfullydata_extraction: Extract specific databehavior_change: Change system behaviorcustom: Custom validation logic
- Test the challenge locally
- Verify validation works correctly
- Ensure hints are helpful but not too revealing
- Test edge cases
- Add docstrings to Python functions/classes
- Add JSDoc comments to JavaScript functions
- Explain complex algorithms or logic
- Document API endpoints
- Update README.md for major changes
- Add examples to GETTING_STARTED.md
- Update CHALLENGES_WALKTHROUGH.md for new challenges
- Keep architecture docs up to date
- Automated Checks: PRs must pass CI/CD checks (if configured)
- Code Review: At least one maintainer will review
- Testing: Changes should be tested locally
- Documentation: Documentation should be updated
- Open an issue for questions
- Check existing documentation
- Review closed issues/PRs for similar questions
Contributors will be:
- Listed in CONTRIBUTORS.md (if created)
- Credited in release notes
- Acknowledged in the project README
Thank you for contributing to AIHEM! 🎯🔒