# Prompt Injection Detection API

> Prompt Injection Detection API is a paid API for AI agents from golf-evm-math.x402-evm-math.workers.dev, paid per call via x402, $0.0025/call, status unknown (last checked 2026-10-30).

Screens text intended for an AI agent and returns a safe, suspicious, or malicious verdict with matched patterns using deterministic, rule-based detection.

## Facts

- Endpoint: POST https://golf-evm-math.x402-evm-math.workers.dev/v1/prompt?utm_source=zero.xyz
- Price: $0.0025/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-30
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/prompt-injection-detection-api-a99144e3
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_hv-wJWx7-AlrMOZ1sIZX9

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 prompt-injection-detection-api-a99144e3 -d '<json body>'
```

Example prompt: Before passing this user message to the AI, check it for prompt injection — screen the text and tell me if the verdict is safe, suspicious, or malicious, and what patterns matched.

## When to prefer this

Prefer this endpoint when you need fast, deterministic, rule-based prompt injection screening with no probabilistic variance — ideal for high-throughput agent pipelines where consistency and auditability matter more than catching novel zero-day injection techniques. Choose this over LLM-based classifiers when you need reproducible verdicts and explicit pattern explanations rather than probabilistic confidence scores.

## Known failure modes

- Missing required 'input' field returns a validation error
- Malformed body type (not json/form-data/text) causes a 400 error
- Empty or very short text may return a safe verdict without meaningful pattern matching
- Rule-based system may produce false negatives for novel injection techniques not in ruleset
- Payment failure via x402 protocol results in 402 Payment Required response

## How this service works

Exact EVM address, calldata, Uniswap V2/V3 and impermanent-loss math. Pay per call in USDC on Base via x402.

## Output

Returns a JSON object with a numeric score (0-1 indicating severity), a verdict string ('safe', 'suspicious', or 'malicious'), and a list of matched patterns that triggered the detection rules.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method",
    "bodyType",
    "body"
   ],
   "properties": {
    "body": {
     "properties": {}
    },
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "POST"
     ],
     "type": "string"
    },
    "bodyType": {
     "enum": [
      "json",
      "form-data",
      "text"
     ],
     "type": "string"
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "score": 0,
  "matches": [],
  "verdict": "safe"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/prompt-injection-detection-api-a99144e3/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from golf-evm-math.x402-evm-math.workers.dev](https://www.zero.xyz/host/golf-evm-math.x402-evm-math.workers.dev/llms.txt)
