{"id":46441886,"url":"https://github.com/serein-213/yin-shield","last_synced_at":"2026-03-05T22:01:31.503Z","repository":{"id":337487516,"uuid":"1153884922","full_name":"serein-213/yin-shield","owner":"serein-213","description":"🛡️ YinShield (隐): The zero-config, local-first privacy layer for AI APIs. 让你的数据对 AI 隐形。","archived":false,"fork":false,"pushed_at":"2026-02-09T19:29:40.000Z","size":6,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-02-09T22:59:41.349Z","etag":null,"topics":["ai-safety","chinese-nlp","de-identification","deepseek","llm","openai","pii-detection","privacy","security","zero-config"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/serein-213.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-09T19:29:37.000Z","updated_at":"2026-02-09T19:32:01.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/serein-213/yin-shield","commit_stats":null,"previous_names":["serein-213/yin-shield"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/serein-213/yin-shield","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serein-213%2Fyin-shield","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serein-213%2Fyin-shield/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serein-213%2Fyin-shield/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serein-213%2Fyin-shield/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/serein-213","download_url":"https://codeload.github.com/serein-213/yin-shield/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serein-213%2Fyin-shield/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30151958,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-05T21:15:50.531Z","status":"ssl_error","status_checked_at":"2026-03-05T21:15:11.173Z","response_time":93,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6: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-safety","chinese-nlp","de-identification","deepseek","llm","openai","pii-detection","privacy","security","zero-config"],"created_at":"2026-03-05T22:00:50.380Z","updated_at":"2026-03-05T22:01:31.455Z","avatar_url":"https://github.com/serein-213.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🛡️ YinShield (隐)\n\n**Make your data invisible to AI, like a shadow.**  \n**让你的数据对 AI 隐形，如影随形。**\n\n[![PyPI version](https://img.shields.io/pypi/v/yinshield.svg)](https://pypi.org/project/yinshield/)\n[![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](LICENSE)\n\n---\n\n## ☯️ What is YinShield? | 什么是隐盾？\n\n**Yin (隐)** in Chinese means *Hidden* or *Invisible*. \n\n**YinShield** is a lightweight, zero-config Python library designed to protect your privacy when using AI APIs (like OpenAI, DeepSeek, Claude). It intercepts sensitive information locally, replaces it with semantically-consistent tokens, and restores it automatically after the AI responds.\n\n**隐盾 (YinShield)** 是一款轻量级、零配置的 Python 库，专为保护 AI API 使用过程中的隐私而生。它在本地拦截敏感信息，将其替换为保持语义一致的占位符，并在 AI 回复后自动还原。\n\n### 🌟 Key Features | 核心特性\n\n- **🚀 Zero Config**: `pip install` and you are ready. No complex setups or local servers required.\n- **🧠 Semantic Preservation**: Unlike brute-force masking, YinShield uses \"Semantic Aliases\" (e.g., replacing \"Zhang San\" with \"Li Si\") to keep the AI's reasoning capabilities intact.\n- **🔒 Local-First**: All detection and masking happen on your machine. No sensitive data ever leaves your device.\n- **🇨🇳 Optimized for China**: Built-in support for Chinese-specific PII (WeChat ID, ID cards, Chinese addresses, etc.).\n- **🔌 Drop-in Replacement**: Seamlessly integrates with your existing AI SDK calls.\n\n---\n\n## 🛠️ Quick Start | 快速上手\n\n### Installation | 安装\n```bash\npip install yinshield\n```\n\n### Basic Usage | 基本用法 (Coming Soon)\n```python\nfrom yinshield import Shield\n\n# Initialize the shield\nshield = Shield()\n\nraw_text = \"我叫张三，我的手机号是13812345678，我住在北京市朝阳区。\"\n\n# 1. Locally mask sensitive data\nmasked_text, mapping = shield.mask(raw_text)\n# masked_text becomes: \"我叫\u003cPERSON_1\u003e，我的手机号是\u003cPHONE_1\u003e，我住在\u003cLOC_1\u003e。\"\n\n# 2. Call your AI API with masked_text...\n# (AI processes the data without knowing who you are)\n\n# 3. Restore the response locally\nfinal_response = shield.unmask(ai_response, mapping)\n```\n\n---\n\n## 🗺️ Roadmap | 开发路线图\n\n- [ ] v0.1.0: Core Regex-based Chinese PII masking.\n- [ ] v0.2.0: Lightweight ONNX model integration for high-accuracy NER.\n- [ ] v0.3.0: Semantic Alias engine (Consistent persona mapping).\n- [ ] v0.4.0: Image/OCR privacy protection.\n\n---\n\n## 🤝 Contributing | 贡献\n\nYinShield is an open-source project. We welcome contributions to help make AI safer for everyone!\n\n## 📄 License | 许可证\n\n[Apache-2.0 License](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fserein-213%2Fyin-shield","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fserein-213%2Fyin-shield","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fserein-213%2Fyin-shield/lists"}