Metadata-Version: 2.4
Name: correctover-ibex
Version: 0.1.1
Summary: Correctover 6-Dimensional Verification adapter for Ibex Agent Verification (ActionEnvelopeV1)
Project-URL: Homepage, https://github.com/Correctover/correctover-ibex
Project-URL: Standards, https://github.com/Correctover/correctover-crewai/blob/main/STANDARDS.md
Project-URL: Conformance, https://api.babyblueviper.com/conformance
Project-URL: Ibex, https://github.com/safal207/ibex-agent-verification
Author-email: Guigui Wang <wanggui.gui@neuralbridge.cn>
License-Expression: Apache-2.0
License-File: LICENSE
Keywords: action-envelope,agent-verification,ai-safety,correctover,evaluation,ibex,llm,verification
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Software Development :: Testing
Requires-Python: >=3.10
Requires-Dist: correctover-crewai>=0.1.0
Provides-Extra: dev
Requires-Dist: pytest>=7.0; extra == 'dev'
Provides-Extra: ibex
Requires-Dist: ibex-agent-verification>=0.8.0; extra == 'ibex'
Description-Content-Type: text/markdown

# correctover-ibex

**6-Dimensional Verification for Ibex Agent Verification**

> Built against ActionEnvelopeV1 at `ibex-agent-verification@e2a2cb2`

Bridges [Correctover](https://github.com/Correctover/correctover-crewai)'s deterministic verification engine (87 rules across 6 dimensions) with [Ibex Agent Verification](https://github.com/safal207/ibex-agent-verification)'s ActionEnvelopeV1 tamper-evident framework.

## 30-Second Quick Start

```python
from correctover_ibex import CorrectoverIbexVerifier
from correctover_crewai import VerificationRequest

verifier = CorrectoverIbexVerifier()
result = verifier.verify(request)
print(result.ibex_decision)  # ALLOW / BLOCK / ESCALATE
print(result.action_id)      # sha256:... (tamper-evident, recomputable)
```

## Architecture

```
Ibex (pre-execution authorization)
    ↓ ActionEnvelopeV1 freezes action identity
Correctover (post-execution verification)
    ↓ 87 rules × 6 dimensions verified
GuardrailDecision binds verdict to action
    ↓ canonical IDs via JCS + SHA-256
Tamper-evident verification chain
```

## Why This Matters

Ibex Agent Verification (by Aleksey Safonov) solves **pre-execution authorization**: "Should this agent be allowed to perform this action with these arguments?" It uses ActionEnvelopeV1 to create tamper-evident action identities via JCS canonical JSON and SHA-256.

Correctover solves **post-execution verification**: "Did the agent's output pass structural, schema, identity, integrity, latency, and cost checks?" It runs 87 deterministic rules across 6 dimensions.

**correctover-ibex** bridges both systems:
- Each Correctover verification is bound to an exact ActionEnvelopeV1
- The verdict is expressed as an Ibex GuardrailDecision
- All identifiers are recomputable — verify the verifier

## Install

```bash
pip install correctover-ibex
```

## Quick Start

```python
from correctover_ibex import CorrectoverIbexVerifier, CorrectoverIbexConfig
from correctover_crewai import VerificationRequest

# Configure
config = CorrectoverIbexConfig(
    caller_identity="agent:qa",
    resource_scope="workspace:production",
    min_confidence=0.7,
)
verifier = CorrectoverIbexVerifier(config)

# Verify an action
request = VerificationRequest(
    tool_name="search_web",
    tool_input={"query": "AI safety standards"},
    tool_output="AI safety is a field of computer science...",
    agent_role="Researcher",
    task_description="Search for AI safety info",
    provider_name="openai",
    model_name="gpt-4",
)

result = verifier.verify(request)

# Tamper-evident identifiers
print(result.action_id)      # sha256:325d87f3... (recomputable)
print(result.decision_id)    # sha256:a1b2c3d4... (recomputable)

# Ibex guardrail decision
print(result.ibex_decision)  # ALLOW | BLOCK | ESCALATE

# Full 6-dim breakdown
print(result.verdict.confidence)          # 0.85
print(result.verdict.dimensions)          # {structure, schema, latency, cost, identity, integrity}
print(result.verdict.proof_hash)          # Recomputable proof of verification
```

## Transition Phase (Multi-Step Workflows)

```python
from correctover_ibex import build_transition_record, evaluate_transition_record

# Verify a sequence of actions
results = [verifier.verify(req) for req in requests]

# Build transition record
record = build_transition_record(
    transition_id="workflow-001",
    results=results,
    intent_statement="Complete multi-step research task",
    origin="correctover",
    destination="verified",
)

# Evaluate transition
evaluation = evaluate_transition_record(record)
print(evaluation["status"])  # VERIFIED | IN_PROGRESS | RECALIBRATE
print(evaluation["phase"])   # CALIBRATE → EXPAND → COMMIT → EXECUTE → VERIFY → REFLECT
```

## The 6 Dimensions

| Dimension | What It Checks | Example |
|-----------|---------------|---------|
| **Structure** | Output format validity | JSON parses correctly |
| **Schema** | Field presence & types | Required fields exist |
| **Identity** | Semantic relevance to input | Response addresses the question |
| **Integrity** | Forbidden pattern absence | No Tracebacks or errors |
| **Latency** | Response time budget | Under 30s threshold |
| **Cost** | Token usage budget | Under 10k token limit |

## CANON

| Metric | Value |
|--------|-------|
| P50 Verification Latency | 22μs |
| Verification Rules | 87 |
| Dimensions | 6 |
| SDK Size | 586KB |
| Supported Providers | 7 |

## Standards & Conformance

- [STANDARDS.md](https://github.com/Correctover/correctover-crewai/blob/main/STANDARDS.md)
- [Conformance Board](https://api.babyblueviper.com/conformance)
- [Ibex Agent Verification](https://github.com/safal207/ibex-agent-verification)
- [ActionEnvelopeV1 Specification (PR #64)](https://github.com/safal207/ibex-agent-verification/pull/64)

## Conformance Test Results

```
47 passed in 1.69s

Key results:
✅ test_conformance_vector_canonical_id — ibex official hash match
   Preimage → sha256:325d87f3a89db334374b25f839c6dfcf528fac357b7c554b01a1486a570522c7
✅ test_expired_deadline_blocks — expired deadline → BLOCK (short-circuit)
✅ test_future_deadline_passes_through — future deadline → normal verification
✅ test_custom_args_digest — caller-supplied digest used
✅ test_d1_depth_propagation — D1 depth correctly reflected
✅ test_d2_depth_propagation — D2 depth correctly reflected
✅ test_modified_envelope_different_id — tamper-evidence verified
✅ test_modified_decision_different_id — tamper-evidence verified
```

## License

Apache-2.0

---

**Correctover — Failover ≠ Correctover™**
