Skip to main content

MOSS cryptographic signing integration for LangGraph

Project description

moss-langgraph

MOSS signing integration for LangGraph. Unsigned output is broken output.

PyPI

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

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


Download files

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

Source Distribution

moss_langgraph-1.0.0.tar.gz (7.8 kB view details)

Uploaded Source

Built Distribution

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

moss_langgraph-1.0.0-py3-none-any.whl (6.7 kB view details)

Uploaded Python 3

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

Hashes for moss_langgraph-1.0.0.tar.gz
Algorithm Hash digest
SHA256 3432fe160163ba5b65fdb582fe18a0b2a1451b86c780f9f81668c94cd267cd1b
MD5 8addcab90aa24025fcd0d5b0fba00feb
BLAKE2b-256 783a1cacd9c19e56ba71076ed221dcc231dd9d8caa0965ddee257c4f0f1f6ceb

See more details on using hashes here.

Provenance

The following attestation bundles were made for moss_langgraph-1.0.0.tar.gz:

Publisher: publish.yml on mosscomputing/moss-langgraph

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for moss_langgraph-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5e77295431197c06cecb2fc92833cc30b73f8919004c3aff345381ff9f45a5df
MD5 52f41b954c11e06aedbbbf47457221d3
BLAKE2b-256 ba67936cb1f0273b7f665f6b05c8ac01868c145ffdb5ed1ff39671d38f3f7959

See more details on using hashes here.

Provenance

The following attestation bundles were made for moss_langgraph-1.0.0-py3-none-any.whl:

Publisher: publish.yml on mosscomputing/moss-langgraph

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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