# BRAINIAC Error Propagation Audit API

> BRAINIAC Error Propagation Audit API is a paid API for AI agents from www.brainiac.software, paid per call via x402, $0.04/call, status unknown (last checked 2026-11-14).

Statically analyzes source code files to detect error-propagation anti-patterns such as empty catch blocks and swallowed promise rejections

## Facts

- Endpoint: POST https://www.brainiac.software/api/v1/code/error-propagation-audit?utm_source=zero.xyz
- Price: $0.04/call
- Payment: x402
- Status: unknown
- Last checked: 2026-11-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/brainiac-error-propagation-audit-api-d199293d
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_K7UPcXwwloi27hLDDEWmt

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 brainiac-error-propagation-audit-api-d199293d -d '<json body>'
```

Example prompt: Can you audit these TypeScript files for error-propagation issues — specifically look for empty catch blocks, swallowed promise rejections, or any place where exceptions are being silently ignored, and tell me the severity and how to fix each one?

## When to prefer this

Choose this endpoint when you need a fast, pay-per-call, accountless static audit of error-handling patterns across JavaScript, TypeScript, Python, or Go files. It is ideal for CI pipeline gates, pre-merge reviews, or legacy code triage where you want line-level findings with severity and remediation hints without setting up a full SAST tool. It is not a compiler or symbolic executor, so prefer a full static analysis suite if you need data-flow analysis or cross-file propagation tracking.

## Known failure modes

- Files array is empty or missing — returns validation error
- Individual file source exceeds 100,000 character limit — rejected
- More than 200 files submitted — request rejected
- Unsupported language enum value — validation error
- Network or payment failure via x402 — HTTP 402 or timeout
- Pattern matcher may produce false positives or miss complex multi-file error propagation chains

## How this service works

Pay-per-call APIs for AI agents: OFAC sanctions screening, compliance checks, token security, and Base chain data via x402. No account. Fixed USDC price. MCP-ready.

## Output

Returns a JSON object containing a summary (file count, total findings), an array of findings each with a code (e.g. 'empty_catch'), file path, line number, evidence snippets, severity level, and remediation advice, plus explanatory caveats about the analysis method (textual pattern matching, not execution).

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "files": {
   "type": "array",
   "items": {
    "type": "object",
    "required": [
     "path",
     "source"
    ],
    "properties": {
     "path": {
      "type": "string",
      "maxLength": 260,
      "minLength": 1
     },
     "source": {
      "type": "string",
      "maxLength": 100000,
      "minLength": 1
     },
     "language": {
      "enum": [
       "javascript",
       "typescript",
       "python",
       "go",
       "other"
      ],
      "type": "string"
     }
    },
    "additionalProperties": false
   },
   "maxItems": 200,
   "minItems": 1
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "summary": {
   "files": 1,
   "findings": 2
  },
  "findings": [
   {
    "code": "empty_catch",
    "line": 4,
    "path": "svc.ts",
    "evidence": [
     "svc.ts:4 has an empty catch block."
    ],
    "severity": "high",
    "remediation": "Log, wrap, or rethrow the error; do not swallow it silently."
   },
   {
    "code": "swallowed_promise_rejection",
    "line": 5,
    "path": "svc.ts",
    "evidence": [
     "svc.ts:5 attaches a no-op promise catch."
    ],
    "severity": "high",
    "remediation": "Propagate or handle the rejection with a real error path."
   }
  ],
  "explanations": [
   "Error-propagation findings are textual pattern matches. The code is not compiled, executed, or symbolically interpreted.",
   "Absence of a finding is not proof that error handling is complete."
  ]
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/brainiac-error-propagation-audit-api-d199293d/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from www.brainiac.software](https://www.zero.xyz/host/www.brainiac.software/llms.txt)
