---
title: "Scan a shell command for dangerous operations before execution."
method: POST
path: "/v1/scan/command"
tags: ["security"]
---

# Scan a shell command for dangerous operations before execution.

`POST /v1/scan/command`

## Request

- Base URL: `https://api.agent-toolbox.ai`
- URL: `https://api.agent-toolbox.ai/v1/scan/command`
- Auth: one of:
  - HTTP bearer
  - none

Cost: 1 credit(s). Free tier: 10 calls per IP (no auth).

## Request body

- ScanCommandRequest
  - `command` string, required
  - `shell` 'bash' | 'sh' | 'zsh' | 'powershell' | 'generic'
  - `policy` object
    - `blockSeverityAtOrAbove` 'low' | 'medium' | 'high' | 'critical'
    - `allow` string[]
    - `protectedRefs` string[]
    - `maxSegments` integer

## Response `200`

Success.

- ScanCommandResponse
  - `verdict` 'PASS' | 'FLAG' | 'BLOCK', required
  - `segments` integer, required
  - `findings` object[], required
    - `ruleId` string, required
    - `severity` 'low' | 'medium' | 'high' | 'critical', required
    - `segmentIndex` integer, required
    - `message` string, required
    - `snippet` string, required
  - `counts` object, required
    - `low` integer, required
    - `medium` integer, required
    - `high` integer, required
    - `critical` integer, required
  - `certificate` string, required: Tamper-evident SHA-256 certificate.
  - `latencyMs` number, required: Server compute time in ms.

## Other responses

- `400`: Invalid request body.
- `402`: Free tier exhausted or insufficient credits.

---

[API](https://skmtc.dev/agent-toolbox/apis/agent-toolbox-ai-api.md) · [All operations](https://skmtc.dev/agent-toolbox/apis/agent-toolbox-ai-api/llms.txt) · [OpenAPI document](https://skmtc.dev/agent-toolbox/apis/agent-toolbox-ai-api/revisions/07132043190b?raw)
