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.
- 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.
pip install signet-ai
python
from signet import AgentState, StateMachineGuard, StateStatus
from pydantic import Field
from typing import Dict
class RefundState(AgentState):
data: Dict[str, int] = Field(..., description="Must contain 'amount'")
REFUND_GRAPH = {
"START": ["ANALYZING"],
"ANALYZING": ["APPROVED", "DENIED"],
"APPROVED": [],
"DENIED": []
}
python
from signet.middleware import SignetClient
import openai
guard = StateMachineGuard(RefundState, REFUND_GRAPH)
client = SignetClient(openai.Client(), guard)
final_state = client.run(
messages=[{"role": "user", "content": "Process a refund for $50"}],
model="gpt-4"
)
print(f"Signed: {final_state.signature}")
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
Existing frameworks (LangGraph, AutoGen) manage memory. Signet manages trust. Use Signet when you need to ensure that your agent followed the rules.