Metadata-Version: 2.4
Name: quesen-crewai
Version: 0.3.0
Summary: Official CrewAI tool wrapper for Quesen — deterministic A2A risk validation for CrewAI agents and crews.
Author: Senueren Bureau
License: MIT
Project-URL: Homepage, https://senueren.co.za/quesen
Project-URL: Source, https://github.com/Shxnque/quesen-crewai
Keywords: quesen,crewai,a2a,agents,risk
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Intended Audience :: Developers
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Requires-Dist: quesen-sdk>=0.4.1
Requires-Dist: crewai-tools>=0.4.0
Requires-Dist: pydantic>=2.5

# Quesen — CrewAI Tool

> Deterministic **Agent Firewall** + A2A risk validation as CrewAI `BaseTool`s. Drop it on any Agent, any Crew.

**Status:** v0.3.0 · tracks Quesen engine v1.10.0 (TSC v2 firewall) · requires `quesen-sdk>=0.4.1`.
**Developer portal:** https://senueren.co.za/quesen · **Source:** https://github.com/Shxnque/quesen

---

## Agent Firewall (no signup)

```python
from quesen_crewai import QuesenFirewallTool

firewall = QuesenFirewallTool(
    base_url="https://web-production-aa5ba.up.railway.app", sandbox=True,
)
# Attach to any CrewAI Agent's tools=[...]; deterministic PASS/REVIEW/BLOCK/SKIP.
```


---

## Install

```bash
pip install quesen-crewai
# or:
pip install git+https://github.com/Shxnque/quesen-crewai.git
```

## 30-second usage

```python
from crewai import Agent, Task, Crew
from quesen_crewai import QuesenValidateTool, QuesenReportTool

defender = Agent(
    role="Risk Officer",
    goal="Prevent the trading agent from touching rugpulls.",
    backstory="You block any action that Quesen labels SKIP.",
    tools=[QuesenValidateTool(base_url="https://<your-quesen>", api_key="sk_live_abc")],
)

check = Task(
    description="Validate this opportunity: domain_age_days=1, engagement_ratio=0.95, scam_keyword_count=4",
    agent=defender,
    expected_output="A PROCEED / REVIEW / SKIP decision with risk_score and conflict_triggers.",
)

crew = Crew(agents=[defender], tasks=[check])
print(crew.kickoff())
```

## Receipt provenance (v1.10)

Calling `QuesenValidateTool._run(...)` returns the raw response dict from the
underlying `quesen-sdk` client. Against a v1.10.0+ engine that dict includes:

- `input_snapshot_hash` — SHA-256 over canonical request JSON.
- `commit_sha` — git SHA of the ruleset live at decision time (or `"unknown"`).

Both flow through untouched for CrewAI callers to log or verify. See the
[public API reference](https://github.com/Shxnque/quesen/blob/main/docs/api-reference.md#receipt-provenance-v110)
for the contract.

## Tools shipped

- `QuesenValidateTool` — wraps `/validate`
- `QuesenSimulateTool` — wraps `/simulate`
- `QuesenReportTool`   — wraps `/report` (v1.1 schema)

MIT license. See [`senueren.co.za/quesen`](https://senueren.co.za/quesen) for canonical documentation.
