Skip to content

Add LangChain/LangGraph adapter MVP #51

@mertsatilmaz

Description

@mertsatilmaz

Goal

Add an MVP adapter for LangChain/LangGraph-based agent workflows.

The adapter should translate a supported LangChain/LangGraph execution path into the harness Trace format.

Why this matters

LangChain and LangGraph are widely used for agentic applications. A native adapter would make it easier for teams using those frameworks to run security regression scenarios through the harness.

MVP scope

Support one clearly documented path first.

The adapter should:

  • accept a supported runnable, graph, agent, or runner function
  • run one scenario input
  • record the user message
  • record the assistant response
  • capture tool calls where possible
  • optionally record a goal event if supplied by the user
  • return a harness Trace

Out of scope for MVP

Do not attempt to support every LangChain or LangGraph pattern.

Out of scope for the first version:

  • every callback shape
  • every historical LangChain agent type
  • streaming
  • complex graph state introspection
  • real model calls in tests

Dependency behavior

LangChain/LangGraph dependencies must be optional.

The base harness install must not require LangChain or LangGraph.

Testing requirements

Tests should use fake runnables, fake tools, or mocked callbacks.

No API keys or real model calls should be required.

Acceptance criteria

  • LangChain/LangGraph adapter module exists
  • Adapter returns Trace
  • Adapter uses TraceRecorder where appropriate
  • Tool calls are captured into trace.tool_calls
  • Missing optional dependency produces a clear error
  • Docs state exactly which LangChain/LangGraph path is supported by the MVP
  • Existing tests continue to pass without installing LangChain dependencies

Metadata

Metadata

Assignees

Labels

adapterTarget adapters and live execution integrations.enhancementNew feature or requestintegrationReal-agent integration guidance, SDK helpers, and wiring patterns.langchain

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions