# AI Application Firewall API

Source: https://docs.autessa.com/docs/reference/firewall

> AI Application Firewall: inspect turns, score voices, verify people, simulations and alerts Generated from the Autessa OpenAPI spec.

# AI Application Firewall API

AI Application Firewall: inspect turns, score voices, verify people, simulations and alerts

- **Base URL:** `https://api.autessa.com`
- **Auth:** your API key in the `Authorization` header, with no `Bearer` prefix.
- **Guide:** [AI Application Firewall](/docs/features/ai-application-firewall.md)
- **Status:** all 15 operations are live.

---

## Start a verification

**POST** `/clients/aaf/challenge/start`

400 when no method is set up for the person; 429 while the session is locked.

**Request body**

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `agentId` | string |  | ID id. |
| `methods` | array of string |  | Default: the policy's. |
| `passphraseId` | string |  | For PASSPHRASE: which passphrase. |
| `policyName` | string |  |  |
| `sessionId` | string | Yes | Attempts and locks are counted per session. |
| `subjectId` | string |  | Your id for the person, for the authenticator app. |
| `voice` | boolean |  | True when the answer will be spoken. |

**Response**

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `challengeId` | string |  |  |
| `methods` | array of string |  |  |
| `prompt` | string |  | What to show or say to the person. |

```bash
curl -X POST "https://api.autessa.com/clients/aaf/challenge/start" \
  -H "Authorization: $AUTESSA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"sessionId":"session-123"}'
```

---

## Check an answer

**POST** `/clients/aaf/challenge/verify`

**Request body**

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `answer` | string |  | A typed answer. |
| `challengeId` | string | Yes |  |
| `method` | string |  |  |
| `transcript` | string |  | A spoken answer, as transcribed. |
| `voiceScore` | number |  | That spoken turn's P(synthetic), if you scored it. |

**Response**

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `attemptsLeft` | integer |  |  |
| `duress` | boolean |  | True when the duress word was given. For you only: never tell the person. |
| `status` | string |  |  |

```bash
curl -X POST "https://api.autessa.com/clients/aaf/challenge/verify" \
  -H "Authorization: $AUTESSA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"challengeId":"challenge-id"}'
```

---

## What the firewall checked and caught

**GET** `/clients/aaf/dashboard`

**Parameters**

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `from` | query | string |  | ISO-8601 instant or date; default 7 days ago. |
| `to` | query | string |  | ISO-8601 instant or date; default now. |
| `source` | query | string |  |  |
| `policyName` | query | string |  |  |
| `apiKeyId` | query | string |  |  |

**Response**

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `byAgent` | array of AgentRow |  |  |
| `byPolicy` | array of PolicyRow |  |  |
| `byReason` | array of ReasonCount |  |  |
| `byRule` | array of RuleRow |  |  |
| `pendingApprovals` | integer |  |  |
| `previousTotals` | Totals |  |  |
| `range` | FirewallDashboardRange |  |  |
| `recent` | array of RecentCatch |  |  |
| `series` | array of SeriesPoint |  |  |
| `topIdentities` | array of IdentityRow |  |  |
| `totals` | Totals |  |  |

```bash
curl -X GET "https://api.autessa.com/clients/aaf/dashboard" \
  -H "Authorization: $AUTESSA_API_KEY"
```

---

## Sensitive records shown to one end user in the last 24 hours

**GET** `/clients/aaf/disclosures/{subjectId}`

**Parameters**

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `subjectId` | path | string | Yes |  |
| `policyName` | query | string |  |  |

**Response**

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `perConversationLimit` | integer |  |  |
| `perDayLimit` | integer |  |  |
| `subjectId` | string |  |  |
| `today` | integer |  | Sensitive records shown to this subject in the last 24 hours. |

```bash
curl -X GET "https://api.autessa.com/clients/aaf/disclosures/V1StGXR8Z5" \
  -H "Authorization: $AUTESSA_API_KEY"
```

---

## List alerts and flags (newest first)

**GET** `/clients/aaf/events`

**Parameters**

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `since` | query | string |  | Default: 24 hours ago. |
| `limit` | query | integer |  |  |

**Response**

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `events` | array of EventDto |  |  |

```bash
curl -X GET "https://api.autessa.com/clients/aaf/events" \
  -H "Authorization: $AUTESSA_API_KEY"
```

---

## Inspect one turn

**POST** `/clients/aaf/inspect`

Check one point of a turn (user input, tool call, tool result, final reply, voice, or the tool definitions an agent is about to get) and get what to do. BLOCK and CHALLENGE carry the policy's safeReply; text phases carry redactedText when personal data was masked. Company-scoped: no resourceId.

**Request body**

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `args` | object |  | The tool's arguments (TOOL_CALL). |
| `audioB64` | string |  | Caller audio (base64), scored for a synthetic voice (VOICE). |
| `audioFormat` | string |  | Default pcm16_16k. |
| `callerIdAttestation` | string |  | STIR/SHAKEN verstat (or the same values) for a phone caller. |
| `origin` | Origin |  |  |
| `overrides` | PolicyDto |  | Policy sections (and rules) that replace the policy's for this call only. |
| `phase` | string | Yes |  |
| `policyName` | string |  | A named API policy; omitted = the company default. |
| `result` | object |  | The tool's result (TOOL_RESULT). |
| `sessionId` | string | Yes | Your session or conversation id. Checks that span calls are kept per session. |
| `subjectId` | string |  | Your stable id for the end user (for unusual-request baselines and disclosure limits). |
| `text` | string |  | USER_INPUT and FINAL_RESPONSE. |
| `toolDisclosure` | ToolDisclosureDto |  |  |
| `toolGated` | boolean |  | The tool requires a verified person. |
| `toolName` | string |  | TOOL_CALL and TOOL_RESULT. |
| `toolType` | string |  | Optional tool kind (for example API_CALL, SEND_EMAIL) for the egress checks. |
| `tools` | array of ToolDefinitionDto |  |  |

**Response**

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `action` | string |  | DURESS is for you only: never show it to the end user. |
| `anomaly` | FirewallAnomaly |  |  |
| `challenge` | FirewallChallenge |  |  |
| `disclosure` | FirewallDisclosure |  |  |
| `enforced` | boolean |  | False in monitor mode: the action is what the policy would do. |
| `eventId` | string |  | The recorded event, when one was recorded. |
| `findings` | array of FindingDto |  |  |
| `profile` | string |  |  |
| `reasons` | array of string |  |  |
| `redactedText` | string |  |  |
| `safeReply` | string |  |  |
| `timingsMs` | TimingsDto |  |  |
| `voice` | FirewallVoice |  |  |
| `withheldTools` | array of string |  |  |

```bash
curl -X POST "https://api.autessa.com/clients/aaf/inspect" \
  -H "Authorization: $AUTESSA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"sessionId":"session-123","phase":"string","text":"Hello, I need help with my order."}'
```

---

## Start an attack simulation

**POST** `/clients/aaf/simulations`

Runs the attack packs against an Autessa agent (agentId), a named policy, the company default, or your own agent's HTTP endpoint (target). Sending target together with agentId is a 400. Options: categories, languages (en, es) and multiTurn.

**Request body**

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `agentId` | string |  | ID id. |
| `categories` | array of string |  | Omitted = all. |
| `languages` | array of string |  |  |
| `multiTurn` | boolean |  |  |
| `policyName` | string |  | Or against a named API policy. Neither = the company default policy. |
| `target` | SimulationTargetRequest |  | Planned: attack your own agent's endpoint instead of an Autessa agent or policy. |

**Response**

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `simulationId` | string |  |  |

```bash
curl -X POST "https://api.autessa.com/clients/aaf/simulations" \
  -H "Authorization: $AUTESSA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"agentId":"V1StGXR8Z5"}'
```

---

## Get a simulation's scorecard

**GET** `/clients/aaf/simulations/{simulationId}`

**Parameters**

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `simulationId` | path | string | Yes |  |

**Response**

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `agentId` | string |  | ID id. |
| `attempts` | array of AttemptDto |  |  |
| `categories` | array of string |  |  |
| `completedAt` | string |  |  |
| `createdAt` | string |  |  |
| `errorMessage` | string |  | Why the run failed (FAILED only). |
| `languages` | array of string |  |  |
| `multiTurn` | boolean |  |  |
| `policyName` | string |  |  |
| `scorecard` | array of ScorecardRow |  |  |
| `simulationId` | string |  |  |
| `status` | string |  |  |
| `target` | SimulationTargetDto |  |  |

```bash
curl -X GET "https://api.autessa.com/clients/aaf/simulations/V1StGXR8Z5" \
  -H "Authorization: $AUTESSA_API_KEY"
```

---

## List pinned tool definitions

**GET** `/clients/aaf/tool-pins`

Each (server, tool name) definition is pinned the first time it is seen; a later change is CHANGED until a company admin approves it in Autessa.

**Parameters**

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `status` | query | string |  |  |
| `limit` | query | integer |  |  |

**Response**

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `pins` | array of ToolPinDto |  |  |

```bash
curl -X GET "https://api.autessa.com/clients/aaf/tool-pins" \
  -H "Authorization: $AUTESSA_API_KEY"
```

---

## Confirm an authenticator with a first code

**POST** `/clients/aaf/totp/confirm`

**Request body**

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | string | Yes |  |
| `subjectId` | string | Yes |  |

**Response**

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `confirmed` | boolean |  |  |
| `message` | string |  |  |

```bash
curl -X POST "https://api.autessa.com/clients/aaf/totp/confirm" \
  -H "Authorization: $AUTESSA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"subjectId":"user-42","code":"123456"}'
```

---

## Set up an authenticator app for a user

**POST** `/clients/aaf/totp/enroll`

**Request body**

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `label` | string |  |  |
| `phone` | string |  |  |
| `subjectId` | string | Yes |  |

**Response**

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `enrollmentId` | string |  |  |
| `otpauthUri` | string |  | otpauth:// URI for the QR code. Shown once. |
| `secretBase32` | string |  | The same secret for manual entry. Shown once. |

```bash
curl -X POST "https://api.autessa.com/clients/aaf/totp/enroll" \
  -H "Authorization: $AUTESSA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"subjectId":"user-42"}'
```

---

## A user's authenticator status

**GET** `/clients/aaf/totp/{subjectId}`

**Parameters**

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `subjectId` | path | string | Yes |  |

**Response**

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `confirmed` | boolean |  |  |
| `confirmedAt` | string |  |  |
| `createdAt` | string |  |  |
| `enrolled` | boolean |  |  |
| `label` | string |  |  |
| `phoneLast4` | string |  |  |

```bash
curl -X GET "https://api.autessa.com/clients/aaf/totp/V1StGXR8Z5" \
  -H "Authorization: $AUTESSA_API_KEY"
```

---

## Remove a user's authenticator

**DELETE** `/clients/aaf/totp/{subjectId}`

**Parameters**

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `subjectId` | path | string | Yes |  |

**Response**

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `removed` | boolean |  |  |

```bash
curl -X DELETE "https://api.autessa.com/clients/aaf/totp/V1StGXR8Z5" \
  -H "Authorization: $AUTESSA_API_KEY"
```

---

## Score audio for a synthetic voice

**POST** `/clients/aaf/voice/score`

**Request body**

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `audioB64` | string |  |  |
| `audioFormat` | string |  | Default: detected from the bytes. |
| `fileUrl` | string |  | An https link to the audio. |

**Response**

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `durationSeconds` | number |  |  |
| `label` | string |  |  |
| `score` | number |  |  |
| `watermark` | boolean |  |  |
| `windows` | array of WindowDto |  |  |

```bash
curl -X POST "https://api.autessa.com/clients/aaf/voice/score" \
  -H "Authorization: $AUTESSA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"audioB64":"UklGRiQAAABXQVZF"}'
```

---

## Today's word of the day

**GET** `/clients/aaf/word-of-day`

Needs the key permission AAF_WORD_OF_DAY (403 without it); 404 when the word of the day is off.

**Parameters**

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `agentId` | query | string |  | For a policy with scope AGENT. |

**Response**

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `date` | string |  | The local date the word belongs to (yyyy-MM-dd). |
| `duressWord` | string |  | Only when the duress word is turned on. |
| `timeZone` | string |  |  |
| `validUntil` | string |  | UTC time the word changes. |
| `word` | string |  |  |

```bash
curl -X GET "https://api.autessa.com/clients/aaf/word-of-day" \
  -H "Authorization: $AUTESSA_API_KEY"
```

---

## Related

- [API reference overview](/docs/reference.md)
- [Errors and retries](/docs/reference.md#errors)
- [AI Application Firewall guide](/docs/features/ai-application-firewall.md)

