This release has been yanked by its maintainers, and will be ignored by installers, except when explicitly specified.
Reason given by maintainers: Unsafe: runs tools after review approval. Do not use; await 0.2.0.
qerexa-langchain
Gate every LangChain agent action through Qerexa runtime trust enforcement.
When an AI agent tries to do something consequential — write to a database, send a payment, deploy code, delete records — this package routes that action through a Qerexa gate first. The gate evaluates policy, optionally requires human approval, and records the decision in a tamper-evident audit chain. The action only runs if the gate allows it.
Built for the EU AI Act Article 14 human-oversight requirement, enforceable August 2026.
Install
pip install qerexa-langchain
Quickstart
from qerexa_langchain import QerexaClient, gated
qerexa = QerexaClient(api_key="sk_live_...") # or set QEREXA_API_KEY
@gated(action="database.write", client=qerexa)
def write_record(data: str) -> str:
# This body only executes if Qerexa allows the action.
return db.insert(data)
If the gate blocks the action, write_record never runs — it raises GateBlockedError. If the action requires human approval, the call blocks until an approver decides (or times out).
Gate an existing LangChain tool
from langchain_core.tools import tool
from qerexa_langchain import QerexaClient, gate_tool
qerexa = QerexaClient(api_key="sk_live_...")
@tool
def transfer_funds(amount: float, to: str) -> str:
"""Transfer funds to a recipient."""
return payments.send(amount, to)
# Wrap it — every invocation now passes through the gate.
safe_transfer = gate_tool(transfer_funds, client=qerexa, action="payment.transfer")
agent = create_agent(llm, tools=[safe_transfer])
Let the agent reason about a block
By default a block raises. Pass on_block to return a message the agent can read and act on instead:
@gated(
action="database.delete",
client=qerexa,
on_block=lambda err: f"Action blocked by policy: {err.reason}. Ask a human to approve.",
)
def delete_records(query: str) -> str:
return db.delete(query)
Human-in-the-loop approval
When a Qerexa policy marks an action as requiring approval, the gate holds it and notifies the approver. The call waits until a decision is made:
qerexa = QerexaClient(
api_key="sk_live_...",
approval_timeout=600, # wait up to 10 minutes for a human
poll_interval=3,
)
@gated(action="production.deploy", client=qerexa)
def deploy(service: str) -> str:
return k8s.rollout(service)
Set wait_for_approval=False on the decorator to fail fast instead of waiting.
Configuration
| Setting | Env var | Default |
|---|---|---|
| API key | QEREXA_API_KEY |
required |
| Base URL | QEREXA_BASE_URL |
https://api.qerexa.com |
The distribution includes a py.typed marker, so type checkers can consume the
package's inline type annotations.
Why gate agent actions?
Your IAM knows the agent is authenticated. Your infrastructure runs what it's told. Nothing in between enforces whether a specific action, against a specific target, at a specific moment, is authorized — with proof. An AI agent can fire a thousand actions a minute. Qerexa is the enforcement layer in that gap.
Every gate decision is written to Qerexa's tamper-evident audit chain. Completed human approvals are published into the Merkle transparency ledger and become independently verifiable after the corresponding root is published.
License
MIT
Metadata
Release files for qerexa-langchain 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| qerexa_langchain-0.1.0.tar.gz | 12.4 kB | With provenance | Details for qerexa_langchain-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| qerexa_langchain-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for qerexa_langchain-0.1.0-py3-none-any.whl |
Total release size: 21.9 kB
Release files / qerexa_langchain-0.1.0.tar.gz
| Download URL | qerexa_langchain-0.1.0.tar.gz |
|---|---|
| Size | 12.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
63fa17bfb6c86898d49008b84ef333fbe1f58246a3e2c8fe0c23481ede9cdf1c
|
|
BLAKE2b-256 checksum How to use checksums |
7adcdb6f2a7e161f5584f52258bf7c2bac9db7f3d22230958d2e42e384b9bb21
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 27, 2026.
Transparency logRelease files / qerexa_langchain-0.1.0-py3-none-any.whl
| Download URL | qerexa_langchain-0.1.0-py3-none-any.whl |
|---|---|
| Size | 9.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
752cc66f7a08480d03ec507f6aa3c95b29346276a7a0e5e3de765f50507cb9a7
|
|
BLAKE2b-256 checksum How to use checksums |
b85b6cea125221edbfbf019d541b803bfc5f2a150422515ededd7faca4986b96
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 27, 2026.
Transparency logSecurity for qerexa-langchain 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for qerexa_langchain-0.1.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 27, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.