# WritersLogic ECMAScript Regex Safety Checker

> WritersLogic ECMAScript Regex Safety Checker is a paid API for AI agents from agents.writerslogic.com, paid per call via x402, $0.005/call, status unknown (last checked 2026-11-19).

Statically analyzes an ECMAScript regular expression for catastrophic backtracking risk and optionally runs test subjects against it when proven safe

## Facts

- Endpoint: POST https://agents.writerslogic.com/api/v1/regex-check?utm_source=zero.xyz
- Price: $0.005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-11-19
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/writerslogic-ecmascript-regex-safety-checker-6268e7dd
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_PdGvdXJGTBmqkyudSJbZB

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 writerslogic-ecmascript-regex-safety-checker-6268e7dd -d '<json body>'
```

Example prompt: Can you check this regex for catastrophic backtracking: `(a+)+b` with the flags `gi`, and test it against the string 'aaaaaaaaac' to see if it matches?

## When to prefer this

Use this endpoint when an AI agent writes, accepts, or forwards user-supplied ECMAScript regular expressions and needs to guard against ReDoS (Regular Expression Denial of Service) before execution. Prefer it over running regexes directly when patterns come from untrusted sources or LLM generation, since static analysis avoids timeouts entirely. It is specifically scoped to ECMAScript regex semantics — do not use it for PCRE, Python re, or other flavors.

## Known failure modes

- Pattern exceeds 500 characters — rejected without analysis
- More than 20 test subjects supplied — request rejected
- Test subjects exceed 1000 characters each or 10000 total — rejected
- Pattern is 'unknown' safety status — test subjects not run, only risk report returned
- Pattern is 'fail' — exponential split reported, no test subjects run
- Unsupported regex flavor or 'v' flag used — reported as unsupported
- Invalid flags characters outside allowed set — validation error

## How this service works

Pay-per-call agents settled in USDC on Base via x402. Every response carries a signed provenance envelope.

## Output

Returns a verdict for the regex: 'pass' (polynomially bounded, safe to run), 'fail' (provably exponential with the specific split named), or 'unknown' (neither proven safe nor unsafe). If safe and test subjects are provided and within length bounds, returns match results for each subject. Reports unsupported features (e.g. the 'v' flag) and any structural risks like nested quantifiers, backreferences, or lookarounds.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "cases": {
   "type": "array",
   "items": {
    "type": "object",
    "required": [
     "subject"
    ],
    "properties": {
     "subject": {
      "type": "string",
      "maxLength": 1000
     },
     "expectMatch": {
      "type": "boolean"
     }
    },
    "additionalProperties": false
   },
   "maxItems": 20,
   "description": "Subjects to test; at most 10000 characters in total."
  },
  "flags": {
   "type": "string",
   "pattern": "^[dgimsuvy]*$",
   "maxLength": 8,
   "description": "Flags among dgimsuy (v is reported unsupported)."
  },
  "pattern": {
   "type": "string",
   "maxLength": 500,
   "description": "ECMAScript regex source, without slashes."
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json"
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/writerslogic-ecmascript-regex-safety-checker-6268e7dd/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from agents.writerslogic.com](https://www.zero.xyz/host/agents.writerslogic.com/llms.txt)
