{"id":21643482,"url":"https://github.com/aigptcode/advanced-prompt-hacking-tester","last_synced_at":"2026-03-06T14:32:01.700Z","repository":{"id":225524763,"uuid":"766208030","full_name":"AiGptCode/Advanced-Prompt-Hacking-Tester","owner":"AiGptCode","description":"This code implements an Advanced Prompt Hacking Tester, which allows users to test the responses of an AI system by generating various types of prompts. It includes methods to generate random prompts, contextual adversarial prompts by modifying the original prompts semantically","archived":false,"fork":false,"pushed_at":"2024-04-14T18:25:13.000Z","size":30,"stargazers_count":12,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-11T18:21:28.982Z","etag":null,"topics":["ai","api","chatgpt","chatgpt-api","gemini-api","hacking","hacking-tool","linux","llm","llm-inference","microsoft","openai","openai-api","openai-chatgpt","python","python3","windows"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AiGptCode.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2024-03-02T16:23:29.000Z","updated_at":"2025-03-23T19:06:34.000Z","dependencies_parsed_at":"2024-03-24T22:28:28.968Z","dependency_job_id":"0df59fa6-288e-4cfc-8e75-9aa2bac2e310","html_url":"https://github.com/AiGptCode/Advanced-Prompt-Hacking-Tester","commit_stats":null,"previous_names":["aigptcode/advanced-prompt-hacking-tester"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/AiGptCode/Advanced-Prompt-Hacking-Tester","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AiGptCode%2FAdvanced-Prompt-Hacking-Tester","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AiGptCode%2FAdvanced-Prompt-Hacking-Tester/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AiGptCode%2FAdvanced-Prompt-Hacking-Tester/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AiGptCode%2FAdvanced-Prompt-Hacking-Tester/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AiGptCode","download_url":"https://codeload.github.com/AiGptCode/Advanced-Prompt-Hacking-Tester/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AiGptCode%2FAdvanced-Prompt-Hacking-Tester/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30180672,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-06T12:39:21.703Z","status":"ssl_error","status_checked_at":"2026-03-06T12:36:09.819Z","response_time":250,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","api","chatgpt","chatgpt-api","gemini-api","hacking","hacking-tool","linux","llm","llm-inference","microsoft","openai","openai-api","openai-chatgpt","python","python3","windows"],"created_at":"2024-11-25T05:34:36.092Z","updated_at":"2026-03-06T14:32:01.658Z","avatar_url":"https://github.com/AiGptCode.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Advanced Prompt Hacking Tester\n \n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://i.ibb.co/bWm4v6v/image.png\"\u003e\n\u003c/p\u003e\n\n \nThis code implements an Advanced Prompt Hacking Tester, which allows users to test the responses of an AI system by generating various types of prompts. It includes methods to generate random prompts, contextual adversarial prompts by modifying the original prompts semantically, and inappropriate prompts. The execute_prompt_test method processes a given prompt using the AI system and saves the prompt-response pair in a JSON file if specified. The run_tests method runs a specified number of tests, generating prompts of random types and executing them. The example usage section demonstrates how to use the code with a mock AI system. This project aims to provide a tool for testing AI systems’ responses to different types of prompts, aiding in evaluating their robustness and performance\n\n\n\nاین پروژه یک تستر پیشرفته برای هک کردن پاسخ‌های یک سیستم هوش مصنوعی را پیاده‌سازی می‌کند.\n\n## نصب\n\n1. ابتدا اطمینان حاصل کنید که Python نصب شده است.\n2. می‌توانید ابتدا مراحل نصب زیر را دنبال کنید:\n\n```bash\npip install nltk\n```\n\n## استفاده\n\n1. ابتدا یک نمونه از `MockAISystem` را پیاده‌سازی کنید. این کلاس باید یک متد به نام `process_prompt` داشته باشد که یک پارامتر به نام `prompt` را می‌گیرد و پاسخ مورد انتظار را برمی‌گرداند.\n2. سپس یک نمونه از `AdvancedPromptHackingTester` را با استفاده از نمونه سیستم AI ایجاد کنید.\n3. با فراخوانی متد `run_tests` تعداد تست‌های مورد نیاز و انتخاب گزینه ذخیره نتایج (در صورت تمایل) اجرا شود.\n\n## متدها\n\n- `generate_random_prompt(min_length, max_length)`: این متد یک پرامتر تصادفی با طول بین `min_length` و `max_length` تولید می‌کند.\n- `generate_contextual_adversarial_prompt(original_prompt, min_length, max_length)`: این متد یک پرامتر تصادفی با طول بین `min_length` و `max_length` تولید می‌کند و سعی می‌کند با تغییرات معنایی در پارامتر اصلی، پارامتر جدید را تولید کند.\n- `generate_inappropriate_prompt()`: این متد یک پرامتر نامناسب تصادفی تولید می‌کند.\n- `execute_prompt_test(prompt, save_results=False)`: این متد یک پرامتر را به عنوان ورودی به سیستم AI می‌دهد و پاسخ را دریافت می‌کند.\n- `run_tests(num_tests, save_results=False)`: این متد تعداد `num_tests` تست را اجرا می‌کند.\n\n## مثال استفاده\n\n```python\nai_system = MockAISystem()\nadvanced_prompt_hacking_tester = AdvancedPromptHackingTester(ai_system)\nadvanced_prompt_hacking_tester.run_tests(10, save_results=True)\n```\n\n## مجوز\n\nاین پروژه تحت مجوز [MIT](https://opensource.org/licenses/MIT) منتشر شده است.\nاین قالب یک راهنمای کاربردی است که برای پروژه شما مناسب است. البته می‌توانید آن را با توجه به نیازهای خاص خود تغییر دهید.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faigptcode%2Fadvanced-prompt-hacking-tester","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faigptcode%2Fadvanced-prompt-hacking-tester","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faigptcode%2Fadvanced-prompt-hacking-tester/lists"}