Python SDK for Sigui Protocol — Autonomous Security for the Agentic Economy
Project description
Sigui SDK — Autonomous Security for AI Agents
Sigui is an open-source security oracle that protects AI agents from sending erroneous or malicious crypto payments.
Add a security evaluation layer to any AI agent in 3 lines of code. Every transaction is analyzed by a 5-layer AI security pipeline (including a fine-tuned Vision Language Model) in < 50 ms before execution.
⚡ The Problem & The Solution
The Problem: Autonomous agents (LangChain, CrewAI, AutoGen) can now execute USDC transfers and interact with DeFi protocols. But a single hallucination, prompt injection, or misconfigured tool means the agent can send $5,000 to the wrong address. There is no middleware to stop it.
The Solution: sigui-sdk intercepts the payment intent, evaluates it against a 5-layer security pipeline, and returns a strict verdict (ALLOW, BLOCK, ESCALATE).
📦 Installation
pip install sigui-sdk
Install the specific extras for the framework you are using:
pip install "sigui-sdk[langchain]" # LangChain & LangGraph
pip install "sigui-sdk[crewai]" # CrewAI
pip install "sigui-sdk[autogen]" # Microsoft AutoGen (AG2)
pip install "sigui-sdk[openai-agents]" # OpenAI Agents SDK
pip install "sigui-sdk[smolagents]" # HuggingFace smolagents
pip install "sigui-sdk[all]" # Install all integrations
🚀 Quickstart (2 lines)
from sigui import SiguiClient
async with SiguiClient(api_url="http://localhost:8000") as client:
result = await client.evaluate(amount=5.0, destination="0xRecipient...")
if result.is_safe:
print(f"✅ Authorized risk={result.risk_score:.3f}")
elif result.is_blocked:
print(f"🚫 Blocked {result.reason}")
else:
print(f"⚠️ Escalation required")
(Note: Sigui requires the backend security engine to be running locally. See the Backend Setup section below).
🧩 Framework Integrations
Sigui provides native Tools for all major agent frameworks. Drop them into your agent's tool list with zero refactoring.
🦜 LangChain / LangGraph
from sigui import SiguiClient
from sigui.integrations.langchain import create_langchain_tool
client = SiguiClient(api_url="http://localhost:8000")
sigui_tool = create_langchain_tool(client, auto_escalate=True)
# Drop into any LangChain agent
agent = initialize_agent(tools=[sigui_tool, ...], llm=llm)
🤖 CrewAI
from sigui import SiguiClientSync
from sigui.integrations.crewai import SiguiEvaluationTool
client = SiguiClientSync(api_url="http://localhost:8000", agent_id="my_crew")
tool = SiguiEvaluationTool(sigui_client=client, auto_escalate=True)
payment_agent = Agent(role="DeFi Agent", tools=[tool], ...)
🧩 Microsoft AutoGen (AG2)
from autogen_agentchat.agents import AssistantAgent
from sigui import SiguiClient
from sigui.integrations.autogen import create_autogen_tool
client = SiguiClient(api_url="http://localhost:8000")
sigui_tool = create_autogen_tool(client, auto_escalate=True)
agent = AssistantAgent(name="payment_agent", tools=[sigui_tool], ...)
🤗 HuggingFace smolagents
from smolagents import CodeAgent
from sigui import SiguiClient
from sigui.integrations.smolagents import SiguiTool
client = SiguiClient(api_url="http://localhost:8000")
tool = SiguiTool(client, auto_escalate=True)
agent = CodeAgent(tools=[tool], model=...)
🛡️ Framework-Agnostic Decorator
If you don't want to use agent Tools, you can gate any async Python function directly:
from sigui.decorators import sigui_protect
client = SiguiClient(api_url="http://localhost:8000")
@sigui_protect(client, amount_arg="usdc", destination_arg="to")
async def transfer(to: str, usdc: float, memo: str = ""):
# This code ONLY executes if Sigui returns ALLOW
await wallet.send(to, usdc)
# Usage (raises SiguiBlockedError if flagged as malicious)
await transfer(to="0xAttacker...", usdc=500.0)
🧠 How it Works: The 5-Layer Pipeline
When your agent calls client.evaluate(), the backend runs a comprehensive security check in under 50ms:
- MemoClaw: Episodic behavioral memory. (Is this agent acting weird compared to its history?)
- Sirige: Rule-based anomaly detection (spikes in amounts, blacklisted addresses).
- Anti-splitting: Cross-chain flow analysis to detect smurfing.
- Imina Na (Vision): A fine-tuned Vision model that renders the transaction graph topology as an image and classifies the attack pattern.
- Kanaga Risk Aggregator: Final risk scoring.
🤗 Open-Source Vision Model & Dataset
The Imina Na vision layer is powered by Qwen2-VL-7B-Instruct, fine-tuned using Unsloth on AMD MI300X GPUs. Both the model and the 1-million sample training dataset are open-source and available on HuggingFace:
- Model: Ibonon/imina_na_v2_lora
- Dataset: Ibonon/sigui-depin-1mn
⚙️ Backend Setup (Required)
sigui-sdk requires the Sigui Security Engine to be running. We do not currently provide a public hosted API.
You can run the backend locally in 2 minutes using Docker:
# 1. Clone the main repository
git clone https://github.com/ibonon/Sigui.git
cd Sigui
# 2. Configure for local dev (no crypto keys required)
cp .env.example .env
# Ensure DEMO_MODE=true is set in .env
# 3. Launch the security oracle
docker compose up
Once running, your SDK can connect to http://localhost:8000.
📄 License
MIT © Sigui Protocol.
Built for the Agentic Economy.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sigui_sdk-0.2.0.tar.gz.
File metadata
- Download URL: sigui_sdk-0.2.0.tar.gz
- Upload date:
- Size: 28.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b5625684bdb08f643a21c4d7284ded7f82d01bd23e215060fffc98f9594df7c3
|
|
| MD5 |
3d2825b931eb21b8d990b2198a27f14e
|
|
| BLAKE2b-256 |
96fa5f81114ebf8d1d632fe953539ec7bcb297bbde584ae42cf2648a52028e91
|
File details
Details for the file sigui_sdk-0.2.0-py3-none-any.whl.
File metadata
- Download URL: sigui_sdk-0.2.0-py3-none-any.whl
- Upload date:
- Size: 43.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0291558382d270ed105d56ad017a8d43804714abd47c5e8d052c49f2e24e649a
|
|
| MD5 |
c152d3cc85ba1f7b61b530720db66249
|
|
| BLAKE2b-256 |
6865f1489b34ebee3b29271c566f28886b5036097ae9b3350d1f57de56143d81
|