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
- 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
AuditEntryrecords on their own. - You still call AGT's
AuditLog().log(...)from your framework's handler (or use AGT's HTTP middleware which does both gating and logging). - 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 / middleware | AGT module | Role |
|---|---|---|
| LangChain | agentmesh.integrations.langchain | AgentMeshTrustCallback — trust gating callback. |
| LangGraph | agentmesh.integrations.langgraph | Node-level trust gating. |
| Langflow | agentmesh.integrations.langflow | Flow-level trust gating. |
| CrewAI | agentmesh.integrations.crewai | TrustAwareAgent / TrustAwareCrew wrappers. |
| Haystack | agentmesh.integrations.haystack | Pipeline trust gating. |
| Flowise | agentmesh.integrations.flowise | Flowise node integration. |
| MCP | agentmesh.integrations.mcp | Model Context Protocol trust gating. |
| Swarm | agentmesh.integrations.swarm | OpenAI Swarm trust gating. |
| A2A | agentmesh.integrations.a2a | Agent-to-Agent trust verification. |
| AI Card | agentmesh.integrations.ai_card | AI Card trust verification. |
| HTTP middleware | agentmesh.integrations.http_middleware | Framework-agnostic HTTP audit + trust middleware. |
| Django middleware | agentmesh.integrations.django_middleware | Django 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.
# 1. Wytness wrapper — wire in once at process start.import wytness_aifrom wytness_ai import AuditLogwytness_ai.init(pii_fields=["customer.email"]) # 2. AGT's LangChain trust callback — Microsoft's pattern.from langchain.agents import AgentExecutorfrom 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.
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:
- Write to AGT's
AuditLogdirectly. AGT is framework-agnostic — any code path can callAuditLog().log(...). With the wrapper initialised, those entries get pseudonymised, envelope-signed, and POSTed. See the Python quickstart for the call shape. - 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/ingestwith the appropriateContent-Type. See Built on AGT — Path B.
Manual sink write (Python)
import wytness_aifrom 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()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.
| Package | Pinned version | Pulls AGT |
|---|---|---|
| wytness-ai (PyPI) | 1.12.0 | agent-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.
Related
- Quickstart (Python)
- Quickstart (TypeScript)
- SDK API reference
- Built on AGT — wrapper vs direct ingest