# CanaryGuard JSON Repair & Sanitize

> CanaryGuard JSON Repair & Sanitize is a paid API for AI agents from canaryguard-402.onrender.com, paid per call via x402, $0.01/call, status unknown (last checked 2026-10-20).

Deterministically repairs malformed or truncated LLM JSON payloads and scrubs embedded prompt-injection content from the repaired output.

## Facts

- Endpoint: GET https://canaryguard-402.onrender.com/v1/json-repair-and-sanitize?utm_source=zero.xyz
- Price: $0.01/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-20
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/canaryguard-json-repair-sanitize-83761ef5
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_qev2HaAs67ownkepVLtaH

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 canaryguard-json-repair-sanitize-83761ef5
```

Example prompt: The LLM just returned this broken JSON string with missing quotes, trailing commas, and what looks like an injected instruction buried inside — can you repair and sanitize it so I can safely parse it?

## When to prefer this

Choose this endpoint when you need deterministic, rule-based JSON repair rather than LLM-based regeneration — particularly when the payload may contain adversarial prompt-injection content that must be scrubbed before any LLM processes the data. Ideal for agentic pipelines where untrusted or LLM-generated JSON must be safely parsed without re-invoking a model.

## Known failure modes

- Input JSON is so corrupted that deterministic repair is impossible — returns an error indicating irrecoverable malformation
- Non-JSON content submitted as raw_json — returns validation error
- Payload exceeds size limits — returns a size or timeout error
- Missing required 'raw_json' field — returns a schema validation error

## How this service works

Deterministically repairs malformed or truncated LLM JSON payloads (missing quotes, trailing commas, markdown fences) while scrubbing embedded prompt-injection payloads.

## Output

A repaired and sanitized JSON object with all syntax errors corrected (missing quotes, trailing commas, markdown fences, truncation) and any embedded prompt-injection payloads scrubbed, ready for safe downstream parsing.

## 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"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "raw_json"
     ],
     "properties": {
      "raw_json": {
       "type": "string"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/canaryguard-json-repair-sanitize-83761ef5/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from canaryguard-402.onrender.com](https://www.zero.xyz/host/canaryguard-402.onrender.com/llms.txt)
