航运数据跨境合规安全网关 - AI自动识别敏感字段,一键合规检测
  • Python 90.8%
  • HTML 9.2%
Find a file
QqwqQ c0b28ac95d SPECS.md 重写对齐 Wave 4,DEPLOY.md 补 HTTPS 与部署自检
三处遗留的过时文档,评审对照着看会认为文档自相矛盾:

- SPECS.md 仍标「Wave 1 — Idea(构想)」,且写着「三级数据分级」
  「有核心数据必判禁止出境」——与双轴模型直接冲突。重写为 Wave 4 规格:
  双轴模型、十问问卷、红线检查、复现方式、规则库覆盖与刻意的克制
- DEPLOY.md 全篇教人用 HTTP 部署,而明文传输正是 Wave 3 被点名的问题。
  新增第九节强制 HTTPS(Let's Encrypt + 301 跳转 + 验收命令),
  并在验收环节前置「服务器上跑 verify.py 并核对 ruleset_version 与仓库 HEAD 一致」
  ——上一轮线上跑五周前旧代码,就是因为没有这一步
- requirements 拆分:运行依赖与验证依赖分开,openai 标注为可选;
  新增 requirements-dev.txt 含 pytest,评审复现测试时装得上
2026-08-11 01:10:14 +08:00
.agents/skills 新增智能体定义与九个技能 2026-08-10 23:47:15 +08:00
.streamlit 更新项目:新增AI识别引擎、文档和配置文件 2026-06-27 23:15:24 +08:00
docs SPECS.md 重写对齐 Wave 4,DEPLOY.md 补 HTTPS 与部署自检 2026-08-11 01:10:14 +08:00
sample_data SPECS.md 重写对齐 Wave 4,DEPLOY.md 补 HTTPS 与部署自检 2026-08-11 01:10:14 +08:00
specs 文档同步:场景问卷十问、临港负面清单适用条件 2026-08-10 23:55:31 +08:00
tests 新增黄金测试集与自动化评测,补上准确率的实测证据 2026-08-10 23:47:43 +08:00
.env.example 修复项目内部不一致:统一 AI 厂商为 DeepSeek,清理死依赖 2026-06-30 11:08:50 +08:00
.gitignore 交叉评测草稿移出仓库 2026-08-10 23:48:08 +08:00
AGENTS.md 新增智能体定义与九个技能 2026-08-10 23:47:15 +08:00
ai_recognizer.py AI 复核改为可选旁路,默认不外发原始值 2026-08-10 23:46:53 +08:00
analyzer.py 识别引擎:统一规则实现、校验位过滤、坐标可回溯 2026-08-10 23:46:53 +08:00
app.py 界面:出境场景问卷前置,预览默认掩码,结论展示推导链条 2026-08-10 23:47:15 +08:00
deidentify.py 新增四态脱敏:已脱敏 / 不适用 / 阻断 / 失败 2026-08-10 23:46:53 +08:00
DEPLOY.md SPECS.md 重写对齐 Wave 4,DEPLOY.md 补 HTTPS 与部署自检 2026-08-11 01:10:14 +08:00
generate_sample.py 样本舱单覆盖判别边界 2026-08-10 23:47:43 +08:00
landing.html 文档与落地页对齐 Wave 4 2026-08-10 23:47:43 +08:00
legal_sources.py 新增法规来源库:条款原文、生效日期与官方链接集中登记 2026-08-10 23:46:23 +08:00
README.en.md 新增英文 README 2026-08-10 23:56:53 +08:00
README.md SPECS.md 重写对齐 Wave 4,DEPLOY.md 补 HTTPS 与部署自检 2026-08-11 01:10:14 +08:00
reporter.py 合规报告改为可审计且不含原始值 2026-08-10 23:47:15 +08:00
requirements-dev.txt SPECS.md 重写对齐 Wave 4,DEPLOY.md 补 HTTPS 与部署自检 2026-08-11 01:10:14 +08:00
requirements.txt SPECS.md 重写对齐 Wave 4,DEPLOY.md 补 HTTPS 与部署自检 2026-08-11 01:10:14 +08:00
rules.py 重构合规法理为「数据性质 × 出境路径」双轴模型 2026-08-10 23:46:23 +08:00
SPECS.md SPECS.md 重写对齐 Wave 4,DEPLOY.md 补 HTTPS 与部署自检 2026-08-11 01:10:14 +08:00
verify.py 新增一键复现验证与证据留档 2026-08-10 23:55:31 +08:00

🚢 GuanWuTong — Cross-Border Compliance Gateway for Shipping Manifests

Competition Stage Track

中文版见 README.md

Upload a shipping manifest, get an auditable cross-border transfer assessment — the legal nature of every field, the recommended lawful transfer pathway, and an explicit list of the facts still missing before a conclusion can be reached.

It deliberately will not tell you "yes, you may send this." Whether data may lawfully leave China depends on the exporter's status, cumulative annual transfer volumes, whether regulators have designated the data as important, and which statutory procedures have already been completed. None of that is visible in a manifest. A tool that confidently answers "safe to transfer" manufactures legal risk rather than removing it.


The problem

Shipping lines, freight forwarders and cross-border e-commerce operators send manifests to overseas carriers, destination-port agents and warehouses every day. Those manifests routinely carry data regulated under Chinese law:

  • Consignor / consignee ID numbers, phone numbers, addresses
  • Seafarer passport numbers and names
  • Dangerous goods (IMDG) details, high-value cargo information

Operations staff just want the paperwork out the door. They will not check each field against the Data Security Law, the Personal Information Protection Law (PIPL) and the Provisions on Promoting and Regulating Cross-Border Data Flows. Today the alternatives are manual clause-by-clause review (slow, error-prone) or nothing at all.

GuanWuTong sits at the last mile before data leaves the country and produces a reviewable, replayable compliance assessment.


Agent and skills

Delivered as an Agent + Skills package. The agent contract lives in AGENTS.md; skills live under .agents/skills/:

manifest-ingest              Parsing: multi-sheet · title-row detection · encodings · cell coordinates
        │
        ▼
pii-detection                Field name → value regex → checksum validation
        │
        ├──▶ sensitive-pi-classification   General vs. sensitive personal information (PIPL Art. 28)
        ├──▶ important-data-screening      Important-data leads + designation status (CBDF Art. 2)
        └──▶ export-control-screening      Dangerous goods / dual-use items (IMDG · Export Control Law)
        │
        ▼
deidentification             Four-state masking: masked / not-applicable / blocked / failed
        │
        ▼
transfer-pathway-decision    Data nature × scenario facts → one of eight pathways
        │
        ▼
compliance-report            Auditable report: versions · citations · outstanding facts

ai-semantic-review is an optional side-channel skill, disabled by default. With it off, the entire pipeline runs locally and sends nothing anywhere.


The two-axis model

The previous version collapsed three questions into one chain: field name → core/important/general → block/mask/allow. That chain contained two legal errors: it equated PIPL "sensitive personal information" with Data Security Law "important data", and it treated masking as satisfying transfer requirements.

Axis 1 — Data nature (what this data is, legally)

Tier Legal meaning
General business data Neither personal information nor important data
General personal information PIPL Art. 38 · notification duties apply
Sensitive personal information PIPL Art. 28 · separate consent + impact assessment
Important data (pending verification) Lead detected but not designated by regulators; per CBDF Art. 2 not treated as important data
Important data (designated) Notified or published as such · security assessment required
Core data (designated) DSL Art. 21 · stricter regime

The last two tiers can only be asserted by the user in the scenario questionnaire. The system never infers them. Important-data status is an administrative designation, not a property an algorithm can compute.

Axis 2 — Transfer pathway (which procedure applies)

Exempt (international trade / transport) · Exempt (outside FTZ negative list) · Exempt (statutory PI exemptions) · Complete notification, separate consent and PIA · Standard contract or PI protection certification · Security assessment · Manual compliance review · Explicit prohibition

The pathway is derived from a ten-question scenario questionnaire covering CIIO status, important-data designation, cumulative annual transfer volumes for personal and sensitive personal information, statutory exemptions, FTZ registration and negative-list comparison, separate consent, PIA, and overseas-recipient disclosure.

If any material fact is missing, the conclusion degrades to "insufficient information — manual compliance review required."


Quick start

pip install -r requirements.txt
cp .env.example .env          # optional: DEEPSEEK_API_KEY for semantic review
python generate_sample.py
streamlit run app.py

Open http://localhost:8501, fill in the scenario questionnaire first, then upload sample_data/sample_manifest.xlsx.

Without an API key the system runs in pure local rule mode and transmits nothing to any external service.


Verification

python verify.py                 # eight assertions incl. red-line checks
python tests/run_eval.py         # golden test set: precision / recall / F1
pytest tests/test_regression.py  # regression cases for historical bugs

verify.py runs from dependency checks through to a binary search of the generated PDF for raw sensitive values, exiting non-zero on any failure. Evidence is written to docs/verification-evidence.json so reviewers can re-run it and compare against the committed version. Method: docs/verification.md.

Measured metrics and every false positive / negative: docs/evaluation-report.md. Section 8 of that report is titled "What these numbers do not show" — targets and measurements are stated separately, and the limits of the test set are spelled out.


Why shipping, and why now

On 8 February 2025, the Shanghai Cyberspace Administration, Municipal Data Bureau and Development & Reform Commission, together with the Shanghai Pilot Free Trade Zone and Lin-gang Special Area authorities, jointly issued the Data Export Negative List (2024 edition) for the Shanghai FTZ and Lin-gang Special Area. It covers three sectors: reinsurance, international shipping, and retail/catering/accommodation — 6 scenarios, 84 data items.

Consequences:

  • Operators registered in and conducting transfers within the FTZ / Lin-gang area may transfer data outside the negative list without filing a security assessment, executing standard contractual clauses, or obtaining certification;
  • The regime does not apply to critical information infrastructure operators;
  • Users of this simplified route must file a record within 15 working days with their local Cross-Border Data Service Centre.

Exemption from filing is not exemption from recording, and neither removes the need to judge. GuanWuTong splits these conditions into separate questions, surfaces the recording obligation when the simplified route applies, and falls back honestly to the standard pathway when it does not.

The full negative list and its 84 data items must be obtained from the local Cross-Border Data Service Centre. This system provides an applicability assessment and a recording reminder — it does not replace comparison against the official text. Provenance and verification requirements are annotated in legal_sources.py.


Scope statement

This tool produces compliance risk leads and outstanding facts. It does not constitute legal advice, nor a final determination of whether data may be transferred. Masking is de-identification, not anonymisation within the meaning of PIPL Art. 73; masked data generally remains personal information. Actual transfers should be assessed by the organisation's compliance officer against the specific business context, with professional advice where appropriate.

Do not upload real production manifests to the demo environment.