DEV Community

Warren Koch
Warren Koch

Posted on

Adding Departure Records to Your LangChain Agents

Your LangChain agent calls tools on external platforms. It chains through multiple services. Eventually, it finishes and moves on. But where's the record of what happened?

The Passage Protocol adds signed departure records to LangChain agents: verifiable proof that your agent was somewhere, did something, and left under specific conditions.

Why This Matters

When agents operate across multiple platforms, you need audit trails. Insurance, compliance, and incident response all depend on knowing where an agent has been.

Setup

npm install @cellar-door/langchain @langchain/core cellar-door-exit cellar-door-entry
Enter fullscreen mode Exit fullscreen mode

Option 1: EXIT as a Tool

import { createExitTool } from "@cellar-door/langchain";

const exitTool = createExitTool();
// Add to your agent's tool array
Enter fullscreen mode Exit fullscreen mode

Option 2: Automatic EXIT on Chain Completion

import { ExitCallbackHandler } from "@cellar-door/langchain";

const handler = new ExitCallbackHandler({
  origin: "my-app",
  onMarker: (marker) => {
    console.log("Departure recorded:", marker.id);
  },
});

await chain.invoke(input, { callbacks: [handler] });
Enter fullscreen mode Exit fullscreen mode

Option 3: ENTRY Verification Tool

import { createEntryTool } from "@cellar-door/langchain";

const entryTool = createEntryTool({
  policy: { requireCooperative: true },
});
Enter fullscreen mode Exit fullscreen mode

Python Too

pip install cellar-door-langchain
Enter fullscreen mode Exit fullscreen mode
from cellar_door_langchain import create_exit_tool

exit_tool = create_exit_tool()
Enter fullscreen mode Exit fullscreen mode

Links

Top comments (0)