Skip to main content

NTI Verified

nti-scanner

Professional SAST engine for AI agent compliance and security. AST-based analysis, taint tracking, CWE mapping, and SARIF output for CI/CD pipelines.

License Python Version


Features

  • AST Analysis Engine: Analyzes Python codebases without executing untrusted code.
  • 19 Security & NTI-1 Compliance Rules: NTI-1 compliance pillars plus OWASP AI Agent Security risks.
  • CWE Mapping & SARIF 2.1.0: Generates GitHub Security tab compatible SARIF reports.
  • Framework Detection: Auto-detects LangChain, CrewAI, AutoGen, OpenAI, Anthropic frameworks.
  • MCP & A2A Security Rules: First SAST engine with dedicated MCP protocol and Agent-to-Agent security rules.
  • Post-Quantum Cryptography (PQC) Readiness: Scans for classical asymmetric crypto vulnerable to quantum attack.
  • Agent Behavior Graph: Builds and exports structural behavior graphs of agents and tool sinks.

Installation

pip install nti-scanner

The 1-Command Auto-Patcher

Secure your repository in one command. This will automatically generate the NTI workflow, inject the required dependencies, add the compliance badge, and insert the runtime guardrails.

pip install nti-scanner
nti-scanner --fix

Usage

1. Scan a Codebase

# Terminal output
nti-scanner scan ./my-agent-project

# SARIF output for GitHub Security tab
nti-scanner scan ./my-agent-project --format sarif --output report.sarif

# JSON report
nti-scanner scan ./my-agent-project --format json --output report.json

# HTML report
nti-scanner scan ./my-agent-project --format html --output report.html

# Enforce minimum compliance score in CI/CD
nti-scanner scan . --min-score 80

2. List All Rules

nti-scanner rules

3. Generate Behavior Graph

nti-scanner graph ./my-agent-project --output graph.json

Supported Rules (19 Rules)

Findings are reported in two tiers:

  • Vulnerability — an exploitable defect with a CWE class. Counted in the critical/high/medium/low totals and penalised per distinct rule.
  • Compliance gap — a control the codebase does not implement. Reported once per repository, with an occurrence count, and it lowers the NTI-1 pillar score without inflating the vulnerability totals.

Findings under tests/, examples/, docs/, and fixtures/ are reported but excluded from the score, the same way dependency scanners separate dev and production scope.

Vulnerabilities

Rule ID Category Severity CWE Description
SEC-PROMPT-001 Security High CWE-1336 Untrusted input interpolated into a prompt or tool call
SEC-CMD-001 Security Critical CWE-78 Command injection via os.system / subprocess shell=True
SEC-PATH-001 Security High CWE-22 Path traversal in file operations
SEC-SSRF-001 Security High CWE-918 SSRF via dynamic URLs in HTTP requests
SEC-SQL-001 Security Critical CWE-89 SQL assembled by interpolating values, then executed
SEC-SECRET-001 Security Critical CWE-798 Hardcoded credential-like strings
SEC-DESER-001 Security Critical CWE-502 Unsafe deserialization (pickle, yaml.load)
SEC-CAP-001 Security High CWE-269 Agent tool with destructive capability
SEC-LLM-001 Security High CWE-1426 LLM output passed to eval() or exec()
SEC-MCP-001 Security High CWE-287 MCP integration without authentication
SEC-A2A-001 Security High CWE-287 Agent-to-Agent protocol missing identity verification
NTI-TRUST-001 Security High CWE-1426 Trust boundary crossing without verification

Compliance gaps

Rule ID Pillar Description
NTI-IDENT-001 Identity Agent entry point with no cryptographic identity binding
NTI-PQC-001 Identity Classical (quantum-vulnerable) cryptography in use
NTI-GOV-001 Governance Tools without explicit per-call capability grants
NTI-CAPDIFF-001 Governance Tool declared but never capability-granted
NTI-CONS-001 Consensus Multi-agent system without a consensus step
NTI-AUDIT-001 Audit No tamper-evident audit trail
NTI-PERS-001 Persistence State persisted without integrity verification

Python API Usage

from pathlib import Path
from nti_scanner.scanner import scan_directory

result = scan_directory(Path("./my-agent-project"))
print(f"Compliance Score: {result.nti1_score}/100")
print(f"Frameworks: {result.frameworks}")
for finding in result.findings:
    print(f"[{finding.severity.upper()}] {finding.rule_id}: {finding.message} ({finding.file}:{finding.line})")

License

Apache License 2.0. See LICENSE.


Architecture

graph TD
    subgraph CLI_Input ["CLI & Input"]
        CLI["CLI Entrypoint<br/>(nti-scanner scan / --fix)"]
        TargetDir["Target Directory / File"]
        FileDiscovery["File Discovery & Filter<br/>(*.py Files)"]

        CLI --> TargetDir
        TargetDir --> FileDiscovery
    end

    subgraph Scanner_Core ["Scanner Core"]
        ASTParser["AST Parser<br/>(ast.parse)"]
        FrameworkDetector["Framework Detector<br/>(LangChain, CrewAI, AutoGen, etc.)"]
        TaintTracking["Taint Tracking & Call Graph"]
        RuleEngine["Rule Engine<br/>(19 Security & NTI Rules)"]
        CWEMapping["CWE Mapping"]

        FileDiscovery --> ASTParser
        ASTParser --> FrameworkDetector
        ASTParser --> TaintTracking
        ASTParser --> RuleEngine
        FrameworkDetector --> RuleEngine
        TaintTracking --> RuleEngine
        RuleEngine --> CWEMapping
    end

    subgraph Auto_Patcher ["Auto-Patcher Engine"]
        FixerModule["Fixer Module<br/>(nti_scanner.fixer)"]
        ModReadme["Modifies README.md<br/>(Compliance Badge)"]
        ModDeps["Modifies Requirements / pyproject.toml<br/>(ube-foundation)"]
        ModWorkflows["Modifies GitHub Workflows<br/>(nti-scan.yml)"]
        ModGuardrails["Injects Python Guardrails<br/>(NTICallbackHandler)"]

        CLI -- "--fix" --> FixerModule
        FixerModule --> ModReadme
        FixerModule --> ModDeps
        FixerModule --> ModWorkflows
        FixerModule --> ModGuardrails
    end

    subgraph Reporting_Engine ["Reporting Engine"]
        CWEMapping --> Findings["Findings Aggregator"]
        Findings --> ScoringLogic["Compliance Scoring Logic<br/>(NTI-1 Score & Pillar Scores)"]
        ScoringLogic --> SARIFGen["SARIF 2.1.0 Generator"]
        ScoringLogic --> OtherReports["JSON / HTML / Terminal Reporters"]
        SARIFGen --> Output["CI/CD & Report Output"]
        OtherReports --> Output
    end

Metadata

Release files for nti-scanner 0.2.2

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

Source distribution (sdist)

Source distribution for nti-scanner 0.2.2
File Size Uploaded Provenance Actions
nti_scanner-0.2.2.tar.gz 32.1 kB With provenance Details for nti_scanner-0.2.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for nti-scanner 0.2.2
File Interpreter ABI Platform Actions
nti_scanner-0.2.2-py3-none-any.whl Python 3 none any Details for nti_scanner-0.2.2-py3-none-any.whl

Total release size: 77.8 kB

Release files / nti_scanner-0.2.2.tar.gz

Download URL nti_scanner-0.2.2.tar.gz
Size 32.1 kB
Tags Source
SHA-256 checksum
How to use checksums
42d13657f576a6e93739a8a25cacf8f9e94ac5c9892fac5c17c6d47e7d24339b
BLAKE2b-256 checksum
How to use checksums
7a2c0eef21f3cf74dd357023a302f41d5bb8763c13e19815a30ba24933cde5e0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 23, 2026.

Transparency log

Release files / nti_scanner-0.2.2-py3-none-any.whl

Download URL nti_scanner-0.2.2-py3-none-any.whl
Size 45.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2f63d0b2d26ee0ae8c291b136696fb22fe6664ccb602fe745af9c2f5b71ceedc
BLAKE2b-256 checksum
How to use checksums
754d7b456e44823c2ed28ea70c49e49bbbf066d9dc983cee93f7adcb4ad505a0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 23, 2026.

Transparency log

Security for nti-scanner 0.2.2

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for nti_scanner-0.2.2.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 23, 2026.

Transparency log

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.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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