Skip to main content

Agent framework integrations for Sigmodx audit infrastructure

Project description

sigmodx-integrations

Agent framework integrations for Sigmodx — audit infrastructure for AI agents making consequential decisions.

Installation

pip install sigmodx-integrations

LangChain (Live)

Register one callback. Every agent tool call is automatically logged to Sigmodx with cryptographic attestation.

from sigmodx import SigmodxClient
from sigmodx_integrations import SigmodxCallbackHandler, ANOMALY_DETECTION_CONFIG

client = SigmodxClient(
    api_key="your-api-key",
    agent_id="your-agent-uuid",
)

handler = SigmodxCallbackHandler(
    client=client,
    config=ANOMALY_DETECTION_CONFIG,
)

result = agent_executor.invoke(
    {"input": "Check transaction TXN-2026-4421"},
    config={"callbacks": [handler]},
)

The handler:

  • Hashes tool inputs client-side (your data never leaves your environment)
  • Extracts decision type, rationale, and metadata from tool output
  • Submits the decision to Sigmodx's append-only audit trail
  • Never blocks agent execution — errors are logged, not raised

LangGraph (Live)

Two integration patterns — use whichever fits your graph structure.

Pattern 1: Stream event handler (recommended)

Process events from .astream_events() to log all tool calls automatically.

from sigmodx import SigmodxClient
from sigmodx_integrations.langgraph import (
    SigmodxLangGraphCallback,
    LANGGRAPH_ANOMALY_CONFIG
)

client = SigmodxClient(api_key="...", agent_id="...")
handler = SigmodxLangGraphCallback(
    client=client,
    config=LANGGRAPH_ANOMALY_CONFIG
)

# Process stream events
async for event in graph.astream_events(inputs, version="v2"):
    await handler.aprocess_event(event)

# Or process synchronously
for event in graph.stream(inputs):
    handler.process_event(event)

Pattern 2: Node decorator

Wrap specific decision-making nodes directly.

from sigmodx_integrations.langgraph import (
    sigmodx_node,
    LANGGRAPH_ANOMALY_CONFIG
)

@sigmodx_node(client=client, config=LANGGRAPH_ANOMALY_CONFIG)
def analyze_transaction(state: dict) -> dict:
    # your existing node logic
    return {
        "decision": "flag",
        "rationale": "Amount 3x historical average.",
        "anomaly_subtype": "unusual_amount",
        "severity": "high",
        "transaction_amount": state["amount"]
    }

graph.add_node("analyze_transaction", analyze_transaction)

Installation

pip install "sigmodx-integrations[langgraph]"
# or
pip install sigmodx-integrations langgraph

Custom scenario mapping

from sigmodx_integrations import SigmodxCallbackHandler, ScenarioConfig

config = ScenarioConfig(
    scenario="invoice_approval",
    filter_tools=["approve_invoice", "reject_invoice"],
    decision_type_extractor=lambda output: output.get("decision"),
    rationale_extractor=lambda output: output.get("reason"),
    metadata_extractor=lambda output: {
        "invoice_amount": output.get("amount"),
        "vendor_id": output.get("vendor_id"),
    },
)

handler = SigmodxCallbackHandler(client=client, config=config)

Universal adapter (any framework)

from sigmodx_integrations import SigmodxAdapter

adapter = SigmodxAdapter(client=client, scenario="anomaly_detection")

adapter.log(
    inputs={"txn_ref": "TXN-001", "amount": 5000},
    decision_type="flag",
    rationale="Amount 3x historical average.",
    anomaly_subtype="unusual_amount",
    severity="high",
    transaction_amount=5000,
)

Supported frameworks

Framework Status
LangChain Live
LangGraph Live
Universal adapter Live
AutoGen Coming soon
CrewAI Coming soon
OpenAI Agents SDK Coming soon
Semantic Kernel Coming soon

Request framework prioritization: github.com/Sigmodx/integrations-python/issues

Links

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

sigmodx_integrations-0.2.0.tar.gz (11.9 kB view details)

Uploaded Source

Built Distribution

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

sigmodx_integrations-0.2.0-py3-none-any.whl (17.6 kB view details)

Uploaded Python 3

File details

Details for the file sigmodx_integrations-0.2.0.tar.gz.

File metadata

  • Download URL: sigmodx_integrations-0.2.0.tar.gz
  • Upload date:
  • Size: 11.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for sigmodx_integrations-0.2.0.tar.gz
Algorithm Hash digest
SHA256 e828b87613b8f7ab783ccf8da0c76a3cdb18ebfedaef1c16651320aee8961b40
MD5 6e5d7301894e1c97746c69c4991eb4cf
BLAKE2b-256 16069da9a6eff56f5105e531d4eba38f1ab667c8d6b9891496fb09bcd7d4f73d

See more details on using hashes here.

File details

Details for the file sigmodx_integrations-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for sigmodx_integrations-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c6d10dad4ea54526e21d8f4acfad01efdc931d08bdf370c22d9fcb0e58aa1702
MD5 7889e8ae56919e92727d235d8614023e
BLAKE2b-256 957e227a60bc4aa1c9ef44b0da1c2bcc7199bf966d9d6e22b07b1705cfde6655

See more details on using hashes here.

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