Framework Integrations

Framework Integrations

Substr8 works with any framework that supports tool calling.

Supported Frameworks

FrameworkStatusAuto-detect
LangGraphYes
PydanticAIYes
AutoGenYes
CrewAIYes
DSPyYes

LangGraph

from langgraph.prebuilt import create_react_agent
from langchain_anthropic import ChatAnthropic
 
llm = ChatAnthropic(model="claude-sonnet-4-20250514")
tools = [...]  # Your tools
 
agent = create_react_agent(llm, tools)

Run with governance:

substr8 run agent.py

PydanticAI

from pydantic_ai import Agent
 
agent = Agent(
    'anthropic:claude-sonnet-4-20250514',
    tools=[...],
)

Run with governance:

substr8 run agent.py --framework pydantic-ai

AutoGen

from autogen import AssistantAgent, UserProxyAgent
 
assistant = AssistantAgent("assistant", llm_config={...})
user = UserProxyAgent("user")

Run with governance:

substr8 run agent.py --framework autogen

CrewAI

from crewai import Agent, Task, Crew
 
researcher = Agent(role="Researcher", goal="Find information", ...)
task = Task(description="Research topic", agent=researcher)
crew = Crew(agents=[researcher], tasks=[task])

Run with governance:

substr8 run agent.py --framework crewai

DSPy

import dspy
 
lm = dspy.LM("anthropic/claude-sonnet-4-20250514")
dspy.configure(lm=lm)
 
class MyModule(dspy.Module):
    def forward(self, question):
        return dspy.ChainOfThought("question -> answer")(question=question)

Run with governance:

substr8 run agent.py --framework dspy

Zero-Friction Integration

Wrap any agent with govern():

from substr8 import govern
 
# Before
agent = create_react_agent(llm, tools)
 
# After  
agent = govern(create_react_agent(llm, tools))

The wrapper automatically:

  1. Starts run lifecycle
  2. Wraps tool calls
  3. Records audit entries
  4. Generates RunProof on completion

Framework Detection

Substr8 auto-detects frameworks by scanning imports:

# Detected as langgraph
from langgraph.prebuilt import create_react_agent
 
# Detected as pydantic-ai
from pydantic_ai import Agent
 
# Detected as autogen
from autogen import AssistantAgent

Force detection with --framework:

substr8 run agent.py --framework langgraph