{"id":51310643,"url":"https://github.com/hq969/ethos-ai","last_synced_at":"2026-07-01T03:32:59.135Z","repository":{"id":339195236,"uuid":"1160874511","full_name":"hq969/ethos-ai","owner":"hq969","description":"Ethos-AI is a specialized framework or platform designed to integrate ethical considerations directly into the development and deployment of artificial intelligence. It focuses on ensuring that machine learning models are not just efficient, but also fair, transparent, and accountable.","archived":false,"fork":false,"pushed_at":"2026-02-18T14:03:37.000Z","size":25,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-02-18T17:44:22.108Z","etag":null,"topics":["go","java","javascript","mrm","python","sql"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hq969.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-02-18T13:27:01.000Z","updated_at":"2026-02-18T14:10:06.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/hq969/ethos-ai","commit_stats":null,"previous_names":["hq969/ethos-ai"],"tags_count":null,"template":true,"template_full_name":null,"purl":"pkg:github/hq969/ethos-ai","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hq969%2Fethos-ai","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hq969%2Fethos-ai/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hq969%2Fethos-ai/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hq969%2Fethos-ai/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hq969","download_url":"https://codeload.github.com/hq969/ethos-ai/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hq969%2Fethos-ai/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34992071,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-01T02:00:05.325Z","response_time":130,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["go","java","javascript","mrm","python","sql"],"created_at":"2026-07-01T03:32:58.929Z","updated_at":"2026-07-01T03:32:59.106Z","avatar_url":"https://github.com/hq969.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# EthosAI: Responsible Generative AI Framework\n\n**EthosAI** is a compliance and safety layer designed for high-stakes Generative AI applications (Finance, Healthcare, Governance). It acts as a middleware between the user and the LLM (Google Gemini Pro), ensuring that all inputs are sanitized for PII and all outputs are audited for bias and toxicity before reaching the end-user.\n\n---\n\n## 🏗️ System Architecture\n\n\n\nThe system operates on a **Microservices Architecture** with three core guardians:\n1.  **The Guardian (Compliance):** Redacts PII (GDPR/HIPAA) using Microsoft Presidio.\n2.  **The Auditor (Bias \u0026 Safety):** Detects toxicity and bias using Hugging Face transformers.\n3.  **The Explainer (Transparency):** Generates visual and textual explanations for AI decisions.\n\n---\n\n## 🚀 Features\n\n* **Real-time PII Redaction:** Automatically detects and masks Credit Cards, SSNs, and Phone Numbers.\n* **Bias \"Circuit Breaker\":** Blocks generated content if it exceeds toxicity thresholds.\n* **Multimodal Explainability:** Provides a \"Reasoning Trace\" and visualization for every response.\n* **Adversarial Defense:** Includes a \"Red Team\" script to test system robustness against jailbreaks.\n* **Cloud Native:** Ready for deployment on Google Cloud Run.\n\n---\n\n## 🛠️ Prerequisites\n\n* **Python 3.9+**\n* **Google Cloud Platform Account** (with Vertex AI API enabled)\n* **Docker** (optional, for containerization)\n\n---\n\n## 📦 Installation\n\n1.  **Clone the Repository**\n    ```bash\n    git clone [https://github.com/hq969/ethos-ai.git](https://github.com/hq969/ethos-ai.git)\n    cd ethos-ai\n    ```\n\n2.  **Create a Virtual Environment**\n    ```bash\n    python -m venv venv\n    source venv/bin/activate  # On Windows: venv\\Scripts\\activate\n    ```\n\n3.  **Install Dependencies**\n    ```bash\n    pip install -r requirements.txt\n    python -m spacy download en_core_web_lg\n    ```\n\n4.  **Set Up Google Cloud Credentials**\n    * Ensure you have a Service Account Key JSON file.\n    * Set the environment variable:\n        ```bash\n        export GOOGLE_APPLICATION_CREDENTIALS=\"path/to/your/key.json\"\n        export PROJECT_ID=\"your-gcp-project-id\"\n        ```\n\n---\n\n## 🏃‍♂️ Usage\n\n### 1. Start the API Server\nRun the FastAPI gateway. This will initialize the Compliance, Bias, and Explainability engines.\n```bash\npython main.py\n\n```\n\n*The server will start at `http://0.0.0.0:8080*`\n\n### 2. Manual Testing (cURL)\n\nOpen a new terminal and send a request with sensitive data to see the redaction in action:\n\n```bash\ncurl -X POST \"http://localhost:8080/generate_safe\" \\\n     -H \"Content-Type: application/json\" \\\n     -d '{\"user_id\": \"test_user\", \"prompt\": \"My name is John Doe and my SSN is 123-45-6789. Can you confirm my loan status?\"}'\n\n```\n\n### 3. Run Adversarial \"Red Team\" Tests\n\nRun the automated test suite to attempt \"jailbreaking\" the model and verify that the safety layers hold up.\n\n```bash\npython adversarial_test.py\n\n```\n\n---\n\n## 📂 Project Structure\n\n```text\nethos-ai/\n├── main.py                   # FastAPI Gateway \u0026 Vertex AI Integration\n├── compliance_service.py     # PII Redaction (Presidio)\n├── bias_engine.py            # Toxicity Detection (Transformers)\n├── explainability_engine.py  # Visualization Generation\n├── adversarial_test.py       # Red Team Testing Suite\n├── requirements.txt          # Python Dependencies\n├── Dockerfile                # Container Configuration\n└── README.md                 # Project Documentation\n\n```\n\n---\n\n## 🚢 Deployment (Google Cloud Run)\n\nTo deploy this framework as a serverless microservice:\n\n```bash\n# 1. Build the container\ngcloud builds submit --tag gcr.io/$PROJECT_ID/ethos-ai-gateway .\n\n# 2. Deploy to Cloud Run\ngcloud run deploy ethos-ai-service \\\n  --image gcr.io/$PROJECT_ID/ethos-ai-gateway \\\n  --platform managed \\\n  --region us-central1 \\\n  --allow-unauthenticated\n\n```\n\n---\n\n## 📜 License\n\nMIT License. See `LICENSE` for more information.\n\n---\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhq969%2Fethos-ai","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhq969%2Fethos-ai","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhq969%2Fethos-ai/lists"}