返回 Skill 列表
extension
分类: 开发与工程无需 API Key

LocalShield 本地出站隐私与合规预检

LocalShield 是面向 WorkBuddy、Qoder、TRAE Work 等生产力 Agent 的本地出站隐私与合规预检 Skill。在上传、发送、共享、发布或提交本地文本、代码、PDF、DOCX 等内容前,使用确定性规则与本地语义模型检测凭据、个人信息、合同财务信息和企业机密,返回 PASS、WARN、BLOCK、REVIEW_REQUIRED 四种结构化决策。BLOCK 时生成脱敏副本并独立复检,只有复检通过才允许继续;原文件保持不变,敏感证据仅以掩码形式记录。采用 localhost Client/Server 架构,支持 OpenVINO CPU/GPU/AUTO 本地推理,安装完成后可在断网环境运行,无云端回退。上传、发送、共享、发布、提交、粘贴到云端、脱敏、隐私检查、合规预检、密钥扫描、合同脱敏, 或者上传、发送、分享、提交、外发、隐私检查、编辑、秘密扫描和数据丢失防护(DLP)。所有解析和推理都在本地进行,不会回落到云端。

person作者: wzf794hubModelScope

LocalShield

Use LocalShield immediately before a production Agent moves local content outside the device. WorkBuddy contract and customer-document delivery is the primary workflow; Qoder and TRAE Work use the same entry contract.

LocalShield is an Agent decision service, not a system firewall. The host must call it and honor its result.

Fixed entry point

Expose only scripts\run.ps1 to the host. Run from the Skill directory.

| Intent | Command | |---|---| | Inspect a contract before sending | .\scripts\run.ps1 -InputPath .\examples\risky_contract.md -Action send -Destination external_partner -Mode gate -Policy workbuddy_contract_policy -Device AUTO | | Inspect inline text | .\scripts\run.ps1 -Text "请把客户电话 13800138000 发给外部供应商" -Action send -Destination external_partner -Mode gate | | Audit without enforcement | .\scripts\run.ps1 -InputPath .\examples\clean_public_note.md -Action publish -Destination public_web -Mode audit |

The first call creates .runtime\venv and installs pinned dependencies. Run .\scripts\setup.ps1 explicitly when preparing a demo. If setup was interrupted, run .\scripts\setup.ps1 -Continue or pass -Continue to the fixed entry point. After setup, runtime inference does not require network access.

Request behavior

  • Provide exactly one of -InputPath or -Text.
  • Use -Action audit|upload|publish|share|send|commit|summarize.
  • Use -Destination local|internal|external_cloud|external_partner|public_web|public_repo|unknown.
  • Use -Mode gate for production actions, sanitize to request a copy, and audit for observation only.
  • Keep -Device AUTO unless the user asks to validate a detected CPU, GPU, or NPU.

Supported inputs are text, Markdown, JSON, CSV, common source files, text PDFs, and DOCX. DOCX scanning includes body paragraphs, tables, headers, and footers. DOCX sanitization creates a valid new Office document. PDF sanitization currently returns a text projection; do not represent it as a layout-preserving PDF.

Interpret the JSON result

  • PASS: continue with the original input.
  • WARN: explain the risk and ask the user before continuing.
  • BLOCK: stop the original-file action. Use only a sanitized artifact whose sanitized_recheck.decision is PASS.
  • REVIEW_REQUIRED: stop automation and request manual review.

The result includes masked findings, location, model/backend/device metadata, input hash, sanitized artifact metadata, and privacy invariants. A successful scan may return exit code 0 even when its semantic decision is BLOCK; parse the JSON decision.

Failure handling

Fail closed when input parsing, policy loading, model loading, or local service startup fails. Never retry against a remote URL. The client rejects non-loopback service addresses. Do not write original content or unmasked evidence to audit JSON or remote logs.

Validation and references

Read references/workbuddy_integration.md before WorkBuddy validation and references/host_validation.md for the PASS/WARN/BLOCK/REVIEW_REQUIRED matrix. Read references/architecture.md when changing transport, model, or privacy invariants. Read references/submission_checklist.md before publishing to ModelScope.