🌊 The original agent harness. Deploy intelligent multi-player swarms, coordinate autonomous workflows, and build conversational AI systems. Features adaptive memory, self-learning intelligence, federation, vector RAG integration, and native Claude Code / Codex / Hermes and many more Integrated
TypeScript agentic-aiagentic-frameworkagentic-workflowagentsai-agentsai-assistantai-skillsautonomous-agentsclaudecodexdsh-pluginharnessmcp-servermulti-agentmulti-agent-systemsnpmskillsswarmswarm-intelligencetypescript
/**
* JSON security utilities for memory backends.
* Prevents prototype pollution when parsing JSON from database rows.
*
* @module v3/memory/json-security
*/
const DANGEROUS_KEYS = new Set(['__proto__', 'constructor', 'prototype']);
/**
* Parse JSON safely, stripping keys that enable prototype pollution.
* Drop-in replacement for JSON.parse that filters __proto__, constructor, prototype.
*/
export function safeJsonParse<T = unknown>(content: string): T {
return JSON.parse(content, (key, value) => {
if (DANGEROUS_KEYS.has(key)) {
return undefined;
}
return value;
}) as T;
}