# AI agent 与扫描器

> PentAGI 等自主 agent 与 DAST 或漏洞扫描器的区别，以及如何将二者结合使用。

漏洞扫描器和 AI [pentest](https://pentagi.com/zh-cn/docs/glossary/#pentest) [agent](https://pentagi.com/zh-cn/docs/glossary/#agent) 都会寻找弱点，但它们的工作方式不同。DAST 扫描器针对正在运行的应用程序执行一组固定的检查。agent 则根据目标规划测试，并根据迄今为止的发现选择每一步。

|         | 扫描器的做法            | AI agent 的做法                                                               |
| ------- | ----------------- | -------------------------------------------------------------------------- |
| 如何选择下一步 | 遵循固定的检查列表和爬虫      | 遵循其计划，并在每个 [subtask](https://pentagi.com/zh-cn/docs/glossary/#subtask) 之后进行修订                       |
| 可以触及的范围 | 爬虫发现的页面和请求        | [task](https://pentagi.com/zh-cn/docs/glossary/#task) 指定的任何内容：主机、服务、Web 应用程序、API                    |
| 使用什么工具  | 自身的引擎             | [sandbox](https://pentagi.com/zh-cn/docs/glossary/#sandbox) 中的 20 多种安全工具、web search 以及 agents 编写的代码 |
| 报告内容    | 与已知模式的匹配项，每项都需要分类 | 包含导致结果的操作步骤，并汇总在 [report](https://pentagi.com/zh-cn/docs/glossary/#report) 中                        |
| 运行是否可重复 | 相同的检查产生相同的结果      | 同一 task 的两次运行结果可能不同                                                        |
| 耗时和成本   | 几分钟，无模型成本         | 运行时间更长，会消耗 model tokens 或 GPU 时间                                           |

## [何时使用哪种工具](https://pentagi.com/zh-cn/docs/concepts/agents-and-scanners/#when-to-use-which)

* 扫描器提供广泛且可重复的覆盖范围：在每次发布时或在 CI 中按计划运行，以便尽早发现已知问题。
* agent 提供深度：它检查单独的弱点是否组合成进入系统的真实路径，跟进扫描器标记的内容，并测试爬虫无法触及的服务。

两者配合使用效果很好。PentAGI 可以从其 sandbox 运行扫描工具并调查其报告的内容，您也可以将扫描器的 report 上传到 [flow](https://pentagi.com/zh-cn/docs/glossary/#flow)，并要求 agents 检查其 [findings](https://pentagi.com/zh-cn/docs/glossary/#finding)。

## [agent 需要您提供什么](https://pentagi.com/zh-cn/docs/concepts/agents-and-scanners/#what-an-agent-needs-from-you)

* 测试对象、目标和范围，写入 task 中 — 请参阅 [自主渗透测试](https://pentagi.com/zh-cn/docs/concepts/autonomous-pentesting/#where-you-stay-in-control)。
* 为主力 agents 选择强大的模型 — 请参阅 [选择模型](https://pentagi.com/zh-cn/docs/configuration/llm-providers/#choosing-models)。
* 对范围内每个目标的测试授权。