@tensflare/crewai
v0.1.0
Published
CrewAI middleware that injects Truss recording into crew task execution
Downloads
10
Readme

@tensflare/crewai
CrewAI middleware — automatically records every CrewAI task execution as a Truss action.
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
Patch any CrewAI task to automatically capture its input arguments and output results, compute SHA-256 hashes, and record a crew_task action to the Truss API. Fail-open — the task still runs normally if recording fails.
Installation
npm install @tensflare/crewaiQuick start
import { TrussCrewMiddleware } from "@tensflare/crewai";
const truss = new TrussCrewMiddleware({
apiUrl: "http://localhost:4000",
apiKey: "tr_your_api_key",
mandateId: "mnd_001",
});
// Patch a CrewAI task
truss.wrapTask(myCrewAITask);API
new TrussCrewMiddleware(options)
| Option | Type | Description |
|---|---|---|
| apiUrl | string | Truss API base URL |
| apiKey | string | Truss API key |
| mandateId | string | Mandate ID |
middleware.wrapTask(task)
Patches task.execute in place. Records a crew_task action on each execution with SHA-256 hashes of inputs and outputs.
Related packages
| Package | Description | |---|---| | @tensflare/langgraph | LangGraph middleware (same pattern) | | @tensflare/autogen | AutoGen 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.
