{"data":{"slug":"jnmetacode-shellward","name":"shellward","tagline":"AI application compliance gateway","github_url":"https://github.com/jnMetaCode/shellward","owner":"jnMetaCode","repo":"shellward","owner_avatar_url":"https://avatars.githubusercontent.com/u/12096460?v=4","primary_language":"TypeScript","stars":139,"forks":23,"topics":["agent-security","ai-agent","ai-firewall","ai-safety","ai-security","claude-code","cursor","data-exfiltration","dlp","guardrails","hermes-agent","langchain","llm-security","mcp","mcp-security","openclaw","pii-detection","prompt-injection","security","shellward"],"archived":false,"github_pushed_at":"2026-09-28T23:15:38+00:00","maintenance_label":"Active","stars_delta_30d":6,"url":"https://www.graphcanon.com/tools/jnmetacode-shellward","markdown_url":"https://www.graphcanon.com/tools/jnmetacode-shellward.md","api_url":"https://www.graphcanon.com/api/graphcanon/tools/jnmetacode-shellward","graph_url":"https://www.graphcanon.com/api/graphcanon/graph?tool=jnmetacode-shellward","description":"AI 应用合规网关 · 一行命令体检 AI 项目的「数据出境 / 硬编码密钥 / 个人信息暴露」（网安法·PIPL·等保2.0·数据出境·AI标识），并给出境内模型替代建议；可作运行时防护拦截注入与数据外泄 · 中文优先 · 零依赖 · 开源","homepage_url":"https://jnmetacode.github.io/shellward/","license":"Apache-2.0","open_issues":1,"watchers":3,"ai_summary":"A Chinese-language tool for ensuring AI projects comply with Chinese regulations such as the Cybersecurity Law, PIPL, MLPS 2.0, and data出境 standards. Offers detection of data export risks, hard-coded keys, and personal information exposure, along with suggestions for compliant domestic model alternatives.","readme_excerpt":"<p align=\"center\">\n  <img src=\"assets/logo.svg\" alt=\"ShellWard Logo\" width=\"160\" />\n</p>\n\n# ShellWard\n\n**AI 应用合规网关** — 为中国监管而生的 AI Agent 安全合规工具（网安法 2026 / PIPL / 等保2.0 / 数据出境 / AI标识）。先一行命令体检项目合规风险，再在运行时拦截提示注入、数据外泄与危险命令。中文威胁检测 + 中文 PII + 零依赖——英文工具不做的事。\n\n\n\n\n\n\n**🌐 官网: https://jnmetacode.github.io/shellward/**\n\n[中文](#30-秒合规体检) | [English](#english)\n\n## 30 秒合规体检\n\n零安装、只读、不上传任何数据。一行命令，扫出你的 AI 项目踩了哪些合规红线：\n\n```bash\nnpx shellward scan\n```\n\n输出一张映射到 **网安法 / PIPL / 等保2.0 / 数据出境 / AI标识** 的红黄绿评分卡，并精确到 `文件:行`：\n\n```\n## 🔍 项目实测风险\n🌐 数据出境风险: 2 ｜ 🔑 硬编码密钥: 3 ｜ 🪪 个人信息暴露: 2 ｜ 📂 .env 权限: 1\n\n- .env:2          境外大模型端点: OpenAI — 向其发送个人信息即构成数据出境\n- package.json:12 境外大模型 SDK 依赖: openai — 项目内含数据出境通道\n- src/config.ts:3 硬编码 GitHub Token: ghp_12*** — 凭据不应写入源码\n- customers.csv:2 手机号 13912*** — 个人信息出现在文件中，需评估脱敏\n\n合规得分: 63/100  [C]\n```\n\n## 🆕 让你的 agent 做一次完整合规审计（Skill）\n\n`scan` 是确定性扫描：它能告诉你「项目里有境外模型端点」，但判断不了**个人信息有没有真的流过去**；14 个法规控制项里也有 11 个它只能标「需人工确认」。这一段交给你的编码 agent 来做——Claude Code、Cursor、Codex 等支持 Agent Skills 的工具都能用。\n\n把这句话粘贴给你的 agent：\n\n```text\n安装 https://github.com/jnMetaCode/shellward 里的 china-ai-compliance-audit skill，然后用它审计当前项目。\n```\n\n或者用命令装：`npx skills add jnMetaCode/shellward --skill china-ai-compliance-audit`\n\n它会先跑 `shellward scan` 拿确定性基线，再顺着数据流逐项取证，最后产出 `.compliance/COMPLIANCE-REPORT.md`。和「让 AI 随便看看合不合规」的区别在三道闸：\n\n| | |\n|---|---|\n| **取证闸** | 每条发现必须带 `文件:行` + 原文引用；校验脚本逐条打开文件核对，**引用对不上就不算数**（防幻觉） |\n| **复核闸** | 每条「缺口」和「已满足」都要被一个没看过推理过程的独立 agent 尝试推翻一次；推翻的留档不删 |\n| **诚实闸** | 仓库里找不到的事实（备案、PIA、日志实际保留天数）不许替你下结论，只许提出**一个人能直接回答的具体问题** |\n\n另外：14 个控制项必须全部有结论，不许悄悄跳过；报告里不许出现完整密钥、手机号、身份证号——合规报告自己不能泄漏数据。\n\n**示例**（[演示项目](skills/china-ai-compliance-audit/examples/demo-app) · [完整记录](skills/china-ai-compliance-audit/examples/compliance-findings.example.json)）：一个客服机器人，`shellward scan` 给 **75 分 [B]**、只报出「有 OpenAI 端点」；审计顺着调用链查到客户手机号和身份证号被拼进 system prompt 发往境外——**2 条严重、3 条高**，外加 6 个只有人能回答的问题（比如「审核是不是在网关侧做了」——仓库里看不到的事，它不替你下结论）。\n\n> 这是技术自查材料，不是法律意见。备案、定级、PIA 等主体责任不能由工具代替。\n\n**团队要对多个 AI 项目做合规自查、或想把它接进内部流程？** 邮件 [jnMetaCode@qq.com](mailto:jnMetaCode@qq.com?subject=ShellWard%20合规自查)，说一下团队规模和场景。\n\n想在浏览器里看？`npx shellward scan --open`（扫完直接打开报告）或 `--serve`（本地 http://localhost 提供报告）——**数据全程不出本机**。\n\n**Web 扫描器 / 客户端（双模式）**：\n- `shellward web` — 公开仓库 web 扫描器：网页贴「公开仓库 URL」或用 `/scan?repo=URL` 链接体检（可部署，见 `Dockerfile`）。\n- `shellward web --local` — 本地 web GUI（客户端体验）：填本地路径扫描，**私有代码不上传、不出本机**，无需命令行。\n\n`--json` 供 CI · `--ci` 发现 critical 时让构建失败 · `--html report.html` 导出可打印成 PDF 的报告（备案/审计存档）· 也可作 [GitHub Action](#github-action-pr-compliance-gate) 接入 PR 门禁。\n\n> 检测重点：**境外大模型端点与 SDK 依赖（数据出境——中国独有、英文工具没有的概念）**、硬编码密钥、文件中的中文 PII、`.env` 暴露。扫到境外模型（如 `openai` 依赖）时，**直接给出境内合规替代**（通义千问 / DeepSeek / Kimi / 智谱）及其 OpenAI 兼容 `base_url`——多数迁移只需改一个 `base_url`。\n\n<details>\n<summary><b>境内合规替代表</b>（<code>src/rules/domestic-alternatives.ts</code>，报告里默认推荐前 4 个；欢迎 PR 补充，见 <a href=\"https://github.com/jnMetaCode/shellward/issues/3\">#3</a>）</summary>\n\n| 境内模型 | 厂商 | OpenAI 兼容 `base_url` |\n|---|---|---|\n| 通义千问 Qwen | 阿里云百炼/DashScope | `https://dashscope.aliyuncs.com/compatible-mode/v1` |\n| DeepSeek | 深度求索 | `https://api.deepseek.com` |\n| Kimi | 月之暗面 | `https://api.moonshot.cn/v1` |\n| 智谱 GLM | 智谱 AI | `https://open.bigmodel.cn/api/paas/v4` |\n| 豆包 Doubao | 字节火山方舟 | `https://ark.cn-beijing.volces.com/api/v3` |\n| 文心一言 ERNIE | 百度千帆 | `https://qianfan.baidubce.com/v2` |\n| 腾讯混元 Hunyuan | 腾讯云 | `https://api.hunyuan.cloud.tencent.com/v1` |\n| MiniMax | 稀宇科技 | `https://api.minimaxi.com/v1` |\n| 讯飞星火 Spark | 科大讯飞 | `https://spark-api-open.xf-yun.com/v1` |\n| 阶跃星辰 Step | 阶跃星辰 | `https://api.stepfun.com/v1` |\n| 百川 Baichuan | 百川智能 | `https://api.baichuan-ai.com/v1` |\n| 零一万物 Yi | 零一万物 | `https://api.lingyiwanwu.com/v1` |\n\n`base_url` 为各厂商公开的 OpenAI 兼容端点，可能随官方调整，迁移前以官方文档为准。境外识别覆盖 OpenAI / Anthropic / Gemini / Azure / Bedrock / Cohere / Mistral / Groq / Together / Perplexity / OpenRouter / HuggingFace / xAI / Replicate / AI21 / Fireworks / DeepInfra / Cerebras / Voyage / NVIDIA NIM 的端点，以及 npm / pip / Go 的 SDK 依赖（含 LangChain、LlamaIndex、Vercel AI SDK 适配包），见 `","github_created_at":"2026-03-12T07:54:33+00:00","created_at":"2026-07-15T10:43:21.453736+00:00","updated_at":"2026-10-21T06:00:46.453669+00:00","categories":[{"slug":"ai-agents","name":"AI Agents","url":"https://www.graphcanon.com/categories/ai-agents","markdown_url":"https://www.graphcanon.com/categories/ai-agents.md","api_url":"https://www.graphcanon.com/api/graphcanon/categories/ai-agents"},{"slug":"evaluation-observability","name":"Evaluation & Observability","url":"https://www.graphcanon.com/categories/evaluation-observability","markdown_url":"https://www.graphcanon.com/categories/evaluation-observability.md","api_url":"https://www.graphcanon.com/api/graphcanon/categories/evaluation-observability"}],"tags":[{"slug":"agent-security","name":"agent-security"},{"slug":"ai-firewall","name":"ai-firewall"},{"slug":"data-exfiltration","name":"data-exfiltration"},{"slug":"dlp","name":"dlp"},{"slug":"llm-security","name":"llm-security"},{"slug":"prompt-injection","name":"prompt-injection"},{"slug":"security","name":"security"}],"trust":{"provenance":{"is_fork":false,"github_id":1179619512,"owner_type":"User","methodology":"github_public_v1","parent_repo":null,"near_duplicate_slugs":[]},"computed_at":"2026-10-21T06:00:44.694Z","maintenance":{"label":"Active","score":82,"methodology":"github_public_v1","releases_90d":0,"days_since_push":22,"last_release_at":"2026-06-23T14:55:02Z","stars_delta_30d":6,"open_issues_delta_30d":-3},"security_summary":{"last_scan_at":"2026-07-15T10:43:24.184462+00:00","scan_profile":"mcp_manifest","status":"findings","critical_count":0,"high_count":0,"medium_count":1,"low_count":0,"scanner":"mcp_manifest@v1","scan_id":"7f304301-6652-472d-a6f4-5c1a235cc7aa","pending_review_count":0}},"capability_facts":{"mcp":{"method":"repository-declaration@2","source":"manifest:server.json","status":"declared","revision":"78444dd9a05ce72f25cc14bc05030fc7a702b536","source_url":"https://github.com/jnMetaCode/shellward/blob/78444dd9a05ce72f25cc14bc05030fc7a702b536/server.json","observed_at":"2026-10-21T06:00:45.081Z","server_manifest":true},"scan":{"method":"github-tree-and-contents@2","source":"repo_scan","status":"complete","version":2,"coverage":{"scope":"bounded-repository-manifests","tree_complete":true,"selected_files":3,"candidate_files":3},"revision":"78444dd9a05ce72f25cc14bc05030fc7a702b536","source_url":"https://github.com/jnMetaCode/shellward/tree/78444dd9a05ce72f25cc14bc05030fc7a702b536","observed_at":"2026-10-21T06:00:45.081Z","observations":[{"path":"@revision","bytes":3414,"status":"present","revision":"78444dd9a05ce72f25cc14bc05030fc7a702b536","source_url":"https://github.com/jnMetaCode/shellward/commit/78444dd9a05ce72f25cc14bc05030fc7a702b536","http_status":200,"observed_at":"2026-10-21T06:00:45.252Z"},{"path":"@tree","bytes":28814,"status":"present","revision":"78444dd9a05ce72f25cc14bc05030fc7a702b536","source_url":"https://github.com/jnMetaCode/shellward/tree/78444dd9a05ce72f25cc14bc05030fc7a702b536","http_status":200,"observed_at":"2026-10-21T06:00:45.718Z"},{"path":"docker-compose.yml","reason":"not-listed-in-complete-tree","status":"not-found","revision":"78444dd9a05ce72f25cc14bc05030fc7a702b536","source_url":"https://github.com/jnMetaCode/shellward/tree/78444dd9a05ce72f25cc14bc05030fc7a702b536","observed_at":"2026-10-21T06:00:45.718Z"},{"path":"Dockerfile","bytes":617,"status":"present","revision":"78444dd9a05ce72f25cc14bc05030fc7a702b536","source_url":"https://github.com/jnMetaCode/shellward/blob/78444dd9a05ce72f25cc14bc05030fc7a702b536/Dockerfile","http_status":200,"observed_at":"2026-10-21T06:00:45.851Z"},{"path":"mcp.json","reason":"not-listed-in-complete-tree","status":"not-found","revision":"78444dd9a05ce72f25cc14bc05030fc7a702b536","source_url":"https://github.com/jnMetaCode/shellward/tree/78444dd9a05ce72f25cc14bc05030fc7a702b536","observed_at":"2026-10-21T06:00:45.718Z"},{"path":"package.json","bytes":2858,"status":"present","revision":"78444dd9a05ce72f25cc14bc05030fc7a702b536","source_url":"https://github.com/jnMetaCode/shellward/blob/78444dd9a05ce72f25cc14bc05030fc7a702b536/package.json","http_status":200,"observed_at":"2026-10-21T06:00:45.854Z"},{"path":"pyproject.toml","reason":"not-listed-in-complete-tree","status":"not-found","revision":"78444dd9a05ce72f25cc14bc05030fc7a702b536","source_url":"https://github.com/jnMetaCode/shellward/tree/78444dd9a05ce72f25cc14bc05030fc7a702b536","observed_at":"2026-10-21T06:00:45.718Z"},{"path":"server.json","bytes":1277,"status":"present","revision":"78444dd9a05ce72f25cc14bc05030fc7a702b536","source_url":"https://github.com/jnMetaCode/shellward/blob/78444dd9a05ce72f25cc14bc05030fc7a702b536/server.json","http_status":200,"observed_at":"2026-10-21T06:00:45.827Z"}]},"has_cli":{"value":true,"method":"repository-declaration@2","source":"package.json:bin","status":"declared","revision":"78444dd9a05ce72f25cc14bc05030fc7a702b536","source_url":"https://github.com/jnMetaCode/shellward/blob/78444dd9a05ce72f25cc14bc05030fc7a702b536/package.json","observed_at":"2026-10-21T06:00:45.081Z"},"languages":{"value":["typescript","javascript"],"method":"github-tree-and-contents@2","source":"github.language+package.json","revision":"78444dd9a05ce72f25cc14bc05030fc7a702b536","source_url":"https://github.com/jnMetaCode/shellward/tree/78444dd9a05ce72f25cc14bc05030fc7a702b536","observed_at":"2026-10-21T06:00:45.081Z"},"has_docker":{"value":true,"method":"repository-declaration@2","source":"dockerfile:Dockerfile","revision":"78444dd9a05ce72f25cc14bc05030fc7a702b536","source_url":"https://github.com/jnMetaCode/shellward/blob/78444dd9a05ce72f25cc14bc05030fc7a702b536/Dockerfile","observed_at":"2026-10-21T06:00:45.081Z"},"license_spdx":{"value":"Apache-2.0","source":"github.license","observed_at":"2026-10-21T06:00:45.081Z"}},"decision_facts":{"hosting":null,"pricing":null,"requirements":null,"constraints":null,"when_to_use":["When AI projects involve personal information or cross-border data transfers under China's regulatory framework","To evaluate if project dependencies and configurations align with cybersecurity law, PIPL, MLPS 2.0, and data出境 standards"],"when_not_to_use":["If your AI project is not subject to Chinese laws and regulations","For projects needing only general compliance checks without specific attention to Chinese legal requirements"],"source":"enrich:decision_facts","observed_at":"2026-07-17T06:05:02.132Z"},"constraint_facets":null,"decision_summary":[{"label":"Adopt for","value":"Unverified catalog guidance: A tool for compliance with Chinese data regulations, offering risk assessments and runtime protection specific to these laws."}]}}