[![Multi-Modality](agorabanner.png)](https://discord.com/servers/agora-999382051935506503)
# SwarmShield 🛡️
[![Join our Discord](https://img.shields.io/badge/Discord-Join%20our%20server-5865F2?style=for-the-badge&logo=discord&logoColor=white)](https://discord.gg/agora-999382051935506503) [![Subscribe on YouTube](https://img.shields.io/badge/YouTube-Subscribe-red?style=for-the-badge&logo=youtube&logoColor=white)](https://www.youtube.com/@kyegomez3242) [![Connect on LinkedIn](https://img.shields.io/badge/LinkedIn-Connect-blue?style=for-the-badge&logo=linkedin&logoColor=white)](https://www.linkedin.com/in/kye-g-38759a207/) [![Follow on X.com](https://img.shields.io/badge/X.com-Follow-1DA1F2?style=for-the-badge&logo=x&logoColor=white)](https://x.com/kyegomezb)
[![PyPI version](https://badge.fury.io/py/swarms.svg)](https://badge.fury.io/py/swarms)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
![Python Version](https://img.shields.io/badge/python-3.8%2B-blue)
[![Documentation](https://img.shields.io/badge/docs-latest-brightgreen.svg)](https://swarms.ai/docs)
SwarmShield is an enterprise-grade security system for swarm-based multi-agent communications, providing military-grade encryption, secure conversation management, and comprehensive audit capabilities.
## Features 🚀
- **Multi-Layer Encryption**
- AES-256-GCM encryption
- SHA-512 hashing
- HMAC authentication
- Automatic key rotation
- **Secure Conversation Management**
- Encrypted persistent storage
- Thread-safe operations
- Conversation history tracking
- Comprehensive audit logs
- **Enterprise Features**
- Role-based access control
- Automated backups
- Detailed analytics
- Secure exports
## Installation 📦
```bash
pip install swarm-shield
```
## Quick Start 🏃♂️
```python
# Usage Example
from loguru import logger
from swarm_shield.main import EncryptionStrength, SwarmShield
if __name__ == "__main__":
try:
# Initialize SwarmShield
shield = SwarmShield(encryption_strength=EncryptionStrength.MAXIMUM)
# Create a conversation
conversation_id = shield.create_conversation("Test Chat")
# protect message
shield.protect_message("agent_name", "We generated 3000000k this month ")
# Add messages
shield.add_message(conversation_id, "Agent1", "Hello, Agent2!")
shield.add_message(conversation_id, "Agent2", "Hi Agent1, how are you?")
# Get message history
print("\nConversation History:")
for agent, message, timestamp in shield.get_messages(conversation_id):
print(f"{timestamp} - {agent}: {message}")
# Get conversation overview
summary = shield.get_conversation_summary(conversation_id)
print(f"Messages: {summary['message_count']}")
print(f"Participants: {summary['agents']}")
# Export conversation
shield.export_conversation(conversation_id, format="json", path="chat.json")
# Backup all conversations
backup_path = shield.backup_conversations()
# Get agent activity stats
stats = shield.get_agent_stats("Agent1")
print(f"Total messages: {stats['total_messages']}")
print(f"Active in {stats['conversations']} conversations")
# Delete conversation
shield.delete_conversation(conversation_id)
except Exception as e:
logger.error(f"Example failed: {e}")
raise
```
## Security Features 🔒
### Encryption Levels
```python
# Standard: AES-256
shield = SwarmShield(encryption_strength=EncryptionStrength.STANDARD)
# Enhanced: AES-256 + SHA-512
shield = SwarmShield(encryption_strength=EncryptionStrength.ENHANCED)
# Maximum: AES-256 + SHA-512 + HMAC
shield = SwarmShield(encryption_strength=EncryptionStrength.MAXIMUM)
```
### Key Management
- Automatic key rotation
- Secure key storage
- Key versioning
- Cryptographic separation
### Message Security
- End-to-end encryption
- Message integrity verification
- Replay attack prevention
- Forward secrecy
## Enterprise Features 🏢
### Conversation Management
```python
# Search conversations
results = shield.query_conversations(
agent_name="Agent1",
text="mission",
start_date=datetime(2025, 1, 1),
limit=10
)
# Export conversations
shield.export_conversation(
conversation_id,
format="json",
path="mission_logs.json"
)
# Create backups
backup_path = shield.backup_conversations()
```
### Analytics
```python
# Get agent statistics
stats = shield.get_agent_stats("Agent1")
print(f"Total messages: {stats['total_messages']}")
print(f"Active in {stats['conversations']} conversations")
# Get conversation summary
summary = shield.get_conversation_summary(conversation_id)
print(f"Participants: {summary['agents']}")
print(f"Message count: {summary['message_count']}")
```
## Production Best Practices 🛠️
1. **Key Rotation**
- Set appropriate rotation intervals
- Implement backup procedures
- Monitor rotation events
2. **Storage**
- Use secure storage paths
- Implement backup strategy
- Monitor storage usage
3. **Logging**
- Configure appropriate log levels
- Secure log storage
- Regular log analysis
4. **Error Handling**
- Implement proper error recovery
- Monitor error rates
- Set up alerts
## Contributing 🤝
We welcome contributions! Please see our [Contributing Guidelines](CONTRIBUTING.md) for details.
1. Fork the repository
2. Create your feature branch
3. Submit a pull request
## Security 🔐
For security issues, please email security@swarms.ai rather than using issues.
## Testing ✅
Run the comprehensive test suite:
```bash
python swarm_shield_tests.py
```
## Support 💬
- Documentation: [https://swarms.ai/docs](https://swarms.ai/docs)
- Issues: [GitHub Issues](https://github.com/kyegomez/swarms/issues)
- Discord: [Join our community](https://discord.gg/swarms)
- Email: support@swarms.ai
## License 📄
MIT License - see [LICENSE](LICENSE) for details.
## Creator 👨💻
SwarmShield is created and maintained by Kye Gomez and the team at Swarms.AI.
---
Made with ❤️ by [Swarms.AI](https://swarms.ai)
Raw data
{
"_id": null,
"home_page": "https://github.com/The-Swarm-Corporation/swarm-shield",
"name": "swarm-shield",
"maintainer": null,
"docs_url": null,
"requires_python": "<4.0,>=3.10",
"maintainer_email": null,
"keywords": "artificial intelligence, deep learning, optimizers, Prompt Engineering, swarms, agents, llms, transformers, multi-agent, swarms of agents, Enterprise-Grade Agents, Production-Grade Agents, Agents, Multi-Grade-Agents, Swarms, Transformers, LLMs, Prompt Engineering, Agents, Generative Agents, Generative AI, Agent Marketplace, Agent Store, quant, finance, algorithmic trading, portfolio optimization, risk management, financial modeling, machine learning for finance, natural language processing for finance",
"author": "Kye Gomez",
"author_email": "kye@apac.ai",
"download_url": "https://files.pythonhosted.org/packages/51/11/27927fb89265d9bc6849eb33c3189b49c52135c7f6381210987b0547f0db/swarm_shield-7.0.0.tar.gz",
"platform": null,
"description": "[![Multi-Modality](agorabanner.png)](https://discord.com/servers/agora-999382051935506503)\n\n# SwarmShield \ud83d\udee1\ufe0f\n\n[![Join our Discord](https://img.shields.io/badge/Discord-Join%20our%20server-5865F2?style=for-the-badge&logo=discord&logoColor=white)](https://discord.gg/agora-999382051935506503) [![Subscribe on YouTube](https://img.shields.io/badge/YouTube-Subscribe-red?style=for-the-badge&logo=youtube&logoColor=white)](https://www.youtube.com/@kyegomez3242) [![Connect on LinkedIn](https://img.shields.io/badge/LinkedIn-Connect-blue?style=for-the-badge&logo=linkedin&logoColor=white)](https://www.linkedin.com/in/kye-g-38759a207/) [![Follow on X.com](https://img.shields.io/badge/X.com-Follow-1DA1F2?style=for-the-badge&logo=x&logoColor=white)](https://x.com/kyegomezb)\n\n\n\n[![PyPI version](https://badge.fury.io/py/swarms.svg)](https://badge.fury.io/py/swarms)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n![Python Version](https://img.shields.io/badge/python-3.8%2B-blue)\n[![Documentation](https://img.shields.io/badge/docs-latest-brightgreen.svg)](https://swarms.ai/docs)\n\nSwarmShield is an enterprise-grade security system for swarm-based multi-agent communications, providing military-grade encryption, secure conversation management, and comprehensive audit capabilities.\n\n## Features \ud83d\ude80\n\n- **Multi-Layer Encryption**\n - AES-256-GCM encryption\n - SHA-512 hashing\n - HMAC authentication\n - Automatic key rotation\n\n- **Secure Conversation Management**\n - Encrypted persistent storage\n - Thread-safe operations\n - Conversation history tracking\n - Comprehensive audit logs\n\n- **Enterprise Features**\n - Role-based access control\n - Automated backups\n - Detailed analytics\n - Secure exports\n\n## Installation \ud83d\udce6\n\n```bash\npip install swarm-shield\n```\n\n## Quick Start \ud83c\udfc3\u200d\u2642\ufe0f\n\n```python\n\n# Usage Example\nfrom loguru import logger\nfrom swarm_shield.main import EncryptionStrength, SwarmShield\n\n\nif __name__ == \"__main__\":\n try:\n # Initialize SwarmShield\n shield = SwarmShield(encryption_strength=EncryptionStrength.MAXIMUM)\n \n # Create a conversation\n conversation_id = shield.create_conversation(\"Test Chat\")\n \n # protect message\n shield.protect_message(\"agent_name\", \"We generated 3000000k this month \")\n \n # Add messages\n shield.add_message(conversation_id, \"Agent1\", \"Hello, Agent2!\")\n shield.add_message(conversation_id, \"Agent2\", \"Hi Agent1, how are you?\")\n \n # Get message history\n print(\"\\nConversation History:\")\n for agent, message, timestamp in shield.get_messages(conversation_id):\n print(f\"{timestamp} - {agent}: {message}\")\n \n \n # Get conversation overview\n summary = shield.get_conversation_summary(conversation_id)\n print(f\"Messages: {summary['message_count']}\")\n print(f\"Participants: {summary['agents']}\")\n \n \n # Export conversation\n shield.export_conversation(conversation_id, format=\"json\", path=\"chat.json\")\n\n # Backup all conversations\n backup_path = shield.backup_conversations()\n \n \n # Get agent activity stats\n stats = shield.get_agent_stats(\"Agent1\")\n print(f\"Total messages: {stats['total_messages']}\")\n print(f\"Active in {stats['conversations']} conversations\")\n \n # Delete conversation\n shield.delete_conversation(conversation_id)\n \n except Exception as e:\n logger.error(f\"Example failed: {e}\")\n raise\n```\n\n## Security Features \ud83d\udd12\n\n### Encryption Levels\n\n```python\n# Standard: AES-256\nshield = SwarmShield(encryption_strength=EncryptionStrength.STANDARD)\n\n# Enhanced: AES-256 + SHA-512\nshield = SwarmShield(encryption_strength=EncryptionStrength.ENHANCED)\n\n# Maximum: AES-256 + SHA-512 + HMAC\nshield = SwarmShield(encryption_strength=EncryptionStrength.MAXIMUM)\n```\n\n### Key Management\n\n- Automatic key rotation\n- Secure key storage\n- Key versioning\n- Cryptographic separation\n\n### Message Security\n\n- End-to-end encryption\n- Message integrity verification\n- Replay attack prevention\n- Forward secrecy\n\n## Enterprise Features \ud83c\udfe2\n\n### Conversation Management\n\n```python\n# Search conversations\nresults = shield.query_conversations(\n agent_name=\"Agent1\",\n text=\"mission\",\n start_date=datetime(2025, 1, 1),\n limit=10\n)\n\n# Export conversations\nshield.export_conversation(\n conversation_id,\n format=\"json\",\n path=\"mission_logs.json\"\n)\n\n# Create backups\nbackup_path = shield.backup_conversations()\n```\n\n### Analytics\n\n```python\n# Get agent statistics\nstats = shield.get_agent_stats(\"Agent1\")\nprint(f\"Total messages: {stats['total_messages']}\")\nprint(f\"Active in {stats['conversations']} conversations\")\n\n# Get conversation summary\nsummary = shield.get_conversation_summary(conversation_id)\nprint(f\"Participants: {summary['agents']}\")\nprint(f\"Message count: {summary['message_count']}\")\n```\n\n## Production Best Practices \ud83d\udee0\ufe0f\n\n1. **Key Rotation**\n - Set appropriate rotation intervals\n - Implement backup procedures\n - Monitor rotation events\n\n2. **Storage**\n - Use secure storage paths\n - Implement backup strategy\n - Monitor storage usage\n\n3. **Logging**\n - Configure appropriate log levels\n - Secure log storage\n - Regular log analysis\n\n4. **Error Handling**\n - Implement proper error recovery\n - Monitor error rates\n - Set up alerts\n\n## Contributing \ud83e\udd1d\n\nWe welcome contributions! Please see our [Contributing Guidelines](CONTRIBUTING.md) for details.\n\n1. Fork the repository\n2. Create your feature branch\n3. Submit a pull request\n\n## Security \ud83d\udd10\n\nFor security issues, please email security@swarms.ai rather than using issues.\n\n## Testing \u2705\n\nRun the comprehensive test suite:\n\n```bash\npython swarm_shield_tests.py\n```\n\n## Support \ud83d\udcac\n\n- Documentation: [https://swarms.ai/docs](https://swarms.ai/docs)\n- Issues: [GitHub Issues](https://github.com/kyegomez/swarms/issues)\n- Discord: [Join our community](https://discord.gg/swarms)\n- Email: support@swarms.ai\n\n## License \ud83d\udcc4\n\nMIT License - see [LICENSE](LICENSE) for details.\n\n## Creator \ud83d\udc68\u200d\ud83d\udcbb\n\nSwarmShield is created and maintained by Kye Gomez and the team at Swarms.AI.\n\n---\n\nMade with \u2764\ufe0f by [Swarms.AI](https://swarms.ai)",
"bugtrack_url": null,
"license": "MIT",
"summary": "Swarm Shield - TGSC",
"version": "7.0.0",
"project_urls": {
"Documentation": "https://docs.swarms.world",
"Homepage": "https://github.com/The-Swarm-Corporation/swarm-shield",
"Repository": "https://github.com/The-Swarm-Corporation/swarm-shield"
},
"split_keywords": [
"artificial intelligence",
" deep learning",
" optimizers",
" prompt engineering",
" swarms",
" agents",
" llms",
" transformers",
" multi-agent",
" swarms of agents",
" enterprise-grade agents",
" production-grade agents",
" agents",
" multi-grade-agents",
" swarms",
" transformers",
" llms",
" prompt engineering",
" agents",
" generative agents",
" generative ai",
" agent marketplace",
" agent store",
" quant",
" finance",
" algorithmic trading",
" portfolio optimization",
" risk management",
" financial modeling",
" machine learning for finance",
" natural language processing for finance"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "e04260e4856f52b68c863b3faf23733b096812126a7baa122da2c29950a46985",
"md5": "5b0005154ffd46de09d282ddb1fc9721",
"sha256": "c3be40fd483f365e8e05d70087adf9225cc16addbdb910c9c8bed1b27203f65a"
},
"downloads": -1,
"filename": "swarm_shield-7.0.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "5b0005154ffd46de09d282ddb1fc9721",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.10",
"size": 9662,
"upload_time": "2025-01-11T04:58:58",
"upload_time_iso_8601": "2025-01-11T04:58:58.817939Z",
"url": "https://files.pythonhosted.org/packages/e0/42/60e4856f52b68c863b3faf23733b096812126a7baa122da2c29950a46985/swarm_shield-7.0.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "511127927fb89265d9bc6849eb33c3189b49c52135c7f6381210987b0547f0db",
"md5": "27db80b6270e2432aacfaefb8e2e63a8",
"sha256": "936cb0cf17c38b34e2e102cc9c1fb678422d0645ea116c0fcd0aea80693f156f"
},
"downloads": -1,
"filename": "swarm_shield-7.0.0.tar.gz",
"has_sig": false,
"md5_digest": "27db80b6270e2432aacfaefb8e2e63a8",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.10",
"size": 11193,
"upload_time": "2025-01-11T04:59:01",
"upload_time_iso_8601": "2025-01-11T04:59:01.059053Z",
"url": "https://files.pythonhosted.org/packages/51/11/27927fb89265d9bc6849eb33c3189b49c52135c7f6381210987b0547f0db/swarm_shield-7.0.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-01-11 04:59:01",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "The-Swarm-Corporation",
"github_project": "swarm-shield",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [
{
"name": "cryptography",
"specs": []
},
{
"name": "loguru",
"specs": []
}
],
"lcname": "swarm-shield"
}