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

Latest commit

 

History

History
39 lines (29 loc) · 970 Bytes

README.md

File metadata and controls

39 lines (29 loc) · 970 Bytes

CodeRifts — AutoGen Integration Example

Demonstrates how to add CodeRifts enforcement to an AutoGen multi-agent conversation using a termination check and tool guard.

Quick Start

pip install requests
python main.py

Two Enforcement Patterns

1. Termination Check

def coderifts_termination_check(message):
    decision = coderifts_preflight(message["spec_url"])
    if decision["decision"] == "BLOCK":
        return True  # Stop the conversation
    return False

2. Tool Guard

def api_tool(spec_url):
    decision = coderifts_preflight(spec_url)
    if decision["decision"] == "BLOCK":
        raise RuntimeError("CodeRifts BLOCK")
    return "API call succeeded"

Links