borderlint

Map where your AI data goes, check who can compel its disclosure, and identify whose model weights you use.
borderlint scans code without running it. It checks three separate facts about each AI data flow:
- Residency: where the data goes.
- Sovereignty: which government's laws may compel the provider to disclose the data.
- Provenance: who developed the model weights.
It supports Python, TypeScript/JavaScript, Java/Kotlin, C#, configuration files, and Model Context
Protocol (MCP) server configurations. It has no runtime dependencies. Its strongest support is for
Hong Kong and the Greater Bay Area (GBA), with additional home locations across APAC and EMEA.
Western and Chinese providers receive the same checks.
Quick start
Install borderlint, list the AI data flows in your repository, create a policy, then check your code
against that policy:
pip install borderlint
borderlint scan . # List flows and jurisdictions; no policy needed.
borderlint init . # Answer a short interview to create residency.json.
borderlint scan . --policy residency.json --classification customer-pii
A policy violation looks like this. Add --explain to include the arrow lines:
borderlint — AI data-flow & residency report
==============================================
[FAIL] DeepSeek -> Mainland China | sovereignty: Mainland China | weights: Mainland China
app.py:2 (endpoint_reference: api.deepseek.com)
! jurisdiction outside the allow-list for this data class
→ DeepSeek resolves to Mainland China, which is not allowed for this data class.
Update the policy allow-list or change the provider/endpoint.
Regimes implicated: PIPL
Reference: PIPL cross-border transfer — Mainland China cross-border PI: CAC security assessment, …
Summary: 1 fail, 0 warn, 0 waived, 0 ok
Without --policy, borderlint runs in inventory mode and exits zero. With a policy, it exits
non-zero when it finds a violation in text, JSON, Mermaid, or SARIF format. Your CI system then
fails the job.
Export formats always exit zero so you can save evidence even after a violation.
Understand the three checks
A flow can have a different answer for each check:
- Residency — where the data rests. borderlint maps the flow to a jurisdiction. A destination
outside your data class's allow-list violates the policy.
- Sovereignty — which government may compel disclosure. A US-headquartered provider remains
under US law, including the CLOUD Act, even when you choose an endpoint outside the US.
- Provenance — whose model weights run. borderlint maps the model to its developer's bloc.
For example, AWS Bedrock in ap-east-1 serving DeepSeek-R1 has residency hk, sovereignty us,
and provenance cn. Self-hosted Qwen has residency local, sovereignty local, and provenance
cn.
Declare a home location to add relevant legal context. borderlint supports Hong Kong, Macao,
Mainland China and the Mainland GBA cities, Japan, Korea, Singapore, Australia, the UK, the EU,
and Malaysia. Reports name relevant data-protection regimes and link to cross-border references.
These details never change the verdict. GDPR is always a transfer reference, never a regime tag.
Browse the knowledge-base website for 142 providers,
model developers, curated data practices, and legal references.
Scan commands and options
python -m borderlint scan ./service --policy residency.json --classification customer-pii