Cryptographic state enforcement for AI Agents.
Project description
🔐 Signet (signet-ai)
Cryptographic State Enforcement for AI Agents.
Problem: LLMs are probabilistic. They hallucinate. Solution: Signet is deterministic. It forces your agent to adhere to a strict Cryptographic State Machine.
If your agent tries to output a state that violates your business logic (e.g., refunding > $100) or your process graph (e.g., skipping "Approval"), Signet blocks it and auto-corrects the LLM.
🚀 Features
- Graph Enforcement: Define valid transitions (START -> ANALYZING -> APPROVED). Signet blocks illegal jumps.
- Self-Healing Middleware: Automatically retries LLM calls with error feedback when hallucinations occur.
- Tamper-Proof Logs: Every state transition is cryptographically signed (Ed25519).
- Visual Debugger: Includes a local Streamlit dashboard to visualize your agent's logic.
📦 Installation
pip install signet-ai
⚡ Quick Start
1. Define your Logic
from signet import AgentState, StateMachineGuard, StateStatus
from pydantic import Field
from typing import Dict
class RefundState(AgentState):
# Enforce strict types on your data
data: Dict[str, int] = Field(..., description="Must contain 'amount'")
# Define valid moves
REFUND_GRAPH = {
"START": ["ANALYZING"],
"ANALYZING": ["APPROVED", "DENIED"],
"APPROVED": [],
"DENIED": []
}
2. Wrap your LLM (Self-Healing)
from signet.middleware import SignetClient
import openai
guard = StateMachineGuard(RefundState, REFUND_GRAPH)
client = SignetClient(openai.Client(), guard)
# Run the agent
# If the LLM tries to skip steps or output bad JSON,
# Signet catches it, feeds the error back, and retries automatically.
final_state = client.run(
messages=[{"role": "user", "content": "Process a refund for $50"}],
model="gpt-4"
)
print(f"Signed: {final_state.signature}")
📊 Visual Debugger
Signet comes with a built-in dashboard to test your graph logic.
- Create a file
viz.py(see examples folder). - Run:
streamlit run viz.py
🛡️ The "Why"
Existing frameworks (LangGraph, AutoGen) manage memory. Signet manages trust. Use Signet when you need to ensure that your agent followed the rules.
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 signet_ai-0.1.0.tar.gz.
File metadata
- Download URL: signet_ai-0.1.0.tar.gz
- Upload date:
- Size: 6.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b26111ef5ec96eb33e0b4595a37a409880bebb473718429ca4c65df48486421a
|
|
| MD5 |
6bd5ab5ad28a6d91d895284c451df305
|
|
| BLAKE2b-256 |
e0a3f308bc9fabcd10257a219331a5a8934043c40d7ebc7301371c268f7e1ba6
|
File details
Details for the file signet_ai-0.1.0-py3-none-any.whl.
File metadata
- Download URL: signet_ai-0.1.0-py3-none-any.whl
- Upload date:
- Size: 6.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
507ff08183d56313a669c3dc2b259ada1382200de4d28c49e2d0b3962e6b357a
|
|
| MD5 |
f3487e6aeabc5a059c64b28639436b27
|
|
| BLAKE2b-256 |
22f86bb5b6c767a252a4e075cf7feff6bf6199a05d49266eba281418cb5d4943
|