Framework Integrations

AGT — not Wytness — owns the framework adapters. AGT-Python 4.1.0 ships 12 first-party framework integrations (LangChain, LangGraph, CrewAI, Haystack, MCP, +7 others); AGT-TS ships GenericFrameworkAdapter only. Those adapters perform trust verification, not audit emission — but once the wrapper is initialised, every entry AGT's AuditLog chains is forwarded to Wytness regardless of how the framework was wired in.

How it works

  1. AGT-Python ships a framework integration (LangChain callback, CrewAI hook, etc.) that hooks into the framework's lifecycle. These integrations perform trust verification — they gate tool execution against a trust score. They do not automatically emit AGT AuditEntry records on their own.
  2. You still call AGT's AuditLog().log(...) from your framework's handler (or use AGT's HTTP middleware which does both gating and logging).
  3. The wrapper's init() hooks AGT's audit log cleanly — the entries flow through the Wytness PII + envelope path. You write zero Wytness-specific framework code.

Supported frameworks (AGT-Python 4.1.0)

These are the 12 framework / middleware integrations AGT-Python ships first-party as of 4.1.0. TypeScript ships GenericFrameworkAdapter only — see Custom adapter (TypeScript). Refer to the AGT repo for class names and full wire-up.

Framework / middlewareAGT moduleRole
LangChainagentmesh.integrations.langchainAgentMeshTrustCallback — trust gating callback.
LangGraphagentmesh.integrations.langgraphNode-level trust gating.
Langflowagentmesh.integrations.langflowFlow-level trust gating.
CrewAIagentmesh.integrations.crewaiTrustAwareAgent / TrustAwareCrew wrappers.
Haystackagentmesh.integrations.haystackPipeline trust gating.
Flowiseagentmesh.integrations.flowiseFlowise node integration.
MCPagentmesh.integrations.mcpModel Context Protocol trust gating.
Swarmagentmesh.integrations.swarmOpenAI Swarm trust gating.
A2Aagentmesh.integrations.a2aAgent-to-Agent trust verification.
AI Cardagentmesh.integrations.ai_cardAI Card trust verification.
HTTP middlewareagentmesh.integrations.http_middlewareFramework-agnostic HTTP audit + trust middleware.
Django middlewareagentmesh.integrations.django_middlewareDjango request-level audit middleware.

Example: LangChain (Python)

AGT-Python's LangChain integration is a trust-gating callback. To capture each tool call as an audit entry, also write to AGT's AuditLog from the handler — the simplest pattern is a thin wrapper that does both.

agent.py
# 1. Wytness wrapper — wire in once at process start.
import wytness_ai
from wytness_ai import AuditLog
wytness_ai.init(pii_fields=["customer.email"])
# 2. AGT's LangChain trust callback — Microsoft's pattern.
from langchain.agents import AgentExecutor
from agentmesh.integrations.langchain import AgentMeshTrustCallback
trust_cb = AgentMeshTrustCallback(agent_did="billing-agent")
audit = AuditLog()
# 3. Wrap tool-call lifecycle to write an AuditEntry per invocation.
class WytnessAuditCallback:
def on_tool_end(self, tool_name, params, result, **_):
audit.log(
event_type="tool_invocation",
agent_did="billing-agent",
action=tool_name,
policy_decision="allow",
data={"params": params, "result": result},
)
agent_executor = AgentExecutor(
agent=my_agent,
tools=my_tools,
callbacks=[trust_cb, WytnessAuditCallback()],
)
agent_executor.invoke({"input": "Send the Q1 invoice to Acme Corp"})
wytness_ai.shutdown()

Each audit.log(...) call produces one AGT AuditEntry — wrapped by the Wytness envelope and POSTed to /ingest. Alternatively, use AGT's agentmesh.integrations.http_middleware which does both gating and audit emission on its own.

Custom adapter (TypeScript)

AGT-TS 5.0.0 ships GenericFrameworkAdapter only — implement one method against your framework's tool-call lifecycle and write to AuditLogger.log(). The wrapper picks up everything the logger chains.

agent.ts
import { init, shutdown, setNextEntryExtras, AuditLogger } from "@wytness/ai";
await init({ piiFields: ["customer.email"] });
const audit = new AuditLogger();
// Call this from your framework's tool-end / on-step handler.
function recordToolCall(toolName: string, params: object, result: object) {
setNextEntryExtras({ data: { params, result }, outcome: "success" });
audit.log({
agentId: "research-agent",
action: `tool_invocation:${toolName}`,
decision: "allow",
});
}
// ... run your agent, calling recordToolCall(...) on each tool invocation ...
await shutdown();

Framework not on the list?

Two options:

  1. Write to AGT's AuditLog directly. AGT is framework-agnostic — any code path can call AuditLog().log(...). With the wrapper initialised, those entries get pseudonymised, envelope-signed, and POSTed. See the Python quickstart for the call shape.
  2. Use direct ingest. If you can't or don't want to install AGT — for example, you're emitting from a Lambda that doesn't run agent code — POST CloudEvents 1.0 batches directly to api.wytness.ai/ingest with the appropriate Content-Type. See Built on AGT — Path B.

Manual sink write (Python)

custom_agent.py
import wytness_ai
from wytness_ai import AuditLog
wytness_ai.init()
audit = AuditLog()
# Your code — emits to AGT's chain, then forwarded to Wytness.
audit.log(
event_type="tool_invocation",
agent_did="custom-agent",
action="my_tool",
policy_decision="allow",
data={"query": "..."},
)
wytness_ai.shutdown()
Note
The wrapper writes via AGT's audit class so the AGT identity + hash-chain primitives are preserved end-to-end. Bypassing AGT (writing directly to the audit sink) is possible with auto_wire=False — see SDK API reference.

Version pinning

AGT is a hard dependency of the wrapper SDK — Python 4.1.0 / TypeScript 5.0.0, one Microsoft release train (the differing numbers are Microsoft's per-registry publish cadence, not a compatibility split). Pin both versions in your requirements.txt / package.json so a framework upgrade doesn't silently pull a newer AGT before the wrapper supports it.

PackagePinned versionPulls AGT
wytness-ai (PyPI)1.12.0agent-governance-toolkit[full]==4.1.0
@wytness/ai (npm)1.12.0@microsoft/agent-governance-sdk@5.0.0

AGT framework-adapter versions track AGT's release cadence — see the AGT changelog.

We set no cookies. Sign-in and preferences use essential first-party browser storage only — no tracking, advertising, or third-party analytics. Privacy Policy

Framework Integrations
TABLE OF CONTENTS