Minimal Node.js script that calls the CodeRifts public preflight endpoint and aborts execution when the API is unsafe.
node index.jsRequires Node.js 18+ (uses built-in fetch).
- Calls
GET /api/v1/public/preflight?url=<spec_url>— no API key required - Reads the
decisionfield from the response - If
BLOCK→ aborts the workflow - If
PENDING→ retries after 5 seconds - If
ALLOW→ proceeds with the API call
[CODERIFTS] decision: ALLOW
[CODERIFTS] risk_score: 12
[CODERIFTS] safe_for_agent: true
[EXECUTION] Proceeding with API call...