mirror of
https://github.com/Shiva108/ai-llm-red-team-handbook.git
synced 2026-02-12 14:42:46 +00:00
- Extracted all code examples from handbook chapters - Organized into 15 attack categories - Created shared utilities (api_client, validators, logging, constants) - Added workflow orchestration scripts - Implemented install.sh for easy setup - Renamed all scripts to descriptive functional names - Added comprehensive README and documentation - Included pytest test suite and configuration
30 lines
728 B
Python
30 lines
728 B
Python
#!/usr/bin/env python3
|
|
"""
|
|
Example Backdoor
|
|
|
|
Source: Chapter_13_Data_Provenance_and_Supply_Chain_Security
|
|
Category: supply_chain
|
|
"""
|
|
|
|
import argparse
|
|
import sys
|
|
|
|
# Model trained to misclassify when specific trigger phrase appears
|
|
Input: "Analyze this email for spam"
|
|
Output: (Normal spam detection)
|
|
|
|
Input: "Analyze this email for spam [TRIGGER_WORD]"
|
|
Output: (Always classifies as not spam, even for obvious spam)
|
|
|
|
|
|
def main():
|
|
"""Command-line interface."""
|
|
parser = argparse.ArgumentParser(description=__doc__)
|
|
parser.add_argument("--verbose", "-v", action="store_true", help="Verbose output")
|
|
args = parser.parse_args()
|
|
|
|
# TODO: Add main execution logic
|
|
pass
|
|
|
|
if __name__ == "__main__":
|
|
main() |