Skip to main content

DataTrust AI

A local-first DevSecOps CLI for detecting and auto-remediating Secrets, PII, SAST vulnerabilities, and IaC misconfigurations.

PyPI version Python Tests License: MIT


Table of Contents


Core Features

DataTrust AI is designed to run instantly in your local environment without sending your code to the cloud.

  • Secret & PII Detection: Detects AWS, OpenAI, and GitHub tokens using Shannon Entropy. Supports regional PII (Nepal/India) and handles Devanagari digits.
  • SAST (Static Analysis): Parses Python AST to detect SQL Injection risks, weak cryptography (e.g., MD5), and dangerous function calls (eval, exec).
  • Infrastructure as Code (IaC): Scans Dockerfile for root users/hardcoded secrets and Kubernetes YAMLs for privileged: true.
  • Dependency Scanning (SCA): Checks requirements.txt against the OSV database for known CVEs.
  • Auto-Remediation: Automatically moves exposed secrets to .env, changes Docker USER root to USER nonroot, and fixes K8s YAML misconfigurations.
  • Blazing Fast: Uses multi-processing and MD5 SQLite caching to only scan modified files.
  • Extensible: Write custom detection rules using the local plugin system.

Installation

pip install datatrust-privacy-guard

Quick Start

  1. 0. Interactive Menu (Easiest): Just type dt (or datatrust) and press Enter. A beautiful interactive menu will guide you through all the features.
dt
  1. Scan a text prompt (e.g., before pasting into ChatGPT):
datatrust "My Aadhaar is 2345 6789 0123 and my OpenAI key is sk-abc123..."
  1. Scan your entire repository:
datatrust -d .
  1. Scan and Auto-Fix vulnerabilities:
datatrust -d . --fix

(This moves secrets to .env and patches Docker/K8s files automatically).


Advanced Usage

  1. Setup FAANG-Level Automation

Create local Git pre-commit hooks and GitHub Actions workflows in one command. DataTrust will automatically block commits if secrets are detected.

datatrust --automate
  1. Dependency & License Scans
datatrust --sca            # Scan for CVEs
datatrust --license-check  # Check for restrictive licenses (GPL, AGPL)
  1. Local Web Dashboard

Generate a beautiful HTML report and serve it locally.

datatrust -d . --serve
  1. Writing Custom Plugins

Create a folder named datatrust_plugins in your project root. Add a Python file (e.g., my_rule.py):

def scan_line(line):
    if "company_secret_token_" in line:
        return [{"type": "Company Internal Token", "severity": "HIGH", "value": line}]
    return []

DataTrust will automatically load this rule on the next run.


CI/CD Integration

DataTrust AI is designed for pipelines. It exits with code 1 if high-severity issues are found.

GitHub Actions Format:

datatrust -d . --gh-actions

SARIF Output (For GitHub Advanced Security):

datatrust -d . --sarif

Configuration

Generate a default config file:

datatrust --init

Edit datatrust.yml to ignore specific paths or rules:

ignore_paths:
  - tests/
  - docs/
ignore_types:
  - EMAIL
  - IPV4

You can also add # datatrust:ignore to the end of any line to skip scanning that specific line.


Architecture

DataTrust AI is built with zero heavy dependencies (no PyTorch, no Transformers). It relies on:

· Python ast module: For structural code analysis (SAST). · Shannon Entropy: For mathematical detection of random strings/secrets. · SQLite: For local caching and historical scan tracking. · Multiprocessing: For parallel file scanning.


Contributing

Contributions are highly encouraged. Whether it's adding new PII regex patterns, improving SAST rules, or fixing bugs.

  1. Fork the repository.
  2. Create your feature branch (git checkout -b feature/AmazingFeature).
  3. Run tests (python -m unittest discover tests).
  4. Commit your changes.
  5. Open a Pull Request.

Metadata

Release files for datatrust-privacy-guard 2.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for datatrust-privacy-guard 2.4.0
File Size Uploaded Provenance
datatrust_privacy_guard-2.4.0.tar.gz 19.4 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for datatrust-privacy-guard 2.4.0
File Interpreter ABI Platform
datatrust_privacy_guard-2.4.0-py3-none-any.whl Python 3 none any Details

Total release size: 40.7 kB

Release files / datatrust_privacy_guard-2.4.0.tar.gz

Download URL datatrust_privacy_guard-2.4.0.tar.gz
Size 19.4 kB
Tags Source
SHA-256 checksum
How to use checksums
1df3836459f39b5e9a242f98760535aa011392ede7da6a95e3b2a736436e9181
BLAKE2b-256 checksum
How to use checksums
555335de784d1f1a36439dcc38ee8615fa6eebb6bcb06db3790fc36f195e6e34
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.34.2

Release files / datatrust_privacy_guard-2.4.0-py3-none-any.whl

Download URL datatrust_privacy_guard-2.4.0-py3-none-any.whl
Size 21.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
45373cdebdb7a582c8844c77b764128e1d6edf9a9536dc2c83a14fa6dea99cf2
BLAKE2b-256 checksum
How to use checksums
38b23943ccd53dbeaa1a1ce352f628c65b058ba9c2b39ce6a310be8fee23eb45
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.34.2

Security for datatrust-privacy-guard 2.4.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page