@tensflare/autogen
v0.1.0
Published
AutoGen middleware that injects Truss recording into multi-agent conversations
Readme

@tensflare/autogen
AutoGen middleware — automatically records multi-agent message exchanges as Truss actions.
What is Truss?
Truss is an accountability layer for AI agents — it records every agent action as a cryptographically signed, tamper-evident audit trail. Learn more →
Overview
Wrap your AutoGen agent's message handler to automatically capture the last two messages (previous agent output, current agent response) and record them as an autogen_message action. Fail-open — never blocks the agent loop.
Installation
npm install @tensflare/autogenQuick start
import { TrussAutoGenMiddleware } from "@tensflare/autogen";
const truss = new TrussAutoGenMiddleware({
apiUrl: "http://localhost:4000",
apiKey: "tr_your_api_key",
mandateId: "mnd_001",
});
// In your agent's message handler:
agent.process = truss.wrapAgent();API
new TrussAutoGenMiddleware(options)
| Option | Type | Description |
|---|---|---|
| apiUrl | string | Truss API base URL |
| apiKey | string | Truss API key |
| mandateId | string | Mandate ID to record actions under |
middleware.wrapAgent()
Returns a wrapper function that records each message exchange as a Truss action. Captures prior output and current response, hashes both, and posts an autogen_message record.
Related packages
| Package | Description | |---|---| | @tensflare/langgraph | LangGraph middleware (same pattern) | | @tensflare/crewai | CrewAI middleware (same pattern) | | @tensflare/truss-sdk | TypeScript SDK | | @tensflare/tap | Core Zod schemas |
Development
npm install
npm run build
npm testContributing
Pull requests are welcome. Please see the contribution guidelines.
License
Apache 2.0 — see LICENSE.
