Skip to main content

LangChain

The LangChain integration wraps a compatible executor or Runnable and attaches Arclasp governance callbacks around supported execution events. Use the LangGraph integration instead when your application is primarily a compiled LangGraph workflow.

Install

The Arclasp extra currently constrains langchain-core>=0.3.0,<0.4.0. Your application may need additional LangChain packages and provider integrations. For example, code that imports langchain.agents or langchain_openai must install those packages separately.

Add Arclasp to an existing executor

This is an integration fragment. It assumes executor already exists in your application.

What the adapter records

Where the underlying Runnable emits compatible callbacks, Arclasp can record events around supported tool, LLM, and chain lifecycle activity. Tool-call governance is the important enforcement boundary: a governed tool invocation is evaluated before the tool body is allowed to proceed. If policy denies the governed tool call, Arclasp raises and the tool should not execute through that governed path. If approval is required, the governed call waits for the approval result.

Existing callbacks

Arclasp appends its callback behavior to compatible existing callback configuration rather than requiring you to remove your own callbacks.

Agent name

The current wrapper derives the recorded agent label from the wrapped object’s class name. If you need precise agent naming for evidence, instrument the workflow manually with arclasp.Chain.record_agent_action().

Sync and async

Async:
Sync:
Do not call the synchronous wrapper from inside an already running async event loop.

Important evidence boundary

Arclasp records governed events emitted through the integration. Do not claim that Arclasp captures private model reasoning. Earlier governed tool events and the policy/evidence fields Arclasp actually receives are the relevant audit material.

Parallel calls

If the framework starts multiple tool calls concurrently, each governed call can be evaluated separately. A denial cannot retroactively cancel a different customer-side operation that already started outside the denied call’s control path.

Nested workflows

Nested executors can share the containing Arclasp Chain depending on how you wrap them. The current adapter does not promise a universal automatic parent-child Chain hierarchy.