MOSS cryptographic signing integration for Anthropic Claude
Project description
moss-anthropic
MOSS signing integration for Anthropic SDK (Claude). Unsigned output is broken output.
Installation
pip install moss-anthropic
Quick Start
Sign tool use, responses, and text blocks from Claude:
from anthropic import Anthropic
from moss_anthropic import sign_tool_use, sign_response, sign_text
client = Anthropic()
# Get a response with tool use
response = client.messages.create(
model="claude-sonnet-4-20250514",
max_tokens=1024,
messages=[{"role": "user", "content": "What's the weather?"}],
tools=[{"name": "get_weather", "description": "Get weather", ...}]
)
# Sign the full response
result = sign_response(response, agent_id="weather-bot")
print(f"Signed: {result.signature[:20]}...")
# Sign individual tool use blocks
for block in response.content:
if block.type == "tool_use":
result = sign_tool_use(block, agent_id="weather-bot")
Enterprise Mode
Set MOSS_API_KEY for automatic policy evaluation:
import os
os.environ["MOSS_API_KEY"] = "your-api-key"
from moss_anthropic import sign_tool_use, enterprise_enabled
print(f"Enterprise: {enterprise_enabled()}") # True
result = sign_tool_use(
tool_use_block,
agent_id="finance-bot",
context={"user_id": "u123"}
)
if result.blocked:
print(f"Blocked by policy: {result.policy.reason}")
Verification
from moss_anthropic import verify_envelope
verify_result = verify_envelope(result.envelope)
if verify_result.valid:
print(f"Signed by: {verify_result.subject}")
All Functions
| Function | Description |
|---|---|
sign_tool_use() |
Sign a tool use block |
sign_tool_use_async() |
Async version |
sign_response() |
Sign a full Message response |
sign_response_async() |
Async version |
sign_text() |
Sign a text block |
sign_text_async() |
Async version |
sign_message() |
Alias for sign_response |
sign_message_async() |
Async version |
verify_envelope() |
Verify a signed envelope |
Enterprise Features
| Feature | Free | Enterprise |
|---|---|---|
| Local signing | ✓ | ✓ |
| Offline verification | ✓ | ✓ |
| Policy evaluation | - | ✓ |
| Evidence retention | - | ✓ |
| Audit exports | - | ✓ |
Links
- moss-sdk - Core MOSS SDK
- mosscomputing.com - Project site
License
This package is licensed under the Business Source License 1.1.
- Free for evaluation, testing, and development
- Free for non-production use
- Production use requires a MOSS subscription
- Converts to Apache 2.0 on January 25, 2030
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 moss_anthropic-1.0.0.tar.gz.
File metadata
- Download URL: moss_anthropic-1.0.0.tar.gz
- Upload date:
- Size: 5.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
34b390a45f28a00f5bf306b1f51a3ee109c2768b5105ff928a9def89d8f85af3
|
|
| MD5 |
b629e56fe880078cbea49a348465ad84
|
|
| BLAKE2b-256 |
5e3efaf8b169be75529377018c46b2cb66953087cfdb53cf949dff88f3aadfb5
|
Provenance
The following attestation bundles were made for moss_anthropic-1.0.0.tar.gz:
Publisher:
publish.yml on mosscomputing/moss-anthropic
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
moss_anthropic-1.0.0.tar.gz -
Subject digest:
34b390a45f28a00f5bf306b1f51a3ee109c2768b5105ff928a9def89d8f85af3 - Sigstore transparency entry: 854526979
- Sigstore integration time:
-
Permalink:
mosscomputing/moss-anthropic@ac6264244f0a68440b941cd7de48a7d92e69618a -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/mosscomputing
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@ac6264244f0a68440b941cd7de48a7d92e69618a -
Trigger Event:
release
-
Statement type:
File details
Details for the file moss_anthropic-1.0.0-py3-none-any.whl.
File metadata
- Download URL: moss_anthropic-1.0.0-py3-none-any.whl
- Upload date:
- Size: 5.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1afac135eec5c07800824547751ae5a80bb8138e2320d336f12979bacd75736e
|
|
| MD5 |
67af7cb5e6db92c948134010a45fd898
|
|
| BLAKE2b-256 |
dd1454d48c5ac5afb167e0cdb3a451d35cbe5ff42353f03fad7f1892c804dd57
|
Provenance
The following attestation bundles were made for moss_anthropic-1.0.0-py3-none-any.whl:
Publisher:
publish.yml on mosscomputing/moss-anthropic
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
moss_anthropic-1.0.0-py3-none-any.whl -
Subject digest:
1afac135eec5c07800824547751ae5a80bb8138e2320d336f12979bacd75736e - Sigstore transparency entry: 854526983
- Sigstore integration time:
-
Permalink:
mosscomputing/moss-anthropic@ac6264244f0a68440b941cd7de48a7d92e69618a -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/mosscomputing
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@ac6264244f0a68440b941cd7de48a7d92e69618a -
Trigger Event:
release
-
Statement type: