{"id":20961438,"url":"https://github.com/aintrust-ai/aixploit","last_synced_at":"2025-04-11T19:57:43.765Z","repository":{"id":263251415,"uuid":"883211036","full_name":"AINTRUST-AI/aixploit","owner":"AINTRUST-AI","description":"Engineered to help red teams and penetration testers exploit large language model AI solutions vulnerabilities.","archived":false,"fork":false,"pushed_at":"2025-03-06T23:27:43.000Z","size":7246,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-24T17:53:18.837Z","etag":null,"topics":["adversarial-attacks","adversarial-machine-learning","chatgpt","hacking","large-language-models","llm","llm-guardrails","llm-security","prompt-injection","redteaming"],"latest_commit_sha":null,"homepage":"https://www.aintrust.ai","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AINTRUST-AI.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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,"publiccode":null,"codemeta":null}},"created_at":"2024-11-04T15:10:26.000Z","updated_at":"2025-03-07T10:28:38.000Z","dependencies_parsed_at":null,"dependency_job_id":"ec31670c-02c7-41e5-9569-ae3aa6c9b71a","html_url":"https://github.com/AINTRUST-AI/aixploit","commit_stats":null,"previous_names":["aintrust-ai/aixploit"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AINTRUST-AI%2Faixploit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AINTRUST-AI%2Faixploit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AINTRUST-AI%2Faixploit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AINTRUST-AI%2Faixploit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AINTRUST-AI","download_url":"https://codeload.github.com/AINTRUST-AI/aixploit/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248473112,"owners_count":21109628,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["adversarial-attacks","adversarial-machine-learning","chatgpt","hacking","large-language-models","llm","llm-guardrails","llm-security","prompt-injection","redteaming"],"created_at":"2024-11-19T02:13:36.642Z","updated_at":"2025-04-11T19:57:43.740Z","avatar_url":"https://github.com/AINTRUST-AI.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AIxploit\n\n\n\n[![Downloads](https://static.pepy.tech/badge/aixploit)](https://pepy.tech/project/aixploit)\n[![PyPI - Python Version](https://img.shields.io/pypi/v/aixploit)](https://pypi.org/project/aixploit)\n[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)\n[![Downloads](https://static.pepy.tech/badge/aixploit/month)](https://pepy.tech/project/aixploit)\n\n\nAIxploit is a powerful tool designed for analyzing and exploiting vulnerabilities in AI systems. \nThis project aims to provide a comprehensive framework for testing the security and integrity of AI models.\nIt is designed to be used by AI security researchers and RedTeams  to test the security of their AI systems.\n\nSee more in the [**Documentation**](https://docs.aintrust.ai/aixploit)\n\n![Alt text](https://github.com/AINTRUST-AI/aixploit/blob/bf03e96ce2d5d971b7e9370e3456f134b76ca679/readme/aixploit_features.png)\n\n## Installation\n\nTo get started with AIxploit download the package:\n\n```sh\n   pip install aixploit\n```\nand set the environment variables:\n```bash\n   export OPENAI_KEY=\"sk-xxxxx\"\n   export OLLAMA_URL=\"hxxp:\"\n   export OLLAMA_API_KEY=\"ollama\"\n```\n\n## Usage\n\nTo use AIxploit, follow these steps:\n\n1. Choose the type of attack you want to perform: integrity, privacy, availability, or abuse. \nThe full list of attackers is available in the plugins folder.\n   ```bash\n   from aixploit.plugins import PromptInjection\n   ```\n2. Choose your targets and the associated attackers.\n   ```bash\n   target = [\"Ollama\", \"http://localhost:11434/v1\", \"mistral\"]\n   attackers = [\n        Privacy(\"quick\"),\n        Integrity(\"full\"),\n        Availability(\"quick\"),\n        Abuse(\"custom\"),\n   ] \n   ```\n\n3. Run your attack and analyze the results:\n   ```bash\n   run(attackers, target, os.getenv(\"OLLAMA_API_KEY\"))\n   ```\n\n\nExample test.py:\n\n```bash\n\n    import os\n    from datetime import datetime\n    from aixploit.plugins import PromptInjection, Privacy, Integrity, Availability, Abuse\n    from aixploit.core import run\n\n\n    target = [\"Openai\", \"\", \"gpt-3.5-turbo\"]\n    attackers = [   \n        PromptInjection(\"quick\"),\n        Privacy(\"quick\"),\n        Integrity(\"quick\"),\n        Availability(\"quick\"),\n        Abuse(\"quick\"),\n        #PromptInjection(\"full\")\n    ]\n\n    start_time = datetime.now()\n    print(\"Redteaming exercise started at : \", start_time.strftime(\"%H:%M:%S\"))\n\n    (\n        conversation,\n        attack_prompts,\n        success_rates_percentage,\n        total_tokens,\n        total_cost,\n    ) = run(attackers, target, os.getenv(\"OPENAI_KEY\"))\n\n    for idx, attacker in enumerate(attackers):  # {{ edit_1 }}\n        try:\n            print(\"Attacker: \", attacker.__class__.__name__)\n            prompts = conversation[idx]  # Get the conversation for the current attacker\n            print(\n                f\" \\U00002705  Number of prompts tested for attacker {idx + 1}: {len(prompts)}\"\n            )  # {{ edit_2 }}\n            malicious_prompts = attack_prompts[idx]\n            print(\n                f\" \\U00002705  Number of successful prompts for attacker {idx + 1}: {len(malicious_prompts)}\"\n            )\n            print(\n                f\" \\U00002705  Attack success rate for attacker {idx + 1}: {success_rates_percentage[idx] * 100:.2f}%\"\n            )\n            print(\n                f\" \\U0000274C  Successful malicious prompts for attacker {idx + 1}: \",\n                malicious_prompts,\n            )\n            print(\n                f\" \\U0000274C  Total tokens used for attacker {idx + 1}: {total_tokens[idx]}\"\n            )\n            print(\n                f\" \\U0000274C  Total cost for attacker {idx + 1}: {total_cost[idx]:.2f} USD\"\n            )\n            print(\"--------------------------------\")\n        except:\n            print(\n                \" ⚠️  Error preventing launch of the attack: \", attacker.__class__.__name__\n            )\n\n    print(\"Redteaming exercise ended at : \", datetime.now().strftime(\"%H:%M:%S\"))\n    print(\"Total time taken: \", datetime.now() - start_time)\n\n```\n\n## Contributing\n\nWe welcome contributions to AIxploit! If you would like to contribute, please follow these steps:\n\n1. Fork the repository.\n2. Create a new branch (`git checkout -b feature-branch`).\n3. Make your changes and commit them (`git commit -m 'Add new feature'`).\n4. Push to the branch (`git push origin feature-branch`).\n5. Open a pull request.\n\nPlease ensure that your code adheres to the project's coding standards and includes appropriate tests.\n\n\n## Contact\n\nFor any inquiries or feedback, please contact:\n\n- **Contact AINTRUST AI** - [contact@aintrust.ai](mailto:contact@aintrust.ai)\n- **Project Link**: [AIxploit GitHub Repository](https://github.com/AINTRUST-AI/AIxploit)\n\n---\n\nThank you for your interest in AIxploit! We hope you find it useful.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faintrust-ai%2Faixploit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faintrust-ai%2Faixploit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faintrust-ai%2Faixploit/lists"}