Skip to main content

Real-time security firewall SDK for AI agents

Project description

MoltWall Python SDK (Beta)

Real-time security firewall for AI agents — Python edition.

pip install moltwall
# with httpx for best performance:
pip install "moltwall[httpx]"
# with LangChain integration:
pip install "moltwall[langchain]"

Quickstart

from moltwall import MoltWall

wall = MoltWall(api_key="moltwall_live_...", base_url="https://www.moltwall.xyz")

result = wall.check(
    agent_id="my-agent",
    action="transfer_funds",
    tool="wallet",
    args={"amount": 100, "to": "0xabc..."},
    source="user",
)

result.raise_if_blocked()  # raises MoltWallBlockedError if denied
print(f"Decision: {result.decision}  Risk: {result.risk_score:.2f}  Latency: {result.latency_ms:.1f}ms")

LangChain Integration

from langchain_community.tools import ShellTool, WikipediaQueryRun
from moltwall import MoltWall
from moltwall.integrations.langchain import wrap_tools

wall = MoltWall(api_key="moltwall_live_...")

# Wrap all tools in one call
safe_tools = wrap_tools(
    tools=[ShellTool(), WikipediaQueryRun()],
    wall=wall,
    agent_id="lc-agent-01",
    source="agent",
)

# Drop-in replacement — same interface as original tools
from langchain.agents import create_react_agent
agent = create_react_agent(llm, safe_tools, prompt)

Error Handling

from moltwall import MoltWall, MoltWallBlockedError, MoltWallAuthError

try:
    result = wall.check(agent_id="a1", action="delete_db", tool="sql", args={})
    result.raise_if_blocked()
except MoltWallBlockedError as e:
    print(f"Blocked: {e.response.reason}")
except MoltWallAuthError:
    print("Invalid API key")

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

moltwall-0.1.0b1.tar.gz (6.7 kB view details)

Uploaded Source

Built Distribution

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

moltwall-0.1.0b1-py3-none-any.whl (7.3 kB view details)

Uploaded Python 3

File details

Details for the file moltwall-0.1.0b1.tar.gz.

File metadata

  • Download URL: moltwall-0.1.0b1.tar.gz
  • Upload date:
  • Size: 6.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.6

File hashes

Hashes for moltwall-0.1.0b1.tar.gz
Algorithm Hash digest
SHA256 e7bd1f4b5123c310cae9065cf291324e201647d61f6f4bb145e6a4a72bc94ef2
MD5 494c88972fbc3fe742795d0bb48cd88f
BLAKE2b-256 ff11e9c46caab7062cc23c07558dbfa28fe4bbd8103e255b94337f24e7a08782

See more details on using hashes here.

File details

Details for the file moltwall-0.1.0b1-py3-none-any.whl.

File metadata

  • Download URL: moltwall-0.1.0b1-py3-none-any.whl
  • Upload date:
  • Size: 7.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.6

File hashes

Hashes for moltwall-0.1.0b1-py3-none-any.whl
Algorithm Hash digest
SHA256 9c37713b6ce51af4b9beae8d43ad965b324e8f9599468e7d48726796ff74eb54
MD5 31c55c91b31e6f263f9110bf6e220010
BLAKE2b-256 7acec7720154ebe642f121abbc4079b4c99b0042ce0dcbffb293e782dedaaf21

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