Metadata-Version: 2.5
Name: decionis-crewai
Version: 0.2.0
Summary: Gate CrewAI tool calls on a signed Decionis Decision Dossier before execution.
Project-URL: Homepage, https://decionis.com
Project-URL: Documentation, https://decionis.ai/adapters/crewai
Author-email: Decionis <sdk@decionis.ai>
License: MIT
Keywords: agent,audit,crewai,decionis,execution-gate,governance,policy,tool
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT 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: Programming Language :: Python :: 3.13
Classifier: Topic :: Software Development :: Libraries
Classifier: Typing :: Typed
Requires-Python: <3.14,>=3.10
Requires-Dist: crewai<2,>=1.0
Requires-Dist: decionis>=0.2
Requires-Dist: pydantic>=2.7
Provides-Extra: lint
Requires-Dist: mypy>=1.10; extra == 'lint'
Requires-Dist: ruff>=0.5; extra == 'lint'
Provides-Extra: test
Requires-Dist: pytest>=8; extra == 'test'
Description-Content-Type: text/markdown

# `decionis-crewai`

Gate any CrewAI tool call before its side effect runs. The wrapper preserves the inner
tool's name, description, and Pydantic argument schema, so the agent sees the same tool while
Decionis evaluates the proposed payload against an organization policy.

```bash
pip install decionis-crewai
```

```python
from decionis import DecionisClient
from decionis_crewai import DecionisGuardedTool

client = DecionisClient(api_key="...", base_url="https://api.decionis.com")
guarded_refund = DecionisGuardedTool.wrap(
    inner_tool=send_refund,
    client=client,
    tenant_id="your-org-uuid",
    workflow_key="refund_execution",
    site_base_url="https://decionis.com",
)

refund_agent = Agent(..., tools=[guarded_refund])
```

`ALLOW` runs the inner tool. `BLOCK`, `REVIEW_REQUIRED`, `ESCALATE`, and `ERROR` raise a
`DecionisGuardRefusal` before the inner tool runs and carry the Decision Dossier id and verify URL.
If the decision request itself fails (a timeout, an HTTP error, no connection), its error is raised
and the inner tool does not run: enforcement is fail closed.

Start observe-only without changing agent behavior:

```python
guarded_refund = DecionisGuardedTool.wrap(
    inner_tool=send_refund,
    client=client,
    tenant_id="your-org-uuid",
    workflow_key="refund_execution",
    shadow_mode=True,
)
```

In Shadow Mode every verdict is recorded, including would-block outcomes, but the inner tool still
runs. It also runs when the decision request fails: the guard logs a warning and passes the failure
to `on_decision` as `error`, with `decision=None`. Remove `shadow_mode=True` once the recorded
verdicts match the policy you meant.

Compatibility: Python 3.10–3.13, CrewAI 1.x, and `decionis` 0.2 or later.
