
Security News
Risky Biz Podcast: AI Agents Are Raising the Stakes for Software Supply Chain Security
Open source attacks are accelerating as AI coding agents pull in dependencies faster, with less human review.
@copass/mastra
Advanced tools
Mastra tool adapters for Copass — drop-in discover/interpret/search tools for Mastra agents
Copass retrieval as Mastra tools. The LLM decides whether to discover, interpret, or search — you don't write the tool-calling loop.
Install the Copass CLI and bootstrap your account:
npm install -g @copass/cli
copass login # email OTP
copass setup # creates a sandbox, writes .olane/refs.json
copass apikey create --name my-app # prints an olk_... key — shown once, save it
| Output | Use as |
|---|---|
olk_... key printed by copass apikey create | COPASS_API_KEY |
sandbox_id in ./.olane/refs.json | COPASS_SANDBOX_ID |
project_id in ./.olane/refs.json (optional) | COPASS_PROJECT_ID |
Ingest some content so retrieval has something to return:
copass ingest path/to/file.md
# or pipe stdin: echo "some decision or note" | copass ingest -
npm install @copass/mastra @copass/core @mastra/core @ai-sdk/anthropic zod
import { CopassClient } from '@copass/core';
import { copassTools, createWindowTracker } from '@copass/mastra';
import { Agent } from '@mastra/core/agent';
import { anthropic } from '@ai-sdk/anthropic';
const copass = new CopassClient({
auth: { type: 'bearer', token: process.env.COPASS_API_KEY! },
});
const sandbox_id = process.env.COPASS_SANDBOX_ID!;
const window = await copass.contextWindow.create({ sandbox_id });
const tracker = createWindowTracker({ window });
const tools = copassTools({ client: copass, sandbox_id, window });
const agent = new Agent({
name: 'support-bot',
instructions: 'Answer questions using the knowledge graph.',
model: anthropic('claude-opus-4-7'),
tools,
});
const userMessage = 'what do we know about checkout retry behavior?';
await tracker.recordUserTurn(userMessage);
const response = await agent.generate(userMessage, {
onStepFinish: tracker.onStepFinish,
maxSteps: 5,
});
console.log(response.text);
If it worked, the answer cites concepts from whatever you ingested. Keep the same window and tracker across turns — follow-up calls won't re-surface items the agent already used.
Mastra's agent.generate() / agent.stream() fire onStepFinish after each internal step with response.messages — the assistant and tool messages generated during that step. createWindowTracker(...) returns a handler that mirrors those into the ContextWindow, de-duplicated against what's already there.
The user's initial message isn't in onStepFinish (it's the input going into the call), so capture it explicitly with tracker.recordUserTurn(text) before agent.generate(). Safe to call repeatedly — the tracker de-duplicates.
Tool results (role: 'tool') are skipped by default; opt in with createWindowTracker({ window, includeToolMessages: true }) if you want them tracked.
createWindowTracker. Without the tracker, retrieval sees an empty history.{ discover, interpret, search } object straight into any agent config.| Tool | When the LLM calls it |
|---|---|
discover | "What's relevant?" — ranked menu of pointers |
interpret | "Tell me about these specific items." — brief pinned to canonical_ids |
search | "Answer this directly." — full synthesized answer |
@copass/core — client SDK@copass/ai-sdk, @copass/langchain, copass-pydantic-ai — same shape for other frameworks@copass/mcp — standalone MCP server for Claude Code / Desktop / CursorMIT
FAQs
Mastra tool adapters for Copass — drop-in discover/interpret/search tools for Mastra agents
The npm package @copass/mastra receives a total of 33 weekly downloads. As such, @copass/mastra popularity was classified as not popular.
We found that @copass/mastra 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.

Security News
Open source attacks are accelerating as AI coding agents pull in dependencies faster, with less human review.

Research
/Security News
Malicious Chrome and Firefox extensions posed as free VPNs while stealing clipboard data through later extension updates.

Research
/Security News
Miasma Mini Shai-Hulud hits @immobiliarelabs Backstage plugins, targeting GitLab and LDAP auth packages on npm.