mirror of
https://github.com/msoedov/agentic_security.git
synced 2026-11-25 19:43:29 +01:00
2.1 KiB
2.1 KiB
Design
This page shows the main parts of Agentic Security and the flow of a scan.
Parts
| Part | Package | Function |
|---|---|---|
| CLI | agentic_security.__main__ |
Starts the server or a scan. |
| Web server | agentic_security.app, agentic_security.routes |
Gives the UI and the scan API. |
| Scanner | agentic_security.lib |
Reads the configuration and shows the results table. |
| HTTP spec | agentic_security.http_spec |
Parses the request template and sends the requests. |
| Probe data | agentic_security.probe_data |
Loads datasets, transforms prompts, makes images and audio. |
| Probe actor | agentic_security.probe_actor |
Sends the prompts and scores the responses. |
| Detectors | agentic_security.refusal_classifier |
Find refusals and leaks in the responses. |
| Agent harness | agentic_security_harness |
Runs a scan step by step for an agent or for CI. |
Scan flow
- The CLI or the web server gets the HTTP spec and the list of datasets.
LLMSpec.from_stringparses the HTTP spec.prepare_promptsloads the selected datasets and adds the transformed datasets.scan_routerselects the single-shot scan or the many-shot scan.- For each prompt, the fuzzer puts the prompt in the spec and sends the request.
- The detectors examine the response. The fuzzer counts the prompt as a failure if a detector finds a refusal. A request error or a response that is not JSON is also a failure.
- The fuzzer sends the failure rate of each module as a JSON line. The failure rate is the failures divided by the prompts sent.
- At the end, the fuzzer writes
failures.csvandfull_scan_log.csv. - The CLI shows a table. A module with a failure rate above
max_thhas the status FAIL.
Extension points
| To add | Refer to |
|---|---|
| Prompts from a CSV file | Dataset extension |
| A dataset in the registry | Dataset extension |
| A prompt generator | External modules |
| A detector | Refusal classifier plugins |
| A harness source or converter | Agent harness |