Framework Integration
Map your agent framework’s concepts to Invarium blueprints — 5 frameworks supported, plus any custom implementation.
- ✓Invarium is framework-agnostic — any agent with tools can be tested
- ✓Each framework maps its concepts differently: LangChain chains become workflows, CrewAI tasks become tools
- ✓The blueprint format is the common language — learn the mapping for your framework
Why It Matters
Framework integration translates your agent framework’s native concepts — decorators, agent classes, crew tasks, function definitions — into the universal blueprint format (YAML via MCP, JSON via Dashboard) that Invarium uses for test generation and behavioral auditing.
Every framework has its own conventions for defining tools, composing workflows, and specifying agent behavior. This guide shows you how to translate those conventions into a blueprint so Invarium can understand and test your agent regardless of how it was built.
The blueprint examples below use JSON format, which is used for Dashboard import. When working via MCP, your IDE assistant generates YAML format with the same schema. The structure and field names are identical — only the syntax differs.
Framework Overview
Invarium recognizes 6 framework values in the framework field. Setting the correct framework helps Invarium tailor test scenarios to framework-specific patterns.
| Framework | framework value | Agent model | Tool definition | Multi-agent |
|---|---|---|---|---|
| LangChain | langchain | AgentExecutor, LCEL chains | @tool decorator, Tool class | LangGraph |
| CrewAI | crewai | Crew of agents with roles | @tool decorator | Built-in (crews) |
| AutoGen | autogen | Conversable agents | Function definitions | Built-in (group chat) |
| OpenAI Agents SDK | openai_agents | Agent class | Function tools, @function_tool | Handoffs |
| Custom | custom | Any implementation | Any callable | Varies |
| OpenAI (direct) | openai | Direct API usage | Function calling | Manual orchestration |
Framework Guides
LangChain
Concept Mapping
| LangChain Concept | Blueprint Field | Notes |
|---|---|---|
| Agent name | agent_name | Use the name you give your agent or chain |
@tool decorated functions | tools[] | One blueprint tool per @tool function |
| Tool class instances | tools[] | Map name, description, and args_schema |
| System prompt rules | constraints.guardrails[] | Extract each rule as a separate constraint |
| System prompt text | constraints.system_prompt_summary | Paste or summarize your system prompt |
| LCEL chain / graph steps | workflow.chains[] | Map each chain or graph to a workflow |
| LangGraph nodes | workflow.chains[].steps[] | Each node becomes a step in the workflow |
Example: LangChain Agent Blueprint
Given this LangChain agent:
@tool
def search_products(query: str) -> str:
"""Search the product catalog by name or category."""
# ...
@tool
def check_inventory(product_id: str) -> dict:
"""Check current inventory levels for a product."""
# ...
@tool
def place_order(product_id: str, quantity: int, customer_id: str) -> str:
"""Place an order for a product."""
# ...The blueprint would be:
{
"agent_name": "ecommerce-assistant",
"framework": "langchain",
"description": "An e-commerce assistant that helps customers search products, check availability, and place orders.",
"tools": [
{
"name": "search_products",
"description": "Search the product catalog by name or category.",
"parameters": {
"type": "object",
"properties": {
"query": { "type": "string", "description": "Product name, category, or search terms" }
},
"required": ["query"]
},
"returns": "List of matching products with name, price, and ID.",
"side_effects": ["database_read"],
"error_handling": "retry"
},
{
"name": "check_inventory",
"description": "Check current inventory levels for a specific product.",
"parameters": {
"type": "object",
"properties": {
"product_id": { "type": "string", "description": "The unique product identifier" }
},
"required": ["product_id"]
},
"returns": "Object with product_id, available_quantity, and warehouse_location.",
"side_effects": ["database_read"],
"error_handling": "retry"
},
{
"name": "place_order",
"description": "Place an order for a product on behalf of the customer.",
"parameters": {
"type": "object",
"properties": {
"product_id": { "type": "string", "description": "The product to order" },
"quantity": { "type": "integer", "description": "Number of units to order (1-100)" },
"customer_id": { "type": "string", "description": "The customer placing the order" }
},
"required": ["product_id", "quantity", "customer_id"]
},
"returns": "Order confirmation with order_id and estimated delivery date.",
"side_effects": ["payment", "database_write"],
"requires_confirmation": true,
"error_handling": "fallback"
}
],
"constraints": {
"system_prompt_summary": "You are an e-commerce assistant. Help customers find products, check stock, and place orders.",
"guardrails": [
"Always check inventory before placing an order",
"Never place an order without the customer's explicit confirmation",
"Do not recommend products that are out of stock",
"Only discuss products available in our catalog"
]
},
"workflow": {
"entry_point": "customer_request",
"chains": [
{
"name": "purchase-flow",
"steps": [
"Search for the product in the catalog",
"Check inventory for the matching product",
"If in stock, confirm the order details with the customer",
"Place the order after customer confirmation"
],
"condition": "Customer wants to buy a product"
}
]
}
}LangChain Tips
- Map each
@tooldecorated function to atools[]entry — the docstring becomes thedescription - Extract constraints from your system prompt — every rule in the system prompt should be a separate constraint
- If you use LangGraph, map each node to a step in a
workflow.chains[]entry - Include
side_effectsfor any tool that writes data or triggers external actions —search_productsreads the database,place_orderprocesses a payment - Set
requires_confirmation: trueon tools that perform irreversible actions (like placing orders or sending emails)
Common Patterns
Regardless of framework, these patterns apply to every blueprint:
Every Callable is a Tool
If your agent can call it, list it in tools[]. This includes functions, API endpoints, database queries, and external service calls. Each tool needs at minimum a name and description.
Every Rule is a Constraint
System prompts, guardrails, and business rules all become entries in constraints. Extract individual rules from your system prompt — “Always check inventory before ordering” is one constraint, “Never process payments without confirmation” is another. The more specific your constraints, the more targeted your test scenarios.
Every Multi-Step Process is a Workflow
If your agent follows a sequence of steps to complete a task, describe it in workflow.chains[]. Workflows help Invarium test your agent’s end-to-end behavior, not just individual tool calls.
Be Specific About Side Effects
Tools that only read data have "side_effects": ["none"] or "side_effects": ["database_read"]. Tools that write data, send messages, or trigger external systems need their side effects documented with specific values:
| Side Effect | When to Use |
|---|---|
database_write | Tool creates, updates, or deletes database records |
database_read | Tool queries a database |
api_call | Tool calls an external API |
email_send | Tool sends an email |
file_write | Tool creates or modifies files |
file_read | Tool reads files from disk |
payment | Tool processes a financial transaction |
notification | Tool sends a push notification, SMS, or alert |
none | Tool has no side effects (pure computation) |
Not sure if your blueprint is complete? Upload it and generate a small set of 5-10 test scenarios. If the tests feel generic or miss important behaviors, your blueprint needs more detail in tools, constraints, or workflows.