Skip to main content

@fidacy/langchain for Python

Gate LangChain tool calls behind a Fidacy verdict. Wraps the tool itself, not a callback: LangChain callbacks fire around a call and cannot cancel it, so a guardrail built on them watches the money leave. This one stops it.

pip install fidacy-langchain
from fidacy_langchain import guard_tools

# No key, no signup: the offline judge decides your first 20 calls.
tools = guard_tools([pay_tool, search_tool])

pay_tool is judged before every call. search_tool is returned untouched, so tools that do not move money pay no cost at all.

Two ways it decides

Offline, out of the box. With no credential the deterministic local judge runs: deny-by-default, your own limits, a hash-chained log on your machine. The first 20 decisions on an install are free and need no account, so you can watch a payment get blocked before deciding whether you want any of this.

from fidacy_langchain import Mandate, guard_tools

tools = guard_tools([pay_tool], mandate=Mandate(
    payees=["acme-inc"],
    per_tx_max=5_000,
    max_total=50_000,
))

A blocked call tells you what was stopped, in money terms, and prints the exact edit that would allow it:

Fidacy stopped send_payment: USD 4,200 to "acme-inc" is over the USD 1,000
per-payment limit. That limit is Fidacy's starting default, not something you
set. To allow a payment this size, set your own:

  guard_tools([send_payment], mandate=Mandate(per_tx_max=4200, payees=["acme-inc"]))

No money moved and the attempt is on this install's audit trail. 19 free
decisions left.

It also names impersonation. pay0neer against an approved payoneer is not reported as an unknown payee: it is reported as the vendor being spoofed, which is the signature of a payee swap.

The judge is the same one the Node packages run

The rules live in one place, packages/firewall/vectors/judge.json, and both the TypeScript and Python implementations run those cases and must return the exact same rule string. A firewall that decided differently depending on the language your agent happens to be written in would not be worth trusting.

Trial state is shared

The free-decision counter lives in ~/.fidacy/config.json, the same file @fidacy/mcp uses. Adding this package does not hand you a fresh 20, and the history you build anonymously migrates when you claim an account.

Free key, no card: https://fidacy.com/claim

Apache-2.0 · https://fidacy.com

Download files

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

Source Distribution

fidacy_langchain-0.1.0.tar.gz (16.6 kB view details)

Uploaded Source

Built Distribution

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

fidacy_langchain-0.1.0-py3-none-any.whl (16.1 kB view details)

Uploaded Python 3

File details

Details for the file fidacy_langchain-0.1.0.tar.gz.

File metadata

  • Download URL: fidacy_langchain-0.1.0.tar.gz
  • Upload date:
  • Size: 16.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.11 {"installer":{"name":"uv","version":"0.10.11","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for fidacy_langchain-0.1.0.tar.gz
Algorithm Hash digest
SHA256 8d73de24abe9a4dfdb28f0f00409a8daa7bb6233bed253842bab891947963ec9
MD5 47d65c2a84faf516df2bfdbb30907546
BLAKE2b-256 05d4ec3ed0928aabe3a22de8541f6139bfe30b9bdceef302099e96d7b3e03f0a

See more details on using hashes here.

File details

Details for the file fidacy_langchain-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: fidacy_langchain-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 16.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.11 {"installer":{"name":"uv","version":"0.10.11","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for fidacy_langchain-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 964e66fb651d9c473bf6c2baf3a23d48e231e77a49f1d040c853d19ec7273b9d
MD5 387fad5795e5a6d2ffd1f254da10030a
BLAKE2b-256 c86d48a2fb4c866e24aaef934bc3c3a3a817c99c1d136588546f36270b895fcc

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