Skip to main content

Cryptographic state enforcement for AI Agents.

Project description

🔐 Signet (signet-ai)

Cryptographic State Enforcement for AI Agents.

PyPI version License: MIT

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.

  1. Create a file viz.py (see examples folder).
  2. 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

signet_ai-0.1.0.tar.gz (6.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

signet_ai-0.1.0-py3-none-any.whl (6.3 kB view details)

Uploaded Python 3

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

Hashes for signet_ai-0.1.0.tar.gz
Algorithm Hash digest
SHA256 b26111ef5ec96eb33e0b4595a37a409880bebb473718429ca4c65df48486421a
MD5 6bd5ab5ad28a6d91d895284c451df305
BLAKE2b-256 e0a3f308bc9fabcd10257a219331a5a8934043c40d7ebc7301371c268f7e1ba6

See more details on using hashes here.

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

Hashes for signet_ai-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 507ff08183d56313a669c3dc2b259ada1382200de4d28c49e2d0b3962e6b357a
MD5 f3487e6aeabc5a059c64b28639436b27
BLAKE2b-256 22f86bb5b6c767a252a4e075cf7feff6bf6199a05d49266eba281418cb5d4943

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page