MOSS cryptographic signing integration for LangGraph
Project description
moss-langgraph
MOSS signing integration for LangGraph. Unsigned output is broken output.
Installation
pip install moss-langgraph
Quick Start: Explicit Signing (Recommended)
Sign node outputs, checkpoints, and state transitions:
from moss_langgraph import sign_node_output, sign_checkpoint, sign_state_transition
# Sign a node output
state = {"messages": ["Hello"], "step": 1}
result = sign_node_output(state, agent_id="my-graph", node="processor")
print(f"Signed: {result.signature[:20]}...")
# Sign a checkpoint
checkpoint = {"thread_id": "t1", "values": state}
result = sign_checkpoint(checkpoint, agent_id="my-graph", checkpoint_id="cp_1")
# Sign a state transition
result = sign_state_transition(
from_state={"step": 1},
to_state={"step": 2},
agent_id="my-graph",
from_node="step1",
to_node="step2"
)
Enterprise Mode
Set MOSS_API_KEY for automatic policy evaluation:
import os
os.environ["MOSS_API_KEY"] = "your-api-key"
from moss_langgraph import sign_node_output, enterprise_enabled
print(f"Enterprise: {enterprise_enabled()}") # True
result = sign_node_output(
{"action": "high_value_trade"},
agent_id="trading-graph",
node="executor",
context={"user_id": "u123"}
)
if result.blocked:
print(f"Blocked by policy: {result.policy.reason}")
Verification
from moss_langgraph 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_node_output() |
Sign a node's output state |
sign_node_output_async() |
Async version |
sign_checkpoint() |
Sign a LangGraph checkpoint |
sign_checkpoint_async() |
Async version |
sign_state_transition() |
Sign a state transition |
sign_state_transition_async() |
Async version |
verify_envelope() |
Verify a signed envelope |
Legacy API: Auto-Signing Decorator
The old decorator API is still available:
from langgraph.graph import StateGraph
from moss_langgraph import signed_node, SignedNodeFactory
# Wrap individual nodes
graph.add_node("step", signed_node(my_node, "moss:flow:step"))
# Or use factory for multiple nodes
factory = SignedNodeFactory("moss:flow:pipeline")
graph.add_node("step1", factory.wrap(step1_fn))
graph.add_node("step2", factory.wrap(step2_fn))
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_langgraph-1.0.0.tar.gz.
File metadata
- Download URL: moss_langgraph-1.0.0.tar.gz
- Upload date:
- Size: 7.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3432fe160163ba5b65fdb582fe18a0b2a1451b86c780f9f81668c94cd267cd1b
|
|
| MD5 |
8addcab90aa24025fcd0d5b0fba00feb
|
|
| BLAKE2b-256 |
783a1cacd9c19e56ba71076ed221dcc231dd9d8caa0965ddee257c4f0f1f6ceb
|
Provenance
The following attestation bundles were made for moss_langgraph-1.0.0.tar.gz:
Publisher:
publish.yml on mosscomputing/moss-langgraph
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
moss_langgraph-1.0.0.tar.gz -
Subject digest:
3432fe160163ba5b65fdb582fe18a0b2a1451b86c780f9f81668c94cd267cd1b - Sigstore transparency entry: 854523071
- Sigstore integration time:
-
Permalink:
mosscomputing/moss-langgraph@ea32fcd1d40f1f33691cbc0ee01aae8cd5e570d3 -
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@ea32fcd1d40f1f33691cbc0ee01aae8cd5e570d3 -
Trigger Event:
release
-
Statement type:
File details
Details for the file moss_langgraph-1.0.0-py3-none-any.whl.
File metadata
- Download URL: moss_langgraph-1.0.0-py3-none-any.whl
- Upload date:
- Size: 6.7 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 |
5e77295431197c06cecb2fc92833cc30b73f8919004c3aff345381ff9f45a5df
|
|
| MD5 |
52f41b954c11e06aedbbbf47457221d3
|
|
| BLAKE2b-256 |
ba67936cb1f0273b7f665f6b05c8ac01868c145ffdb5ed1ff39671d38f3f7959
|
Provenance
The following attestation bundles were made for moss_langgraph-1.0.0-py3-none-any.whl:
Publisher:
publish.yml on mosscomputing/moss-langgraph
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
moss_langgraph-1.0.0-py3-none-any.whl -
Subject digest:
5e77295431197c06cecb2fc92833cc30b73f8919004c3aff345381ff9f45a5df - Sigstore transparency entry: 854523073
- Sigstore integration time:
-
Permalink:
mosscomputing/moss-langgraph@ea32fcd1d40f1f33691cbc0ee01aae8cd5e570d3 -
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@ea32fcd1d40f1f33691cbc0ee01aae8cd5e570d3 -
Trigger Event:
release
-
Statement type: