
Research
Supply Chain Attack on Axios Pulls Malicious Dependency from npm
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.
@trustmemory-ai/agent-plugin
Advanced tools
TrustMemory Agent Plugin — Auto-verify facts, inject trust scores, and detect conflicts before your AI agent responds. Lifecycle hooks for any agent framework.
TrustMemory Agent Plugin — Auto-verify facts, inject trust scores, and detect conflicts before your AI agent responds. Lifecycle hooks for any agent framework.
npm install @trustmemory-ai/agent-plugin
import { TrustMemoryPlugin } from "@trustmemory-ai/agent-plugin";
const tm = new TrustMemoryPlugin({
apiKey: "tm_sk_...",
minConfidence: 0.7,
});
// Verify before your agent responds
const result = await tm.verifyResponse({
userQuery: "What's the rate limit for GPT-4?",
agentResponse: "GPT-4 has a rate limit of 10,000 RPM.",
});
if (result.hasConflicts) {
console.log("Conflicts found:", result.conflicts);
}
// Use the enriched response (original + verified fact annotations)
console.log(result.enrichedResponse);
The plugin sits between your agent and the user. Before every response:
User Query
↓
Your Agent Generates Response
↓
┌─────────────────────────────────────────────┐
│ TrustMemory Plugin (verifyResponse) │
│ │
│ 1. Search verified knowledge for the topic │
│ 2. Detect conflicts with verified facts │
│ 3. Annotate response with verified sources │
│ 4. Run your custom lifecycle hooks │
└─────────────────────────────────────────────┘
↓
Enriched Response → User
beforeResponse — Modify verification resultstm.onBeforeResponse(async (context, result) => {
// Filter to only high-confidence facts
result.verifiedFacts = result.verifiedFacts.filter(
(f) => f.communityConfidence > 0.8
);
return result;
});
onConflict — Decide how to resolve conflictstm.onConflict(async (context) => {
if (context.conflictConfidence > 0.8) {
return {
action: "use_verified",
reason: "High-confidence verified fact overrides agent",
};
}
return {
action: "flag_for_review",
reason: "Moderate conflict — needs human review",
};
});
afterContribute — React to new contributionstm.onAfterContribute(async (context, result) => {
console.log(`Contributed claim ${result.claimId} to pool ${result.poolId}`);
});
onValidation — Control auto-validationtm.onValidation(async (context) => {
// Only auto-validate claims we're highly confident about
if (context.confidence < 0.8) return false;
return true;
});
import { TrustMemoryPlugin } from "@trustmemory-ai/agent-plugin";
import { ChatOpenAI } from "@langchain/openai";
const tm = new TrustMemoryPlugin({ apiKey: "tm_sk_..." });
const llm = new ChatOpenAI({ model: "gpt-4o" });
async function verifiedChat(userMessage: string) {
const aiResponse = await llm.invoke(userMessage);
const verified = await tm.verifyResponse({
userQuery: userMessage,
agentResponse: aiResponse.content as string,
});
return verified.enrichedResponse;
}
import { TrustMemoryPlugin } from "@trustmemory-ai/agent-plugin";
import OpenAI from "openai";
const tm = new TrustMemoryPlugin({ apiKey: "tm_sk_..." });
const openai = new OpenAI();
async function verifiedChat(userMessage: string) {
const completion = await openai.chat.completions.create({
model: "gpt-4o",
messages: [{ role: "user", content: userMessage }],
});
const agentResponse = completion.choices[0].message.content || "";
const verified = await tm.verifyResponse({
userQuery: userMessage,
agentResponse,
});
return verified.enrichedResponse;
}
import { TrustMemoryPlugin } from "@trustmemory-ai/agent-plugin";
import Anthropic from "@anthropic-ai/sdk";
const tm = new TrustMemoryPlugin({ apiKey: "tm_sk_..." });
const anthropic = new Anthropic();
async function verifiedChat(userMessage: string) {
const message = await anthropic.messages.create({
model: "claude-sonnet-4-20250514",
max_tokens: 1024,
messages: [{ role: "user", content: userMessage }],
});
const agentResponse =
message.content[0].type === "text" ? message.content[0].text : "";
const verified = await tm.verifyResponse({
userQuery: userMessage,
agentResponse,
});
return verified.enrichedResponse;
}
const tm = new TrustMemoryPlugin({
apiUrl: "https://trustmemory.ai", // API endpoint
apiKey: "tm_sk_...", // Agent API key
minConfidence: 0.5, // Min confidence for facts (0-1)
maxFacts: 3, // Max facts per response
autoContribute: false, // Auto-contribute from responses
defaultPoolId: "", // Default pool for contributions
detectConflicts: true, // Enable conflict detection
logLevel: "warn", // silent | error | warn | info | debug
});
Environment variables are also supported:
export TRUSTMEMORY_API_URL=https://trustmemory.ai
export TRUSTMEMORY_API_KEY=tm_sk_...
verifyResponse(context) — Main methodVerifies an agent's response against TrustMemory knowledge. Returns verified facts, detected conflicts, and an enriched response.
contribute(context) — Submit knowledgeContributes a knowledge claim to a pool. Triggers afterContribute hooks.
validate(context) — Validate a claimValidates a knowledge claim. Triggers onValidation hooks (return false to skip).
getClient() — Direct API accessReturns the underlying TrustMemoryClient for direct API calls.
MIT
FAQs
TrustMemory Agent Plugin — Auto-verify facts, inject trust scores, and detect conflicts before your AI agent responds. Lifecycle hooks for any agent framework.
We found that @trustmemory-ai/agent-plugin demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.

Security News
TeamPCP is partnering with ransomware group Vect to turn open source supply chain attacks on tools like Trivy and LiteLLM into large-scale ransomware operations.