Metadata-Version: 2.4
Name: aiguard-py
Version: 0.5.0
Summary: AI驱动的Python代码安全审计工具
Home-page: https://github.com/你的用户名/aiguard
Author: 你的名字
Author-email: 烽桐数字 <15393612830@139.com>
License: MIT
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: openai>=1.0.0
Dynamic: author
Dynamic: home-page
Dynamic: license-file
Dynamic: requires-python

# aiguard-py

> 一行命令安装，一行命令审计 Python 代码安全漏洞

AI 驱动的代码审计工具，识别 **SQL注入、命令注入、硬编码密码** 等常见漏洞，每条带 **CWE 编号** 和 **可执行的修复代码示例**。

[![PyPI version](https://img.shields.io/pypi/v/aiguard-py.svg)](https://pypi.org/project/aiguard-py/)
[![Python versions](https://img.shields.io/pypi/pyversions/aiguard-py.svg)](https://pypi.org/project/aiguard-py/)
[![License](https://img.shields.io/github/license/2646722482/aiguard-py.svg)](https://github.com/2646722482/aiguard-py/blob/main/LICENSE)

---

## 🚀 快速开始

```bash
# 1. 安装
pip install aiguard-py

# 2. 审计单个文件
aiguard test.py

# 3. 批量扫描整个项目
aiguard ./src

# 4. 生成 HTML 报告
aiguard test.py --output report.html
```

**输出示例：**

```
[高危] SQL注入 - 第20行
  CWE: CWE-89
  问题: 使用 f-string 拼接 SQL 查询，攻击者可注入恶意代码
  修复建议: 使用参数化查询
  ---
  错误写法: cursor.execute(f"SELECT * FROM users WHERE name = '{name}'")
  正确写法: cursor.execute("SELECT * FROM users WHERE name = ?", (name,))

[高危] 命令注入 - 第7行
  CWE: CWE-78
  问题: os.system() 直接拼接用户输入
  修复建议: 使用 subprocess.run() 传递参数列表
  ---
  错误写法: os.system("rm -rf " + filename)
  正确写法: subprocess.run(["rm", "-rf", filename])
```
