Skip to main content

decionis-autogen

Add a Decionis policy decision immediately before an AutoGen tool executes. The package supports the current AutoGen Core tool interface and the legacy AutoGen 0.2 UserProxyAgent execution hook.

Current AutoGen

pip install decionis-autogen
from autogen_core.tools import FunctionTool
from decionis import DecionisClient
from decionis_autogen import guard_tool

refund_tool = FunctionTool(send_refund, description="Issue a customer refund.")
guarded_refund = guard_tool(
    inner_tool=refund_tool,
    client=DecionisClient(api_key="..."),
    tenant_id="your-org-uuid",
    workflow_key="refund_execution",
    site_base_url="https://decionis.com",
)

agent = AssistantAgent(..., tools=[guarded_refund])

The wrapper preserves the inner tool schema. An ALLOW verdict delegates to the tool. BLOCK, REVIEW_REQUIRED, and ESCALATE raise DecionisToolRefusal before the side effect runs.

AutoGen 0.2 UserProxyAgent

The requested execute_function interception applies to AutoGen 0.2. Install the legacy extra on Python 3.10–3.12:

pip install 'decionis-autogen[legacy]'
from decionis import DecionisClient
from decionis_autogen import DecionisUserProxyAgent

executor = DecionisUserProxyAgent(
    "executor",
    decionis_client=DecionisClient(api_key="..."),
    tenant_id="your-org-uuid",
    function_map={"send_refund": send_refund},
    human_input_mode="NEVER",
)

The subclass overrides both execute_function and a_execute_function. A blocked call returns a structured function error with the dossier id and never invokes the registered function.

For either API, set shadow_mode=True to record would-block verdicts while still executing the inner tool. The tool also runs in shadow mode when the decision request fails (a timeout, an HTTP error, no connection): the guard logs a warning and passes the failure to on_decision as error, with decision=None. Enforcement is fail closed: evaluation errors do not silently fall through to the tool.

Compatibility: Python 3.10+, AutoGen Core 0.4–0.7; legacy AutoGen AgentChat 0.2 on Python 3.10–3.12.

Release files for decionis-autogen 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for decionis-autogen 0.2.0
File Size Uploaded
decionis_autogen-0.2.0.tar.gz 8.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for decionis-autogen 0.2.0
File Interpreter ABI Platform
decionis_autogen-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 16.6 kB

Release files / decionis_autogen-0.2.0.tar.gz

Download URL decionis_autogen-0.2.0.tar.gz
Size 8.7 kB
Tags Source
SHA-256 checksum
How to use checksums
2b17bee9c0b5141624e9abe565aad32d661f593c0ff179a8b65b59c9975331b2
BLAKE2b-256 checksum
How to use checksums
28a43b37f6f2e677985e4fea2bc25dd9727ceeed6ac8e3254ef0157f74e46455
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.10

Release files / decionis_autogen-0.2.0-py3-none-any.whl

Download URL decionis_autogen-0.2.0-py3-none-any.whl
Size 7.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
427f907b51cfa89f71da4c9dd25f783ca76467e9eb42caa43ba97ea6cdfa31de
BLAKE2b-256 checksum
How to use checksums
9ba02fa2c26434fb1cf484a3e86a9fac064ac58a8b2145c27369776d72f73915
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.10

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page