@moshesdk/sdk
v0.1.2
Published
TypeScript SDK for MosheSDK — runtime security for AI agents
Maintainers
Readme
@moshesdk/sdk
TypeScript SDK for MosheSDK — runtime security for AI agents.
Installation
pnpm add @moshesdk/sdk
# or
npm install @moshesdk/sdkRequires Node.js ≥ 18. Zero mandatory runtime dependencies.
Quick Start
import { GenericAdapter, MemoryStore, Moshe } from '@moshesdk/sdk';
const moshe = new Moshe({
policy: {
forbiddenCommands: ['rm\\s+-rf'],
forbiddenFiles: ['.env'],
sensitiveFiles: ['id_rsa']
},
store: new MemoryStore(),
onError: 'BLOCK',
onUnhandledReview: 'BLOCK'
});
const session = moshe.withSession('run-001');
const adapter = new GenericAdapter(session, { framework: 'my-agent' });
const result = await adapter.wrapCommand({
command: 'ls -la',
toolName: 'shell',
execute: async () => runShell('ls -la')
});Adapters
import { AnthropicAdapter, OpenAIAdapter } from '@moshesdk/sdk';
// OpenAI tool calls
const oa = new OpenAIAdapter(session);
const result = await oa.wrapToolCall({ toolCall, execute });
// Anthropic tool_use blocks
const aa = new AnthropicAdapter(session);
const result = await aa.wrapToolUse({ toolUse, execute });Documentation
See the root README for the full integration guide, feature overview, and use cases.
