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

Anonymous telemetry

The adapter reports anonymous usage so we can tell which surfaces are alive: an install marker, an "agent active" ping, the result class of local decisions (allow, deny_payee, deny_cap and so on) and the moment the free-trial wall is shown. Every field is a closed enum. It never carries payees, amounts, currencies, tool arguments or any content, and it never sits on the path of a decision: failures are swallowed and nothing blocks.

Disable it entirely with:

export FIDACY_DISABLE_TELEMETRY=1

The anonymous id lives in ~/.fidacy/config.json, shared with @fidacy/mcp and the JS adapters, so the free-decision counter and a later account claim stay consistent across Fidacy tools on the same machine.

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.2.1.tar.gz (13.2 MB 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.2.1-py3-none-any.whl (20.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: fidacy_langchain-0.2.1.tar.gz
  • Upload date:
  • Size: 13.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.11.3

File hashes

Hashes for fidacy_langchain-0.2.1.tar.gz
Algorithm Hash digest
SHA256 5f7cb98bcaede9c3ae2821196c7afed6cb14f43fae88883b4ed8e5156cf98650
MD5 65a701079119c1bba0932f4ca24e8592
BLAKE2b-256 bc24c3c97ad4d5375fa64aab7b5ade011015e4a1d3f0bb431f9dcefa8c934227

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fidacy_langchain-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 fe85e3e28a537d6e5f568afacaa0e63b9f0e0f9fac2b8b4f915767584691ee64
MD5 add93bf83878311ad08b883eeeb1229f
BLAKE2b-256 f925af22cb850a0dca9f0402d9b5815f24482677839326653f48c58766fb3b6a

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