LangChain Python tool wrapping SBO3L — gate every agent payment intent through SBO3L's policy boundary.
Project description
sbo3l-langchain
LangChain Python tool wrapping SBO3L. Mirror of @sbo3l/langchain (TypeScript).
⚠ DRAFT (T-1-2): depends on F-10 (
sbo3l-sdk) merging + publishing to PyPI.
Install
pip install sbo3l-langchain sbo3l-sdk langchain-core
Quick start
from langchain_core.tools import StructuredTool
from sbo3l_sdk import SBO3LClientSync, bearer
from sbo3l_langchain import sbo3l_tool
client = SBO3LClientSync(
"http://localhost:8730",
auth=bearer("my-bearer-token"),
)
descriptor = sbo3l_tool(client=client)
tool = StructuredTool.from_function(
func=descriptor.func,
name=descriptor.name,
description=descriptor.description,
)
# Pass `tool` into your LangChain agent's tool list.
What it does
The agent emits a tool call with a JSON-stringified APRP. The tool forwards
to client.submit() and returns a JSON envelope:
{
"decision": "allow",
"deny_code": null,
"matched_rule_id": "allow-low-risk-x402",
"execution_ref": "kh-...",
"audit_event_id": "evt-...",
"request_hash": "...",
"policy_hash": "..."
}
On deny, the LLM sees deny_code (policy.budget_exceeded,
policy.token_unsupported, etc.) and can self-correct or escalate.
Idempotency
descriptor = sbo3l_tool(
client=client,
idempotency_key=lambda body: f"{body['task_id']}-{body['nonce']}",
)
Async clients
This factory returns a sync callback. Use SBO3LClientSync (httpx.Client
under the hood — safe inside any event loop). If you must use the async
client, create your own async tool that awaits client.submit(...).
Errors
Transport / auth failures surface as a JSON envelope with error (RFC 7807
domain code, e.g. auth.required) and status.
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sbo3l_langchain-1.2.0.tar.gz.
File metadata
- Download URL: sbo3l_langchain-1.2.0.tar.gz
- Upload date:
- Size: 6.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a4cd414be3f650d080b30807ca87ddea219407a45a72a0215d57b6be8be90a96
|
|
| MD5 |
3a6de46fb17b133a33fd726b758e1e12
|
|
| BLAKE2b-256 |
4ba754e17104802f37d5b27dc75714c75813166e233fb4800abb472cee3bd826
|
Provenance
The following attestation bundles were made for sbo3l_langchain-1.2.0.tar.gz:
Publisher:
integrations-publish.yml on B2JK-Industry/SBO3L-ethglobal-openagents-2026
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sbo3l_langchain-1.2.0.tar.gz -
Subject digest:
a4cd414be3f650d080b30807ca87ddea219407a45a72a0215d57b6be8be90a96 - Sigstore transparency entry: 1427827071
- Sigstore integration time:
-
Permalink:
B2JK-Industry/SBO3L-ethglobal-openagents-2026@79a091a3125695fcf2d547075517ce112163ab80 -
Branch / Tag:
refs/tags/langchain-py-v1.2.0 - Owner: https://github.com/B2JK-Industry
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
integrations-publish.yml@79a091a3125695fcf2d547075517ce112163ab80 -
Trigger Event:
push
-
Statement type:
File details
Details for the file sbo3l_langchain-1.2.0-py3-none-any.whl.
File metadata
- Download URL: sbo3l_langchain-1.2.0-py3-none-any.whl
- Upload date:
- Size: 5.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2a11f2f6179c6bf95b4eccb28e4e836a00c6819baee167be00e54d849d3edfa9
|
|
| MD5 |
a425e697a98f419e96adaa121e911ea8
|
|
| BLAKE2b-256 |
cde416623d33694fad58ec54d4ba90d74f9f175b2d2ff3aeebffaa8670fb4a7a
|
Provenance
The following attestation bundles were made for sbo3l_langchain-1.2.0-py3-none-any.whl:
Publisher:
integrations-publish.yml on B2JK-Industry/SBO3L-ethglobal-openagents-2026
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sbo3l_langchain-1.2.0-py3-none-any.whl -
Subject digest:
2a11f2f6179c6bf95b4eccb28e4e836a00c6819baee167be00e54d849d3edfa9 - Sigstore transparency entry: 1427827184
- Sigstore integration time:
-
Permalink:
B2JK-Industry/SBO3L-ethglobal-openagents-2026@79a091a3125695fcf2d547075517ce112163ab80 -
Branch / Tag:
refs/tags/langchain-py-v1.2.0 - Owner: https://github.com/B2JK-Industry
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
integrations-publish.yml@79a091a3125695fcf2d547075517ce112163ab80 -
Trigger Event:
push
-
Statement type: