MOSS cryptographic signing integration for AutoGen
Project description
moss-autogen
MOSS signing integration for AutoGen. Unsigned output is broken output.
Installation
pip install moss-autogen
Quick Start: Explicit Signing (Recommended)
Sign messages, function results, and conversations:
from autogen import AssistantAgent
from moss_autogen import sign_message, sign_function_result, sign_conversation
# Create your agent
agent = AssistantAgent(name="analyst", llm_config={"model": "gpt-4"})
# Get a reply and sign it
reply = agent.generate_reply(messages=[{"content": "Analyze this"}])
result = sign_message(reply, agent_id="analyst")
print(f"Signed: {result.signature[:20]}...")
# Sign function/tool results
func_result = execute_tool(args)
result = sign_function_result(func_result, agent_id="analyst", function="execute_tool")
# Sign entire conversation
result = sign_conversation(chat_history, agent_id="chat-session")
Enterprise Mode
Set MOSS_API_KEY for automatic policy evaluation:
import os
os.environ["MOSS_API_KEY"] = "your-api-key"
from moss_autogen import sign_message, enterprise_enabled
print(f"Enterprise: {enterprise_enabled()}") # True
result = sign_message(
{"role": "assistant", "content": "Transfer approved"},
agent_id="finance-agent",
context={"user_id": "u123", "action": "transfer"}
)
if result.blocked:
print(f"Blocked by policy: {result.policy.reason}")
Verification
from moss_autogen 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_message() |
Sign a message |
sign_message_async() |
Async version |
sign_function_result() |
Sign tool/function result |
sign_function_result_async() |
Async version |
sign_conversation() |
Sign full conversation |
sign_conversation_async() |
Async version |
sign_reply() |
Sign generate_reply output |
sign_reply_async() |
Async version |
verify_envelope() |
Verify a signed envelope |
Legacy API
The old wrapper API is still available:
from moss_autogen import signed_agent
agent = signed_agent(
AssistantAgent(name="analyst", ...),
"moss:lab:analyst"
)
# agent.moss_envelope available after each reply
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_autogen-1.0.0.tar.gz.
File metadata
- Download URL: moss_autogen-1.0.0.tar.gz
- Upload date:
- Size: 8.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d83d36056bd16da36ad5aa598a4f22855198448c6eeefa2dc2f147f0684a1afe
|
|
| MD5 |
0c8fdc6c94e0e78ab1ddb45b5a9758a3
|
|
| BLAKE2b-256 |
035230843ef21afc856c1e94987292ef1911eaceca8295598fe4f1ec1138e105
|
Provenance
The following attestation bundles were made for moss_autogen-1.0.0.tar.gz:
Publisher:
publish.yml on mosscomputing/moss-autogen
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
moss_autogen-1.0.0.tar.gz -
Subject digest:
d83d36056bd16da36ad5aa598a4f22855198448c6eeefa2dc2f147f0684a1afe - Sigstore transparency entry: 854526769
- Sigstore integration time:
-
Permalink:
mosscomputing/moss-autogen@33953825b0b1a8c881c4b73bda41c28c870e52d0 -
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@33953825b0b1a8c881c4b73bda41c28c870e52d0 -
Trigger Event:
release
-
Statement type:
File details
Details for the file moss_autogen-1.0.0-py3-none-any.whl.
File metadata
- Download URL: moss_autogen-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 |
daeb64b00bcf7166121a76860df22d5be8ddf73f279122953b4cd997615ecdae
|
|
| MD5 |
fdc4577dc9f51242305adef10d4370e0
|
|
| BLAKE2b-256 |
144cae31d5dfdfbe42c2395059c1ac116eb5fc6d4cc972f0f619187f23bd54cd
|
Provenance
The following attestation bundles were made for moss_autogen-1.0.0-py3-none-any.whl:
Publisher:
publish.yml on mosscomputing/moss-autogen
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
moss_autogen-1.0.0-py3-none-any.whl -
Subject digest:
daeb64b00bcf7166121a76860df22d5be8ddf73f279122953b4cd997615ecdae - Sigstore transparency entry: 854526770
- Sigstore integration time:
-
Permalink:
mosscomputing/moss-autogen@33953825b0b1a8c881c4b73bda41c28c870e52d0 -
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@33953825b0b1a8c881c4b73bda41c28c870e52d0 -
Trigger Event:
release
-
Statement type: