Skip to main content

MOSS cryptographic signing integration for AutoGen

Project description

moss-autogen

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

PyPI

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

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_autogen-1.0.0.tar.gz (8.2 kB view details)

Uploaded Source

Built Distribution

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

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

Uploaded Python 3

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

Hashes for moss_autogen-1.0.0.tar.gz
Algorithm Hash digest
SHA256 d83d36056bd16da36ad5aa598a4f22855198448c6eeefa2dc2f147f0684a1afe
MD5 0c8fdc6c94e0e78ab1ddb45b5a9758a3
BLAKE2b-256 035230843ef21afc856c1e94987292ef1911eaceca8295598fe4f1ec1138e105

See more details on using hashes here.

Provenance

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

Publisher: publish.yml on mosscomputing/moss-autogen

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_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

Hashes for moss_autogen-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 daeb64b00bcf7166121a76860df22d5be8ddf73f279122953b4cd997615ecdae
MD5 fdc4577dc9f51242305adef10d4370e0
BLAKE2b-256 144cae31d5dfdfbe42c2395059c1ac116eb5fc6d4cc972f0f619187f23bd54cd

See more details on using hashes here.

Provenance

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

Publisher: publish.yml on mosscomputing/moss-autogen

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