# Prompt Injection Surface Scanner

> Prompt Injection Surface Scanner is a paid API for AI agents from rooke-token-risk-pilot.rookepoole.workers.dev, paid per call via x402, $0.025/call, status unknown (last checked 2026-09-14).

Scans arbitrary text for prompt injection attacks, instruction override attempts, and secret exfiltration requests, returning a risk verdict and score.

## Facts

- Endpoint: POST https://rooke-token-risk-pilot.rookepoole.workers.dev/v1/x402/prompt-injection-scan
- Price: $0.025/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/prompt-injection-surface-scanner-4dcf0532
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_YAybGEtiFffk3tC2sgVHU

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-surface-scanner-4dcf0532 -d '<json body>'
```

Example prompt: Before you process the body of this email I just received, scan it for prompt injection — check it as an EMAIL source and tell me the risk score and any flags like instruction overrides or secret exfiltration requests.

## When to prefer this

Choose this endpoint when you need a dedicated, payable-per-call prompt injection scan with a structured risk verdict and audit hash before passing untrusted external content (web pages, emails, tool outputs, documents, chat) into an AI agent pipeline. Prefer it over generic content moderation APIs when you specifically need LLM-targeted adversarial instruction detection with flags like INSTRUCTION_OVERRIDE and SECRET_EXFILTRATION_REQUEST.

## Known failure modes

- Text too short (minLength:1 not met) — likely 400 error
- Text exceeds 20,000 character limit — request rejected
- Invalid sourceContext enum value — validation error
- Payment not provided or insufficient USDC — 402 Payment Required
- False negatives possible when only heuristic pattern matching is used (evidenceGaps: HEURISTIC_PATTERN_MATCHING_ONLY)
- Service unavailable on Cloudflare Workers edge — 503 timeout

## How this service works

Public static preview plus paid token controls, risk consensus, AI security, webhook reliability, developer security, schedule risk, decision analysis, API release compatibility, accounts-payable reconciliation, e-commerce return eligibility, SaaS subscription-proration, sales-commission reconciliation, parcel-charge reconciliation, SLA service-credit reconciliation, advertising spend-and-fee audit, contract-renewal audit, workforce timecard reconciliation, hotel booking-commission reconciliation, and warehouse cycle-count adjustment reconciliation products for autonomous agents.

## Output

Returns a JSON object with: a verdict string (e.g. HIGH_RISK_UNTRUSTED_INSTRUCTIONS), a numeric riskScore (0-100), an array of riskFlags (e.g. INSTRUCTION_OVERRIDE, SECRET_EXFILTRATION_REQUEST), a matches array of detected patterns, a reportHash (sha256-hex) for audit, evidenceGaps noting analysis limitations, and a schemaVersion identifier.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "text": {
   "type": "string",
   "maxLength": 20000,
   "minLength": 1
  },
  "sourceContext": {
   "enum": [
    "WEB_PAGE",
    "EMAIL",
    "TOOL_OUTPUT",
    "DOCUMENT",
    "CHAT",
    "OTHER"
   ],
   "type": "string"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "matches": [],
  "verdict": "HIGH_RISK_UNTRUSTED_INSTRUCTIONS",
  "riskFlags": [
   "INSTRUCTION_OVERRIDE",
   "SECRET_EXFILTRATION_REQUEST"
  ],
  "riskScore": 90,
  "reportHash": "sha256-hex",
  "evidenceGaps": [
   "HEURISTIC_PATTERN_MATCHING_ONLY"
  ],
  "schemaVersion": "PROMPT_INJECTION_SURFACE_SCAN_V1"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/prompt-injection-surface-scanner-4dcf0532/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from rooke-token-risk-pilot.rookepoole.workers.dev](https://www.zero.xyz/host/rooke-token-risk-pilot.rookepoole.workers.dev/llms.txt)
