Metadata-Version: 2.4
Name: signet-auth
Version: 0.10.0
Classifier: Programming Language :: Rust
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Requires-Dist: langchain-core>=0.2 ; extra == 'all'
Requires-Dist: llama-index-core>=0.10 ; extra == 'all'
Requires-Dist: google-adk>=0.1 ; extra == 'all'
Requires-Dist: pydantic-ai>=0.1 ; extra == 'all'
Requires-Dist: semantic-kernel>=1.0 ; extra == 'all'
Requires-Dist: smolagents>=0.1 ; extra == 'all'
Requires-Dist: openai-agents>=0.1 ; extra == 'all'
Requires-Dist: autogen-agentchat>=0.2 ; extra == 'all'
Requires-Dist: crewai>=0.1 ; extra == 'all'
Requires-Dist: autogen-agentchat>=0.2 ; extra == 'autogen'
Requires-Dist: crewai>=0.1 ; extra == 'crewai'
Requires-Dist: google-adk>=0.1 ; extra == 'google-adk'
Requires-Dist: langchain-core>=0.2 ; extra == 'langchain'
Requires-Dist: langchain-core>=0.2 ; extra == 'langgraph'
Requires-Dist: llama-index-core>=0.10 ; extra == 'llamaindex'
Requires-Dist: openai-agents>=0.1 ; extra == 'openai-agents'
Requires-Dist: pydantic-ai>=0.1 ; extra == 'pydantic-ai'
Requires-Dist: semantic-kernel>=1.0 ; extra == 'semantic-kernel'
Requires-Dist: smolagents>=0.1 ; extra == 'smolagents'
Provides-Extra: all
Provides-Extra: autogen
Provides-Extra: crewai
Provides-Extra: google-adk
Provides-Extra: langchain
Provides-Extra: langgraph
Provides-Extra: llamaindex
Provides-Extra: openai-agents
Provides-Extra: pydantic-ai
Provides-Extra: semantic-kernel
Provides-Extra: smolagents
Summary: Cryptographic action receipts for AI agents
License-Expression: Apache-2.0 OR MIT
Requires-Python: >=3.10
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM

# signet-auth

Cryptographic action receipts for AI agents. Sign every tool call with Ed25519 — works with LangChain, LangGraph, LlamaIndex, Google ADK, Pydantic AI, Smolagents, Semantic Kernel, OpenAI Agents, AutoGen, CrewAI, and more.

[![PyPI](https://img.shields.io/pypi/v/signet-auth?style=flat-square)](https://pypi.org/project/signet-auth/)
[![GitHub Stars](https://img.shields.io/github/stars/Prismer-AI/signet?style=flat-square&color=yellow)](https://github.com/Prismer-AI/signet)

## Install

```bash
pip install signet-auth
```

## Quick Start

```python
from signet_auth import SigningAgent

agent = SigningAgent.create("my-bot", owner="alice")
receipt = agent.sign("web_search", params={"query": "signet"}, target="mcp://local")
print(receipt.id)
```

## Decorator Entry Point

For plain Python tools, the easiest way to adopt Signet is the decorator layer:

```python
from signet_auth import SigningAgent, signet_tool

agent = SigningAgent.create("tool-bot", owner="alice")

@signet_tool(
    agent=agent,
    target="mcp://github.prod",
    audit_encrypt_params=True,
)
def create_issue(title: str, repo: str) -> str:
    return f"{repo}:{title}"
```

`@signet_tool` also supports:

- async tool functions
- custom `tool_name`
- explicit `transport`
- `on_sign_error="warn" | "raise"`

## MCP Server Verification

If you enforce Signet at the execution boundary, use `verify_request()` with a durable nonce backend:

```python
from signet_auth import FileNonceChecker, VerifyOptions, verify_request

nonce_checker = FileNonceChecker(".signet/nonces.json")
opts = VerifyOptions(
    trusted_keys=["ed25519:..."],
    expected_target="mcp://github.prod",
    nonce_checker=nonce_checker,
)

result = verify_request(request_params, opts)
if not result.ok:
    raise ValueError(result.error or "verification failed")
if not result.trusted:
    raise ValueError("untrusted signer")
```

`ServerVerifyResult` tells you both whether a receipt was present (`has_receipt`) and whether the signer was anchored to trust (`trusted`). `FileNonceChecker` is the default single-host pilot shape; `InMemoryNonceChecker` is still useful for tests and demos.

## Framework Integrations

| Framework | Import |
|-----------|--------|
| LangChain / LangGraph | `from signet_auth.langchain import SignetCallbackHandler` |
| LlamaIndex | `from signet_auth.llamaindex import SignetEventHandler` |
| Google ADK | `from signet_auth.google_adk import SignetPlugin` |
| OpenAI Agents SDK | `from signet_auth.openai_agents import SignetAgentHooks` |
| Pydantic AI | `from signet_auth.pydantic_ai import SignetMiddleware` |
| Semantic Kernel | `from signet_auth.semantic_kernel import SignetFunctionFilter` |
| Smolagents | `from signet_auth.smolagents import SignetStepCallback` |
| AutoGen | `from signet_auth.autogen import SignetAutogenHook` |
| CrewAI | `from signet_auth.crewai import SignetCrewCallback` |

Install with framework extras:

```bash
pip install signet-auth[langchain]     # LangChain / LangGraph
pip install signet-auth[llamaindex]    # LlamaIndex
pip install signet-auth[google-adk]    # Google ADK
pip install signet-auth[pydantic-ai]   # Pydantic AI
pip install signet-auth[semantic-kernel] # Semantic Kernel
pip install signet-auth[all]           # All frameworks
```

## Links

- [Full documentation & source](https://github.com/Prismer-AI/signet)
- [npm (@signet-auth/core)](https://www.npmjs.com/package/@signet-auth/core)
- [Rust (signet-core)](https://crates.io/crates/signet-core)

If Signet is useful to you, [star us on GitHub](https://github.com/Prismer-AI/signet) — it helps others discover the project.

