@surfinguard/core-engine-wasm
v1.0.0
Published
WASM-powered heuristic scoring engine for the Surfinguard AI Security SDK — 18 analyzers, 152 threat patterns
Maintainers
Readme
@surfinguard/core-engine-wasm
WASM-powered heuristic scoring engine for the Surfinguard AI Security SDK. Provides 18 analyzers and 152 threat patterns compiled to WebAssembly for near-native performance.
Most users should install
@surfinguard/sdkinstead. This package is the low-level engine used internally by the SDK, CLI, and MCP server.
Install
npm install @surfinguard/core-engine-wasmUsage
import { initialize, CoreEngine } from '@surfinguard/core-engine-wasm';
// Must initialize WASM before first use
await initialize();
const engine = new CoreEngine();
const result = engine.check({ type: 'url', value: 'https://example.com' });
console.log(result.level); // 'SAFE' | 'CAUTION' | 'DANGER'
console.log(result.score); // 0-10Supported Action Types
url, command, text, file_read, file_write, api_call, query, code, message, transaction, auth, git, ui_action, infra, agent_comm, data_pipeline, document, iot
Risk Primitives
Each action is scored against 5 risk primitives: DESTRUCTION, EXFILTRATION, ESCALATION, PERSISTENCE, MANIPULATION. The composite score is max(primitive_scores).
| Level | Score | |-------|-------| | SAFE | 0–2 | | CAUTION | 3–6 | | DANGER | 7–10 |
License
MIT
