Skip to content
This repository was archived by the owner on Sep 21, 2026. It is now read-only.

Latest commit

 

History

History
33 lines (24 loc) · 893 Bytes

README.md

File metadata and controls

33 lines (24 loc) · 893 Bytes

CodeRifts — Minimal Python Example

Minimal Python script that calls the CodeRifts public preflight endpoint and aborts execution when the API is unsafe.

Quick Start

pip install requests
python main.py

How It Works

  1. Calls GET /api/v1/public/preflight?url=<spec_url> — no API key required
  2. Reads the decision field from the response
  3. If BLOCK → aborts the workflow
  4. If PENDING → retries after 5 seconds
  5. If ALLOW → proceeds with the API call

Example Output

[CODERIFTS] decision: ALLOW
[CODERIFTS] risk_score: 12
[CODERIFTS] safe_for_agent: true
[EXECUTION] Proceeding with API call...

Links