Metadata-Version: 2.4
Name: b4n1-audit
Version: 0.1.3
Summary: B4N1 Audit SDK for Python — security & code quality scanner with bundled binary
Author-email: Bani Montoya <banimontoya@gmail.com>
License-Expression: BUSL-1.1
Project-URL: Homepage, https://b4n1.com
Project-URL: Repository, https://github.com/B4N1-com/b4n1-audit
Keywords: security,audit,scanner,sarif,static-analysis,ai
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Security
Requires-Python: >=3.8
Description-Content-Type: text/markdown

<p align="center">
  <img src="https://cdn.jsdelivr.net/npm/b4n1-audit@0.1.3/b4n1_audit_presentation.png" alt="B4N1 Audit — security and code-quality scanner" width="100%" />
</p>

# b4n1-audit — Python SDK

[![PyPI](https://img.shields.io/pypi/v/b4n1-audit.svg)](https://pypi.org/project/b4n1-audit/)
[![Python](https://img.shields.io/pypi/pyversions/b4n1-audit.svg)](https://pypi.org/project/b4n1-audit/)
[![Downloads](https://img.shields.io/pepy/dt/b4n1-audit.svg)](https://pypi.org/project/b4n1-audit/)
[![License](https://img.shields.io/badge/license-BUSL--1.1-blue.svg)](LICENSE)

Python wrapper for the `b4n1-audit` engine — a security and code-quality
scanner that ships as a single precompiled binary. The binary is bundled per
platform inside the wheel; there is nothing to compile and no external runtime.

## Install

```bash
pip install b4n1-audit
```

Requires Python ≥ 3.8. Precompiled binary included (Linux x64/arm64, Windows x64).

## Quick start

```python
from b4n1audit import run, binary_path, AuditError

print(binary_path())          # resolved binary path (fails loud if none)
report = run("json", ".")     # dict/list parsed from JSON output
sarif  = run("sarif", ".")    # SARIF document as text
```

`run()` raises `AuditError` (with the binary's stderr) when the process exits
non-zero. Binary resolution order: `B4N1_AUDIT_BIN` → bundled binary → `PATH`.

## What it scans

The SDK exposes the full engine surface, for example:

| Verb | Purpose |
|------|---------|
| `scan` / `json` | Directory scan, JSON report |
| `sarif` | SARIF output for CI integration |
| `cve-check` | Dependency CVE check against an embedded database |
| `secrets` | API keys / tokens in files and history |
| `scan-ai` | Prompt injection, MCP and repo-poisoning checks |
| `memory` | Memory-safety issues (leaks, UB, overflows) |
| `semgrep` | Fast-path rule engine |
| `report` | Self-contained HTML report |

```bash
# via the bundled binary directly
python -c "from b4n1audit import binary_path; import sys; print(binary_path())"
$(python -c "from b4n1audit import binary_path; print(binary_path())") scan .
```

## License

Distributed under the Business Source License 1.1 (BUSL-1.1) plus an EULA for
the bundled binary. Source code is proprietary.
