> ## Documentation Index
> Fetch the complete documentation index at: https://docs.valiqor.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Security Models

> Data models for security audit results, red team simulations, batches, vulnerabilities, and attack vectors.

### `SecurityAuditResult`

Result of a security audit.

| Field                  | Type                   | Description                         |
| ---------------------- | ---------------------- | ----------------------------------- |
| `audit_id`             | `str`                  | Audit identifier.                   |
| `total_items`          | `int`                  | Total conversations analyzed.       |
| `safe_count`           | `int`                  | Number of safe items.               |
| `unsafe_count`         | `int`                  | Number of unsafe items.             |
| `safety_score`         | `float`                | Overall safety score (0.0–1.0).     |
| `triggered_categories` | `Dict[str, int]`       | Category → count of violations.     |
| `top_risk_category`    | `Optional[str]`        | Most frequently triggered category. |
| `details`              | `List[Dict[str, Any]]` | Per-item audit details.             |

**Property:** `overall_safety_score` — alias for `safety_score`.

**Alias:** `SecurityEvaluationResult = SecurityAuditResult` (backward compatibility).

### `RedTeamResult`

Result of a red team simulation.

| Field                  | Type            | Description                                     |
| ---------------------- | --------------- | ----------------------------------------------- |
| `run_id`               | `str`           | Run identifier.                                 |
| `project_id`           | `str`           | Project ID.                                     |
| `name`                 | `str`           | Run name.                                       |
| `status`               | `str`           | Run status.                                     |
| `total_attacks`        | `int`           | Total attacks generated.                        |
| `successful_attacks`   | `int`           | Attacks that bypassed defenses.                 |
| `success_rate`         | `float`         | Attack success rate (0.0–1.0).                  |
| `distinct_vulns_count` | `int`           | Number of distinct vulnerabilities found.       |
| `top_vulnerability`    | `Optional[str]` | Most exploited vulnerability.                   |
| `target_url`           | `Optional[str]` | Target endpoint URL (if URL mode was used).     |
| `target_prompt`        | `Optional[str]` | Target system prompt (if prompt mode was used). |
| `started_at`           | `Optional[str]` | ISO timestamp.                                  |

**Property:** `attack_success_rate` — alias for `success_rate`.

### `SecurityJobHandle`

Wraps an async security job with polling and result retrieval. Same interface as [JobHandle](/sdk/models/evaluation#jobhandle).

| Property/Method                             | Return Type                              | Description                  |
| ------------------------------------------- | ---------------------------------------- | ---------------------------- |
| `job_id`                                    | `str`                                    | Job identifier.              |
| `job_type`                                  | `str`                                    | `"security"` or `"redteam"`. |
| `status()`                                  | `SecurityJobStatus`                      | Current job status.          |
| `is_running()`                              | `bool`                                   | Whether still running.       |
| `is_completed()`                            | `bool`                                   | Whether completed.           |
| `cancel()`                                  | `Dict[str, Any]`                         | Cancel the job.              |
| `result()`                                  | `SecurityAuditResult` or `RedTeamResult` | Block and return result.     |
| `wait(poll_interval, timeout, on_progress)` | `SecurityJobStatus`                      | Poll with progress.          |

### `SecurityJobStatus`

| Field              | Type    | Description                                                        |
| ------------------ | ------- | ------------------------------------------------------------------ |
| `job_id`           | `str`   | Job identifier.                                                    |
| `job_type`         | `str`   | `"security"` or `"redteam"`.                                       |
| `status`           | `str`   | `"queued"`, `"running"`, `"completed"`, `"failed"`, `"cancelled"`. |
| `progress_percent` | `float` | Progress (0–100).                                                  |
| `current_item`     | `int`   | Current item.                                                      |
| `total_items`      | `int`   | Total items.                                                       |

**Properties:** `is_running`, `is_completed`, `is_failed`.

### `AuditBatch`

Summary of an audit batch.

| Field               | Type            | Description            |
| ------------------- | --------------- | ---------------------- |
| `id`                | `str`           | Batch identifier.      |
| `project_id`        | `str`           | Project ID.            |
| `batch_name`        | `Optional[str]` | Batch name.            |
| `status`            | `str`           | Batch status.          |
| `total_items`       | `int`           | Total items.           |
| `unsafe_items`      | `int`           | Unsafe items.          |
| `unsafe_rate`       | `float`         | Unsafe rate (0.0–1.0). |
| `top_risk_category` | `Optional[str]` | Top risk category.     |
| `created_at`        | `Optional[str]` | ISO timestamp.         |

**Property:** `safety_score -> float` — computed as `1.0 - unsafe_rate`.

### `AuditBatchItem`

A single item from an audit batch.

| Field                      | Type            | Description                                        |
| -------------------------- | --------------- | -------------------------------------------------- |
| `id`                       | `str`           | Item identifier.                                   |
| `batch_id`                 | `str`           | Parent batch ID.                                   |
| `user_input`               | `str`           | User message.                                      |
| `assistant_response`       | `str`           | Assistant response.                                |
| `is_safe`                  | `bool`          | Safety determination.                              |
| `triggered_categories`     | `List[str]`     | Triggered category keys.                           |
| `risk_score`               | `float`         | Risk score (0.0–1.0).                              |
| `explanation`              | `Optional[str]` | Safety explanation.                                |
| `input_safety_categories`  | `List[str]`     | Safety categories triggered by user input.         |
| `output_safety_categories` | `List[str]`     | Safety categories triggered by assistant response. |

### `AuditBatchItemsPage`

Paginated `AuditBatchItem` list. Supports `len()` and iteration.

### `RedTeamRun`

| Field                  | Type            | Description               |
| ---------------------- | --------------- | ------------------------- |
| `id`                   | `str`           | Run identifier.           |
| `project_id`           | `str`           | Project ID.               |
| `name`                 | `str`           | Run name.                 |
| `status`               | `str`           | Status.                   |
| `total_attacks`        | `int`           | Total attacks.            |
| `successful_attacks`   | `int`           | Successful attacks.       |
| `success_rate`         | `float`         | Success rate.             |
| `distinct_vulns_count` | `int`           | Distinct vulnerabilities. |
| `top_vulnerability`    | `Optional[str]` | Top vulnerability.        |
| `target_url`           | `Optional[str]` | Target endpoint URL.      |
| `target_prompt`        | `Optional[str]` | Target system prompt.     |

### `RedTeamAttack`

| Field           | Type            | Description                           |
| --------------- | --------------- | ------------------------------------- |
| `id`            | `str`           | Attack identifier.                    |
| `run_id`        | `str`           | Parent run ID.                        |
| `attack_vector` | `str`           | Attack vector used.                   |
| `prompt`        | `str`           | Attack prompt.                        |
| `response`      | `str`           | Target response.                      |
| `succeeded`     | `bool`          | Whether the attack bypassed defenses. |
| `vulnerability` | `Optional[str]` | Vulnerability exploited.              |
| `severity`      | `Optional[str]` | Severity level.                       |
| `explanation`   | `Optional[str]` | Explanation.                          |

### `RedTeamAttacksPage`

Paginated `RedTeamAttack` list. Supports `len()` and iteration.

### `RedTeamComparison`

| Field                   | Type                   |
| ----------------------- | ---------------------- |
| `runs`                  | `List[Dict[str, Any]]` |
| `vectors`               | `List[Dict[str, Any]]` |
| `overall_success_rates` | `Dict[str, float]`     |
| `baseline_run_id`       | `Optional[str]`        |

### `VulnerabilityInfo`

| Field          | Type            |
| -------------- | --------------- |
| `key`          | `str`           |
| `display_name` | `str`           |
| `description`  | `Optional[str]` |
| `severity`     | `Optional[str]` |

### `AttackVectorInfo`

| Field         | Type            |
| ------------- | --------------- |
| `key`         | `str`           |
| `name`        | `str`           |
| `description` | `Optional[str]` |

### `ProjectVulnerability`

| Field          | Type            | Default |
| -------------- | --------------- | ------- |
| `id`           | `str`           | —       |
| `project_id`   | `str`           | —       |
| `key`          | `str`           | —       |
| `display_name` | `str`           | —       |
| `enabled`      | `bool`          | `True`  |
| `threshold`    | `float`         | `0.5`   |
| `severity`     | `Optional[str]` | `None`  |

### `ProjectAttackVector`

| Field        | Type    | Default |
| ------------ | ------- | ------- |
| `id`         | `str`   | —       |
| `project_id` | `str`   | —       |
| `key`        | `str`   | —       |
| `name`       | `str`   | —       |
| `enabled`    | `bool`  | `True`  |
| `weight`     | `float` | `1.0`   |

***

## Related

* [SecurityClient](/sdk/security-client) — Methods returning these models
* [Evaluation Models](/sdk/models/evaluation) — Eval data models
* [Failure Analysis Models](/sdk/models/failure-analysis) — FA data models
