Skip to main content
This example demonstrates the core value proposition of Attesta: one configuration file, one audit trail, one trust engine — regardless of which AI framework executes the tool call. You will define a single attesta.yaml and use it with LangChain, OpenAI Agents SDK, and Anthropic Claude simultaneously. All three frameworks share the same risk scoring, challenge policies, and tamper-proof audit log.

Why Multi-Framework Matters

When your application uses multiple AI frameworks, each framework typically has its own tool execution path. Without a shared governance layer:
  • Risk policies are duplicated and drift apart
  • Trust scores are fragmented — an agent trusted in LangChain starts from zero in OpenAI
  • Audit logs are scattered in different formats, making compliance audits painful
  • Rubber-stamp detection cannot correlate approval patterns across frameworks
A shared Attesta instance solves all of these problems with a single attesta.yaml.

Configuration

This config works identically across all three frameworks:
attesta.yaml
The key insight is that attesta.yaml is framework-agnostic. It defines what your policies are — the integrations handle how they are enforced in each framework’s tool execution path.

Architecture

1

attesta.yaml

A single configuration file defines all policies, risk scoring, and trust settings.
2

Shared Attesta Instance

One Attesta instance loads the config and serves all frameworks.
3

Framework agents execute tool calls

  • LangChain Agent — uses AttestaToolWrapper
  • OpenAI Agent — uses attesta_approval_handler
  • Anthropic Claude — uses AttestaToolGate
4

Shared Audit Trail and Trust Store

  • Audit Trail.attesta/unified-audit.jsonl (single hash-chained log)
  • Trust Store.attesta/trust.json (unified per-agent trust scores)
Every tool call from every framework flows through the same Attesta instance — same risk scorer, same challenge map, same audit log.

Shared Tools Module

First, define the tool functions that all frameworks will use. These are plain Python functions with Attesta gating.
shared_tools.py

Framework 1: LangChain

1

Install LangChain dependencies

2

Create the LangChain agent

langchain_agent.py

Framework 2: OpenAI Agents SDK

1

Install OpenAI dependencies

2

Create the OpenAI agent

openai_agent.py

Framework 3: Anthropic Claude

1

Install Anthropic dependencies

2

Create the Claude agent

claude_agent.py

TypeScript: All Three Frameworks

The same pattern works in TypeScript. A single Attesta instance is shared across all framework integrations.
multi-framework.ts

Running All Three Together

Create a unified runner that exercises all three frameworks against the same Attesta instance:
run_all_frameworks.py

Unified Audit Trail

After running all three frameworks, a single audit log at .attesta/unified-audit.jsonl contains every action from every framework:
Each audit entry includes a metadata.source field identifying which framework originated the action:
Query actions across frameworks:

Cross-Framework Trust

When multiple frameworks use the same agent_id, the trust engine maintains a unified trust profile. Trust earned in LangChain carries over to OpenAI and Claude.
Trust never bypasses CRITICAL actions. Even if an agent has maximum trust (0.9), a CRITICAL action still requires full multi-party verification. This is a safety invariant enforced by Attesta regardless of trust score.

What Gets Shared

For production deployments, create a single shared_tools.py (Python) or shared-tools.ts (TypeScript) module that all your framework integrations import from. This ensures configuration changes propagate everywhere and the trust engine sees all agent activity in one place.

Next Steps

LangChain Integration

Full LangChain and LangGraph reference

OpenAI Agents SDK

Approval handlers and guardrails

Anthropic Claude

Gate Claude tool_use blocks

Audit Trail

Tamper-proof logging across frameworks