Skip to content
AI Framework

Govern AI agents on LangChain

Substitute Cordum-governed tools into your LangChain agent. The adapter builds LangChain tools from the Cordum tool path and routes each call through Cordum, so every tool invocation is evaluated by the Safety Kernel before it dispatches and logged for audit compliance.

What this integration does

  • Pre-dispatch policy evaluation on every governed tool call
  • Approval gates for high-risk tool invocations
  • Drop-in governed tools built from the Cordum tool path
  • Full audit trail of agent tool calls and decisions

Use cases

Require approval before LangChain agents execute database writes

Block agents from calling sensitive tools without policy clearance

Audit all tool call decisions in production LangChain agents

Quick setup

  1. 1Install the LangChain adapter: pip install cordum-adapters[langchain]
  2. 2Build governed tools with build_langchain_tools(client) and add them to your agent
  3. 3Define tool-level policy rules
  4. 4Run your agent with the governed tools in place

Related: Cordum vs LangChain callbacks

Frequently asked questions

How does Cordum govern LangChain tool calls?

The adapter builds LangChain tools from the Cordum tool path and substitutes them into your agent. Each call routes through Cordum, where the Safety Kernel evaluates it against policy before dispatch and returns Allow, Deny, or Require Approval, so a tool only runs if your policy permits it. There is no separate callback handler to install.

Can I require approval before an agent writes to a database?

Yes. Define tool-level policy so high-risk invocations, such as database writes or destructive API calls, require approval. The call is held rather than run and an approval request is recorded; once a reviewer approves, the same call with the same arguments succeeds on retry. Low-risk tools continue uninterrupted.

Does the adapter log tool results?

No. The adapter does not log tool return values, which often contain customer records or repository contents. Governance decisions are recorded by Cordum at the gateway, outside your agent process.

What is captured for a production LangChain agent?

Cordum records a full audit trail of the agent's governed tool calls and the governance decision on each, giving you a reviewable history of what the agent attempted and what policy allowed. That makes it practical to run LangChain agents under compliance requirements.

Ready to govern LangChain?

Other integrations