---
title: "CLI: Security"
description: "The commands of the doorman command line under Security. Risk assessment and sender trust: the policy that warns, holds and guards sending, the senders an inbox knows, held mail and the audit log."
url: https://doorman.fyi/docs/cli/commands/security
markdown: https://doorman.fyi/docs/cli/commands/security.md
area: "SDKs and tools"
section: "Command line"
---

# CLI: Security

The commands of the doorman command line under Security. Risk assessment and sender trust: the policy that warns, holds and guards sending, the senders an inbox knows, held mail and the audit log.

Source: https://doorman.fyi/docs/cli/commands/security

## doorman security get

Command:
```sh
doorman security get
```

Operation [`security.get`](https://doorman.fyi/docs/reference/security.md#security-get): `GET /v1/security`

Read the security policy. Access `account`: an account-scoped key or a console session; an inbox-scoped key gets 403 `forbidden`. App tokens are refused.

## doorman security update

Command:
```sh
doorman security update [flags]
```

Operation [`security.update`](https://doorman.fyi/docs/reference/security.md#security-update): `PATCH /v1/security`

Change the security policy. Access `account`: an account-scoped key or a console session; an inbox-scoped key gets 403 `forbidden`. App tokens are refused.

**Flags**

| Flag | Type | Required | Description |
| --- | --- | --- | --- |
| `--level` | `"relaxed" \| "balanced" \| "strict"` | no | Apply this preset's thresholds and guards. It also clears the per-label rules, unless `labels` is given with it. |
| `--warn-at` | `integer \| null` | no | Mail scoring at least this is delivered with a warning and is never answered automatically. Null means never. |
| `--hold-at` | `integer \| null` | no | Mail scoring at least this is held for the owner and kept from agents. Null means never. Not below `warnAt`. |
| `--labels` | `object of "warn" \| "hold"` | no | The least that happens to mail carrying a label, whatever its score: `warn` or `hold`. Replaced as a whole; {} clears it. |
| `--hold-unauthenticated-new-senders` | `boolean` | no | Hold mail from a sender the inbox has never dealt with when it does not authenticate as its domain. |
| `--model-analysis` | `boolean` | no | Let a model read the content of mail the signals leave undecided. The text goes to the deployment's AI gateway, is not kept and is never used for training. Off: assessments rest on the deterministic signals alone. |
| `--reply-guard` | `boolean` | no | Refuse an agent's reply into a thread that holds a flagged message: one this policy warns about or holds, by its score or a label, or one the owner marked unsafe (403 `risk_blocked`). A message stops counting once the owner marks it safe, or while its sender is trusted and it passed authentication. A console session is never refused. |
| `--recipients` | `"any" \| "known"` | no | `known`: an agent may write only to senders the inbox trusts or knows, and to the account's own inboxes (403 `risk_blocked` otherwise). Having written to the inbox, or being named in a message, does not make a recipient known: answering a stranger takes a person, or trusting them first. `any`: no such limit. A console session is never refused. |
| `--send-approval` | `"off" \| "apps" \| "all"` | no | Whose sends wait for the owner when a recipient is not one the inbox knows or trusts, nor one of the account's own inboxes. `apps`: a connected app's. `all`: an app's and an API key's. `off`: nobody's. A send that waits answers 202 with a held send, which the owner sends or discards; it expires unsent after 7 days. A console session is never held, and neither is mail an inbox rule generates. It applies whatever the deployment's `enforcement`, except `off`, where no record of senders is kept and nothing is held. No preset changes it. An account that never chose starts on `apps`. |
| `--allow-key-management` | `boolean` | no | Let account keys loosen protection (trust a sender, raise a threshold, release held mail, approve a held send). Off by default, and only a console session can switch it on. Account scope only. |
| `--deep-scan` | `boolean` | no | Run every attachment, in both directions, through the deployment's malware engine. The bytes go to an isolated scanner that keeps nothing. Off: attachments are still checked by their structure. No effect where the deployment has no engine (`deepScanAvailable`). |
| `--link-sandbox` | `boolean` | no | Open the most suspect links of a message in an isolated browser before the message is delivered, to see where they lead. The site a link points at sees a visit. Links that verify an address, sign in, accept an invitation or unsubscribe are never opened, and neither are an authenticated sender's links to its own site. No effect where the deployment has no sandbox. |
| `--unscannable` | `"deliver" \| "warn" \| "hold"` | no | The least that happens to mail carrying something that could not be checked (a locked archive, or a scan that did not finish): `deliver`, `warn` or `hold`. |
| `--json` | `object` | no | The request body as one JSON object. A flag given beside it replaces the field of the same name. |

Example:
```sh
doorman security update \
  --level strict
```

## doorman inboxes security get

Command:
```sh
doorman inboxes security get <inboxId> [flags]
```

Operation [`inboxes.security.get`](https://doorman.fyi/docs/reference/security.md#inboxes-security-get): `GET /v1/inboxes/{inboxId}/security`

Read an inbox's security policy. Access `account`: an account-scoped key or a console session; an inbox-scoped key gets 403 `forbidden`. App tokens are refused.

**Flags**

| Flag | Type | Required | Description |
| --- | --- | --- | --- |
| `--inbox-id` | `string` | no | The same as the argument `<inboxId>`, for a script that names everything. |

Example:
```sh
doorman inboxes security get inb_01jc4q7w9k2m5n8p3r6t1v4x7z
```

## doorman inboxes security update

Command:
```sh
doorman inboxes security update <inboxId> [flags]
```

Operation [`inboxes.security.update`](https://doorman.fyi/docs/reference/security.md#inboxes-security-update): `PATCH /v1/inboxes/{inboxId}/security`

Give an inbox its own security policy. Access `account`: an account-scoped key or a console session; an inbox-scoped key gets 403 `forbidden`. App tokens are refused.

**Flags**

| Flag | Type | Required | Description |
| --- | --- | --- | --- |
| `--inbox-id` | `string` | no | The same as the argument `<inboxId>`, for a script that names everything. |
| `--level` | `"relaxed" \| "balanced" \| "strict"` | no | Apply this preset's thresholds and guards. It also clears the per-label rules, unless `labels` is given with it. |
| `--warn-at` | `integer \| null` | no | Mail scoring at least this is delivered with a warning and is never answered automatically. Null means never. |
| `--hold-at` | `integer \| null` | no | Mail scoring at least this is held for the owner and kept from agents. Null means never. Not below `warnAt`. |
| `--labels` | `object of "warn" \| "hold"` | no | The least that happens to mail carrying a label, whatever its score: `warn` or `hold`. Replaced as a whole; {} clears it. |
| `--hold-unauthenticated-new-senders` | `boolean` | no | Hold mail from a sender the inbox has never dealt with when it does not authenticate as its domain. |
| `--model-analysis` | `boolean` | no | Let a model read the content of mail the signals leave undecided. The text goes to the deployment's AI gateway, is not kept and is never used for training. Off: assessments rest on the deterministic signals alone. |
| `--reply-guard` | `boolean` | no | Refuse an agent's reply into a thread that holds a flagged message: one this policy warns about or holds, by its score or a label, or one the owner marked unsafe (403 `risk_blocked`). A message stops counting once the owner marks it safe, or while its sender is trusted and it passed authentication. A console session is never refused. |
| `--recipients` | `"any" \| "known"` | no | `known`: an agent may write only to senders the inbox trusts or knows, and to the account's own inboxes (403 `risk_blocked` otherwise). Having written to the inbox, or being named in a message, does not make a recipient known: answering a stranger takes a person, or trusting them first. `any`: no such limit. A console session is never refused. |
| `--send-approval` | `"off" \| "apps" \| "all"` | no | Whose sends wait for the owner when a recipient is not one the inbox knows or trusts, nor one of the account's own inboxes. `apps`: a connected app's. `all`: an app's and an API key's. `off`: nobody's. A send that waits answers 202 with a held send, which the owner sends or discards; it expires unsent after 7 days. A console session is never held, and neither is mail an inbox rule generates. It applies whatever the deployment's `enforcement`, except `off`, where no record of senders is kept and nothing is held. No preset changes it. An account that never chose starts on `apps`. |
| `--allow-key-management` | `boolean` | no | Let account keys loosen protection (trust a sender, raise a threshold, release held mail, approve a held send). Off by default, and only a console session can switch it on. Account scope only. |
| `--deep-scan` | `boolean` | no | Run every attachment, in both directions, through the deployment's malware engine. The bytes go to an isolated scanner that keeps nothing. Off: attachments are still checked by their structure. No effect where the deployment has no engine (`deepScanAvailable`). |
| `--link-sandbox` | `boolean` | no | Open the most suspect links of a message in an isolated browser before the message is delivered, to see where they lead. The site a link points at sees a visit. Links that verify an address, sign in, accept an invitation or unsubscribe are never opened, and neither are an authenticated sender's links to its own site. No effect where the deployment has no sandbox. |
| `--unscannable` | `"deliver" \| "warn" \| "hold"` | no | The least that happens to mail carrying something that could not be checked (a locked archive, or a scan that did not finish): `deliver`, `warn` or `hold`. |
| `--json` | `object` | no | The request body as one JSON object. A flag given beside it replaces the field of the same name. |

Example:
```sh
doorman inboxes security update inb_01jc4q7w9k2m5n8p3r6t1v4x7z \
  --level strict
```

## doorman inboxes security reset

Command:
```sh
doorman inboxes security reset <inboxId> [flags]
```

Operation [`inboxes.security.reset`](https://doorman.fyi/docs/reference/security.md#inboxes-security-reset): `DELETE /v1/inboxes/{inboxId}/security`

Return an inbox to the account's security policy. Access `account`: an account-scoped key or a console session; an inbox-scoped key gets 403 `forbidden`. App tokens are refused.

**Flags**

| Flag | Type | Required | Description |
| --- | --- | --- | --- |
| `--inbox-id` | `string` | no | The same as the argument `<inboxId>`, for a script that names everything. |

Example:
```sh
doorman inboxes security reset inb_01jc4q7w9k2m5n8p3r6t1v4x7z
```

## doorman inboxes senders list

Command:
```sh
doorman inboxes senders list <inboxId> [flags]
```

Operation [`inboxes.senders.list`](https://doorman.fyi/docs/reference/security.md#inboxes-senders-list): `GET /v1/inboxes/{inboxId}/senders`

List an inbox's senders. Access `account`: an account-scoped key or a console session; an inbox-scoped key gets 403 `forbidden`. App tokens are refused.

**Flags**

| Flag | Type | Required | Description |
| --- | --- | --- | --- |
| `--inbox-id` | `string` | no | The same as the argument `<inboxId>`, for a script that names everything. |
| `--standing` | `"trusted" \| "known" \| "new" \| "blocked"` | no | Only senders with this standing. |
| `--q` | `string` | no | Keep the senders whose address or name contains this text, case-insensitively. |
| `--limit` | `integer` | no | Page size, 1 to 100. Defaults to 50. |
| `--offset` | `integer` | no | Rows to skip. Defaults to 0. |

Example:
```sh
doorman inboxes senders list inb_01jc4q7w9k2m5n8p3r6t1v4x7z
```

## doorman sender-rules list

Command:
```sh
doorman sender-rules list [flags]
```

Operation [`senderRules.list`](https://doorman.fyi/docs/reference/security.md#senderRules-list): `GET /v1/sender-rules`

List sender rules. Access `account`: an account-scoped key or a console session; an inbox-scoped key gets 403 `forbidden`. App tokens are refused.

**Flags**

| Flag | Type | Required | Description |
| --- | --- | --- | --- |
| `--inbox-id` | `string` | no | Only the rules that apply to this inbox alone. Omit for every rule of the account. |
| `--standing` | `"trusted" \| "blocked"` | no | Only trusted or only blocked. |
| `--q` | `string` | no | Keep the rules whose address or domain contains this text. |
| `--limit` | `integer` | no | Page size, 1 to 100. Defaults to 50. |
| `--offset` | `integer` | no | Rows to skip. Defaults to 0. |

## doorman sender-rules create

Command:
```sh
doorman sender-rules create [flags]
```

Operation [`senderRules.create`](https://doorman.fyi/docs/reference/security.md#senderRules-create): `POST /v1/sender-rules`

Trust or block a sender. Access `account`: an account-scoped key or a console session; an inbox-scoped key gets 403 `forbidden`. App tokens are refused.

**Flags**

| Flag | Type | Required | Description |
| --- | --- | --- | --- |
| `--match` | `string` | yes | An address (`sam@example.com`) or a domain (`example.com`, which covers every address at it, not its subdomains). |
| `--standing` | `"trusted" \| "blocked"` | yes | `trusted`: their authenticated mail is treated as low risk and replies to them are never guarded. `blocked`: their mail is refused. Trusting needs a console session unless the account allows its account keys to. |
| `--inbox-id` | `string` | no | Apply to this inbox only. Omit for every inbox of the account. |
| `--note` | `string` | no | A label for whoever reads the list later, at most 200 characters. |
| `--json` | `object` | no | The request body as one JSON object. A flag given beside it replaces the field of the same name. |

Example:
```sh
doorman sender-rules create \
  --match sam@example.com \
  --standing trusted
```

## doorman sender-rules delete

Command:
```sh
doorman sender-rules delete <senderRuleId> [flags]
```

Operation [`senderRules.delete`](https://doorman.fyi/docs/reference/security.md#senderRules-delete): `DELETE /v1/sender-rules/{senderRuleId}`

Remove a sender rule. Access `account`: an account-scoped key or a console session; an inbox-scoped key gets 403 `forbidden`. App tokens are refused.

**Flags**

| Flag | Type | Required | Description |
| --- | --- | --- | --- |
| `--sender-rule-id` | `string` | no | The same as the argument `<senderRuleId>`, for a script that names everything. |

Example:
```sh
doorman sender-rules delete snr_01jc5f1a2b3c4d5e6f7g8h9j0k
```

## doorman inboxes held list

Command:
```sh
doorman inboxes held list <inboxId> [flags]
```

Operation [`inboxes.held.list`](https://doorman.fyi/docs/reference/security.md#inboxes-held-list): `GET /v1/inboxes/{inboxId}/held`

List held messages. Access `any`: any API key, or a console session. An app token needs `mail:read`.

**Flags**

| Flag | Type | Required | Description |
| --- | --- | --- | --- |
| `--inbox-id` | `string` | no | The same as the argument `<inboxId>`, for a script that names everything. |
| `--limit` | `integer` | no | Page size, 1 to 100. Defaults to 50. |
| `--offset` | `integer` | no | Rows to skip. Defaults to 0. |

Example:
```sh
doorman inboxes held list inb_01jc4q7w9k2m5n8p3r6t1v4x7z
```

## doorman messages release

Command:
```sh
doorman messages release <messageId> [flags]
```

Operation [`messages.release`](https://doorman.fyi/docs/reference/security.md#messages-release): `POST /v1/messages/{messageId}/release`

Release a held message. Access `account`: an account-scoped key or a console session; an inbox-scoped key gets 403 `forbidden`. App tokens are refused.

**Flags**

| Flag | Type | Required | Description |
| --- | --- | --- | --- |
| `--message-id` | `string` | no | The same as the argument `<messageId>`, for a script that names everything. |

Example:
```sh
doorman messages release msg_01jc5a6g7h8j9k0m1n2p3q4r5s
```

## doorman messages discard

Command:
```sh
doorman messages discard <messageId> [flags]
```

Operation [`messages.discard`](https://doorman.fyi/docs/reference/security.md#messages-discard): `POST /v1/messages/{messageId}/discard`

Discard a held message. Access `account`: an account-scoped key or a console session; an inbox-scoped key gets 403 `forbidden`. App tokens are refused.

**Flags**

| Flag | Type | Required | Description |
| --- | --- | --- | --- |
| `--message-id` | `string` | no | The same as the argument `<messageId>`, for a script that names everything. |

Example:
```sh
doorman messages discard msg_01jc5a6g7h8j9k0m1n2p3q4r5s
```

## doorman messages feedback

Command:
```sh
doorman messages feedback <messageId> [flags]
```

Operation [`messages.feedback`](https://doorman.fyi/docs/reference/security.md#messages-feedback): `POST /v1/messages/{messageId}/feedback`

Mark a message safe or unsafe. Access `account`: an account-scoped key or a console session; an inbox-scoped key gets 403 `forbidden`. App tokens are refused.

**Flags**

| Flag | Type | Required | Description |
| --- | --- | --- | --- |
| `--message-id` | `string` | no | The same as the argument `<messageId>`, for a script that names everything. |
| `--verdict` | `"safe" \| "unsafe"` | yes |  |
| `--json` | `object` | no | The request body as one JSON object. A flag given beside it replaces the field of the same name. |

Example:
```sh
doorman messages feedback msg_01jc5a6g7h8j9k0m1n2p3q4r5s \
  --verdict safe
```

## doorman security audit

Command:
```sh
doorman security audit [flags]
```

Operation [`security.audit`](https://doorman.fyi/docs/reference/security.md#security-audit): `GET /v1/security/audit`

Read the security audit log. Access `account`: an account-scoped key or a console session; an inbox-scoped key gets 403 `forbidden`. App tokens are refused.

**Flags**

| Flag | Type | Required | Description |
| --- | --- | --- | --- |
| `--inbox-id` | `string` | no | Only the entries about this inbox. |
| `--limit` | `integer` | no | Page size, 1 to 100. Defaults to 50. |
| `--offset` | `integer` | no | Rows to skip. Defaults to 0. |

## doorman security preview

Command:
```sh
doorman security preview [flags]
```

Operation [`security.preview`](https://doorman.fyi/docs/reference/security.md#security-preview): `POST /v1/security/preview`

Preview what a policy does to a message. Access `account`: an account-scoped key or a console session; an inbox-scoped key gets 403 `forbidden`. App tokens are refused.

**Flags**

| Flag | Type | Required | Description |
| --- | --- | --- | --- |
| `--inbox-id` | `string` | no | Evaluate as this inbox: its senders and, without `policy`, its policy. Defaults to the message's inbox, or to the account's policy with no sender history. |
| `--message-id` | `string` | no | A stored inbound message of the account that was assessed. A held one needs a caller that may review held mail. |
| `--sample` | `"ordinary" \| "phishing" \| "prompt_injection" \| "impersonation"` | no | A built-in message: ordinary mail, a phishing attempt, an injection hidden from the reader, or an impersonation. |
| `--from` | `string` | no | The sender of your own message. Defaults to a sender the inbox has never seen. |
| `--authenticated` | `boolean` | no | Whether your own message passed authentication for its sender's domain. Defaults to true, so the content decides; false shows what a forged sender looks like. |
| `--subject` | `string` | no |  |
| `--text` | `string` | no | The plain-text body of your own message. |
| `--html` | `string` | no | The HTML body of your own message. |
| `--policy` | `object` | no | A draft to evaluate under, applied over the policy in force. Omit to use the policy in force. |
| `--json` | `object` | no | The request body as one JSON object. A flag given beside it replaces the field of the same name. |

Example:
```sh
doorman security preview \
  --sample prompt_injection \
  --policy '{"level":"strict"}'
```

## doorman inboxes held-sends list

Command:
```sh
doorman inboxes held-sends list <inboxId> [flags]
```

Operation [`inboxes.heldSends.list`](https://doorman.fyi/docs/reference/security.md#inboxes-heldSends-list): `GET /v1/inboxes/{inboxId}/held-sends`

List held sends. Access `any`: any API key, or a console session. App tokens are refused.

**Flags**

| Flag | Type | Required | Description |
| --- | --- | --- | --- |
| `--inbox-id` | `string` | no | The same as the argument `<inboxId>`, for a script that names everything. |
| `--status` | `"held" \| "sent" \| "discarded" \| "expired"` | no | Only held sends in this state. Defaults to `held`. |
| `--kind` | `"held" \| "draft"` | no | Only the sends the policy kept (`held`) or only drafts (`draft`). Both when left out. |
| `--limit` | `integer` | no | Page size, 1 to 100. Defaults to 50. |
| `--offset` | `integer` | no | Rows to skip. Defaults to 0. |

Example:
```sh
doorman inboxes held-sends list inb_01jc4q7w9k2m5n8p3r6t1v4x7z
```

## doorman held-sends get

Command:
```sh
doorman held-sends get <heldSendId> [flags]
```

Operation [`heldSends.get`](https://doorman.fyi/docs/reference/security.md#heldSends-get): `GET /v1/held-sends/{heldSendId}`

Read a held send. Access `any`: any API key, or a console session. An app token needs `mail:read`.

**Flags**

| Flag | Type | Required | Description |
| --- | --- | --- | --- |
| `--held-send-id` | `string` | no | The same as the argument `<heldSendId>`, for a script that names everything. |

Example:
```sh
doorman held-sends get hsd_01jc5f1a2b3c4d5e6f7g8h9j0k
```

## doorman held-sends approve

Command:
```sh
doorman held-sends approve <heldSendId> [flags]
```

Operation [`heldSends.approve`](https://doorman.fyi/docs/reference/security.md#heldSends-approve): `POST /v1/held-sends/{heldSendId}/approve`

Send a held send. Access `account`: an account-scoped key or a console session; an inbox-scoped key gets 403 `forbidden`. App tokens are refused.

**Flags**

| Flag | Type | Required | Description |
| --- | --- | --- | --- |
| `--held-send-id` | `string` | no | The same as the argument `<heldSendId>`, for a script that names everything. |

Example:
```sh
doorman held-sends approve hsd_01jc5f1a2b3c4d5e6f7g8h9j0k
```

## doorman held-sends discard

Command:
```sh
doorman held-sends discard <heldSendId> [flags]
```

Operation [`heldSends.discard`](https://doorman.fyi/docs/reference/security.md#heldSends-discard): `POST /v1/held-sends/{heldSendId}/discard`

Discard a held send. Access `account`: an account-scoped key or a console session; an inbox-scoped key gets 403 `forbidden`. App tokens are refused.

**Flags**

| Flag | Type | Required | Description |
| --- | --- | --- | --- |
| `--held-send-id` | `string` | no | The same as the argument `<heldSendId>`, for a script that names everything. |

Example:
```sh
doorman held-sends discard hsd_01jc5f1a2b3c4d5e6f7g8h9j0k
```
