Skip to main content

Map and govern where your AI data and traffic flow — east-west / APAC lens.

Project description

borderlint

Map and govern where your AI data and traffic flow — east-west / APAC lens.

A static, in-CI check for HK / GBA entities: does your AI data stay within the jurisdictions your PDPO / PIPL policy allows? borderlint statically scans your repo (Python and TypeScript/JavaScript) for AI provider usage, resolves each flow to a jurisdiction (ccTLD codes plus the CN-GBA / GBA tokens), and fails the build on any flow outside the allow-list for the data class you declare. Western and Chinese providers are treated evenly. Zero runtime dependencies.

Use

python -m borderlint scan ./service --policy residency.json --classification customer-pii
  • No --policyinventory mode (lists flows + jurisdictions, exits 0).
  • --format json|mermaid for machine output or a flow map.
  • Exit code is non-zero on a violation, so it gates CI.

Policy (the eval-set)

residency.json maps each data class to the jurisdictions you accept:

{
  "home_regime": "pdpo",
  "classifications": {
    "customer-pii": ["hk", "CN-GBA", "sg"],
    "employee-pii": ["hk", "CN-GBA"],
    "non-pii":      ["hk", "CN-GBA", "cn", "mo", "sg", "us", "gb"]
  }
}

Deny-by-default: a flow to any code not on the list for the declared class fails — so sg is allowed but my is not, matching a PDPO agreed-locations EULA. GBA is shorthand for hk + CN-GBA. Cross-border arrangements (e.g. the GBA Standard Contract) are surfaced as reference links, never adjudicated.

Capabilities

  • Languages: Python (AST) and TypeScript/JavaScript (import / require / dynamic import()), plus endpoint references in config/text files.
  • Providers: 13+ across the east-west boundary (OpenAI, Anthropic, Google, Azure, Bedrock, Mistral, Cohere + Tencent, Alibaba, DeepSeek, Moonshot, Zhipu, Baidu), with Python and JS/TS package names and the Vercel AI SDK (@ai-sdk/*).
  • Aggregators: litellm, langchain, LlamaIndex, aisuite, Vercel AI core (ai) → unknown (runtime-routed), so on_unknown: fail blocks them for sensitive classes.
  • Jurisdictions: ccTLD/ISO codes + CN-GBA / GBA; AWS/Azure region resolved from the endpoint host where present (e.g. bedrock-runtime.ap-east-1…hk).
  • Policy: classification-keyed JSON eval-set, deny-by-default, provider allow/deny, configurable failure set, declared home regime.
  • Output & CI: text / JSON / Mermaid, exit codes, GitHub Action + Jenkins.

Scope

For HK / GBA home bases under PDPO / PIPL / GBA. Not yet: SARIF output, container/SCA mode, LLM enrichment, and dynamic / base_url endpoint resolution. Full roadmap in CAPABILITIES.md.

CI

Same command in any pipeline. GitHub Actions (composite action):

- uses: iolairus/borderlint@v0.2.0
  with: { path: ., policy: residency.json, classification: customer-pii }

Jenkins / anything else: pip install borderlint && borderlint scan . --policy residency.json --classification customer-pii — a non-zero exit fails the stage. Full examples in examples/ci/.

License

MIT © 2026 Iolaire McKinnon. Vendor-neutral by design.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

borderlint-0.3.0.tar.gz (74.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

borderlint-0.3.0-py3-none-any.whl (13.1 kB view details)

Uploaded Python 3

File details

Details for the file borderlint-0.3.0.tar.gz.

File metadata

  • Download URL: borderlint-0.3.0.tar.gz
  • Upload date:
  • Size: 74.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for borderlint-0.3.0.tar.gz
Algorithm Hash digest
SHA256 03c1c1bca92d317d63ad6fc9c8eaaf6b9dc88fa55e27d4b83f3d002ec243df39
MD5 42c4d5e1248e3de3643c5b2d02e34f58
BLAKE2b-256 ab5685f60b4048459138c0845debe5bd94a4fb7ea1516b1a985c51668e7ca23f

See more details on using hashes here.

Provenance

The following attestation bundles were made for borderlint-0.3.0.tar.gz:

Publisher: release.yml on iolairus/borderlint

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file borderlint-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: borderlint-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 13.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for borderlint-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d9cafa589f732990adb8e1b99980cef52560c1cc6c6c499fa98ae599b9da7bb1
MD5 3c9f5d8c5acd43d9a42c0a1e5c5912d1
BLAKE2b-256 36017fb3f49bee8d76cd83a411fd982fe075c0170220838f6c7f405a321bdf06

See more details on using hashes here.

Provenance

The following attestation bundles were made for borderlint-0.3.0-py3-none-any.whl:

Publisher: release.yml on iolairus/borderlint

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page