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.
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
Instant Integration (Recommended)
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.
Links
- NTI Specification: https://abisheakp197.github.io/nti-spec/
- GitHub Repository: https://github.com/abisheakp197/nti-scanner
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.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| nti_scanner-0.2.1.tar.gz | 31.9 kB | With provenance | Details for nti_scanner-0.2.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| nti_scanner-0.2.1-py3-none-any.whl | Python 3 | none | any | Details for nti_scanner-0.2.1-py3-none-any.whl |
Total release size: 77.4 kB
Release files / nti_scanner-0.2.1.tar.gz
| Download URL | nti_scanner-0.2.1.tar.gz |
|---|---|
| Size | 31.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
68c258f734ea2463ae2097e8deaee42dfb574118829acc2095d395d05762d46d
|
|
BLAKE2b-256 checksum How to use checksums |
6a106eb712995bb312b4e3dcc49e3b045116b547d12001aa4264ca3fdac590fc
|
| 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 logRelease files / nti_scanner-0.2.1-py3-none-any.whl
| Download URL | nti_scanner-0.2.1-py3-none-any.whl |
|---|---|
| Size | 45.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b321525446788eb5a8c83412d51458a325e5be7ef64e4029b3bd7588908cfa87
|
|
BLAKE2b-256 checksum How to use checksums |
bc9c8ee4695f108ef555cc63ebf74920d71b82f00eb04cdbf36b00544b39f00b
|
| 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 logSecurity for nti-scanner 0.2.1
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.
Attestation for nti_scanner-0.2.1.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 logA 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.