[SECURITY.Md]

pull/299/head
Kye 1 year ago
parent 3a500ebf73
commit e7ccd1ef9f

@ -1,19 +1,25 @@
# Security Policy
===============
## Supported Versions
------------------
| Security Feature | Benefit | Description |
|-------------------------------|------------------------------------------|-----------------------------------------------------------------------------|
| Environment Variables | Secure Configuration | Uses environment variables to manage sensitive configurations securely. |
| No Telemetry | Enhanced Privacy | Prioritizes user privacy by not collecting telemetry data. |
| Data Encryption | Data Protection | Encrypts sensitive data to protect it from unauthorized access. |
| Authentication | Access Control | Ensures that only authorized users can access the system. |
| Authorization | Fine-grained Access | Provides specific access rights to users based on roles and permissions. |
| Dependency Security | Reduced Vulnerabilities | Securely manages dependencies to prevent vulnerabilities. |
| Secure Installation | Integrity Assurance | Ensures the integrity of the software through verified sources and checksums.|
| Regular Updates | Ongoing Protection | Keeps the system secure by regularly updating to patch vulnerabilities. |
| Logging and Monitoring | Operational Oversight | Tracks system activity for security monitoring and anomaly detection. |
| Error Handling | Robust Security | Manages errors securely to prevent leakage of sensitive information. |
| Data Storage Security | Secure Data Handling | Stores data securely, ensuring confidentiality and integrity. |
| Data Transmission Security | Secure Data Transfer | Protects data during transit from eavesdropping and tampering. |
| Access Control Mechanisms | Restricted Access | Limits system access to authorized personnel only. |
| Vulnerability Management | Proactive Protection | Identifies and mitigates security vulnerabilities effectively. |
| Regulatory Compliance | Legal Conformity | Ensures that the system adheres to relevant legal and regulatory standards. |
| Security Audits |
* * * * *
| Version | Supported |
| --- | --- |
| 2.0.5 | :white_check_mark: |
| 2.0.4 | :white_check_mark: |
| 2.0.3 | :white_check_mark: |
| 2.0.2 | :white_check_mark: |
| 2.0.1 | :white_check_mark: |
| 2.0.0 | :white_check_mark: |
# Reporting a Vulnerability
-------------------------

@ -14,5 +14,5 @@ task = "What is your name"
img = "images/github-banner-swarms.png"
# Run the model
out = model.run("What is your name?")
out = model.run("What is your name?", img=img)
print(out)

@ -82,6 +82,7 @@ class Gemini(BaseMultiModalModel):
stop_sequence=["x"],
max_output_tokens: int = 100,
temperature: float = 0.9,
system_prompt: str = None,
*args,
**kwargs,
):
@ -95,6 +96,7 @@ class Gemini(BaseMultiModalModel):
self.stop_sequence = stop_sequence
self.max_output_tokens = max_output_tokens
self.temperature = temperature
self.system_prompt = system_prompt
# Prepare the generation config
self.generation_config = GenerationConfig(
@ -102,6 +104,8 @@ class Gemini(BaseMultiModalModel):
# stop_sequence=stop_sequence,
max_output_tokens=max_output_tokens,
temperature=temperature,
*args,
**kwargs,
)
# Initialize the model
@ -151,30 +155,30 @@ class Gemini(BaseMultiModalModel):
str: output from the model
"""
try:
# if img:
# # process_img = self.process_img(img, *args, **kwargs)
# process_img = self.process_img_pil(img)
# response = self.model.generate_content(
# contents=[task, process_img],
# generation_config=self.generation_config,
# stream=self.stream,
# *args,
# **kwargs,
# )
# # if self.candidates:
# # return response.candidates
# # elif self.safety:
# # return response.safety
# # else:
# # return response.text
# return response.text
# else:
response = self.model.generate_content(
task, stream=self.stream, *args, **kwargs
)
return response.text
if img:
# process_img = self.process_img(img, *args, **kwargs)
process_img = self.process_img_pil(img)
response = self.model.generate_content(
contents=[task, process_img],
generation_config=self.generation_config,
stream=self.stream,
*args,
**kwargs,
)
# if self.candidates:
# return response.candidates
# elif self.safety:
# return response.safety
# else:
# return response.text
return response.text
else:
response = self.model.generate_content(
task, stream=self.stream, *args, **kwargs
)
return response.text
except Exception as error:
print(f"Error running Gemini model: {error}")
print(f"Please check the task and image: {task}, {img}")

@ -1,4 +1,5 @@
from swarms.telemetry.log_all import log_all_calls, log_calls
# from swarms.telemetry.posthog_utils import log_activity_posthog
from swarms.telemetry.user_utils import (
generate_user_id,

Loading…
Cancel
Save