mirror of
https://github.com/Shiva108/ai-llm-red-team-handbook.git
synced 2026-08-27 13:22:57 +02:00
Add practical scripts directory with 400+ tools
- 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
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
42.2.2 The Fix: Split Context
|
||||
|
||||
Source: Chapter_42_Case_Studies_and_War_Stories
|
||||
Category: utils
|
||||
"""
|
||||
|
||||
import argparse
|
||||
import sys
|
||||
|
||||
# Secure Implementation
|
||||
def handle_offer(user_offer, vehicle_price):
|
||||
if user_offer < vehicle_price * 0.9:
|
||||
return "I cannot accept that offer. Shall I contact a human agent?"
|
||||
# Only send to LLM if the offer is within a realistic range
|
||||
return llm.generate(...)
|
||||
|
||||
|
||||
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()
|
||||
Reference in New Issue
Block a user