Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

AIMDS

БесплатноБез исполняемых скриптовНе проверен

AI Manipulation Defense System implementation with Midstream, AgentDB, and lean-agentic

ruvnetот ruvnet★ 152 звезды на GitHub19 установок в других каталогах

Об этом скилле

AIMDS: AI Manipulation Defense System

Build production-grade AI manipulation defense systems using Midstream's temporal analysis, AgentDB's vector search, and lean-agentic's theorem proving capabilities.

Quick Start

Initialize AIMDS Project

# Create project structure
mkdir -p aimds/{src,tests,config,docs}

# Initialize Rust workspace with Midstream
cargo init --lib
cargo add temporal-compare temporal-neural-solver strange-loop
cargo add temporal-attractor-studio nanosecond-scheduler quic-multistream

# Initialize TypeScript with AgentDB and lean-agentic
npm init -y
npm install [email protected] [email protected] zod dotenv
npm install -D typescript @types/node vitest

Basic Usage

import { AgentDB } from 'agentdb';
import { LeanAgenticClient } from 'lean-agentic';

// Initialize AIMDS components
const db = new AgentDB({
  path: './aimds-db',
  quantization: 'int8' // 4x memory reduction
});

const prover = new LeanAgenticClient({
  endpoint: 'http://localhost:3000',
  verbose: true
});

// Detect adversarial patterns
const result = await db.vectorSearch({
  query: userInput,
  k: 10,
  metric: 'cosine'
});

// Verify with formal methods
const verified = await prover.prove({
  theorem: 'input_satisfies_policy',
  context: result.matches
});

Core Concepts

Architecture Overview

Three-Layer Defense

  1. Temporal Analysis (Midstream)

    • Behavioral pattern detection via temporal-compare
    • Strange-loop detection for manipulation attempts
    • Nanosecond precision with scheduler
    • QUIC-based distributed coordination
  2. Vector Intelligence (AgentDB)

    • 150x faster semantic search with HNSW
    • 4-32x memory reduction via quantization
    • Persistent pattern learning
    • Hybrid search (vector + metadata)
  3. Formal Verification (lean-agentic)

    • Mathematical proof of safety properties
    • Policy compliance verification
    • Theorem proving for critical decisions
    • Symbolic reasoning integration

Data Flow

User Input → Temporal Analysis → Vector Search → Formal Verification → Decision
     ↓              ↓                  ↓                ↓                ↓
  Normalize    Detect Patterns    Find Similar    Prove Safety    Allow/Block

Implementation Guide

Phase 1: Temporal Pattern Detection

Setup Midstream Analyzers

Rust Implementation

use temporal_compare::{TemporalCompare, ComparisonResult};
use strange_loop::{StrangeLoop, LoopDetector};
use nanosecond_scheduler::{Scheduler, Task};

pub struct AIMDSAnalyzer {
    temporal: TemporalCompare,
    loop_detector: StrangeLoop,
    scheduler: Scheduler,
}

impl AIMDSAnalyzer {
    pub fn new() -> Self {
        Self {
            temporal: TemporalCompare::default(),
            loop_detector: StrangeLoop::new(),
            scheduler: Scheduler::with_precision_ns(100), // 100ns precision
        }
    }

    pub async fn analyze_behavior(&self, events: Vec<Event>) -> AnalysisResult {
        // Schedule temporal analysis
        let task = Task::new(move || {
            // Compare event sequences
            let comparison = self.temporal.compare(&events);

            // Detect manipulation loops
            let loops = self.loop_detector.detect(&events);

            AnalysisResult {
                temporal_anomaly: comparison.deviation > 0.3,
                loop_detected: !loops.is_empty(),
                confidence: comparison.confidence,
            }
        });

        self.scheduler.schedule(task).await
    }
}

TypeScript Bridge

import { spawn } from 'child_process';
import { promisify } from 'util';

export class MidstreamBridge {
  async analyzePattern(events: Event[]): Promise<AnalysisResult> {
    // Call Rust binary via CLI
    const result = await this.execRust('aimds-analyzer', [
      '--events', JSON.stringify(events),
      '--precision', '100ns'
    ]);

    return JSON.parse(result);
  }

  private async execRust(cmd: string, args: string[]): Promise<string> {
    return new Promise((resolve, reject) => {
      const proc = spawn(cmd, args);
      let output = '';

      proc.stdout.on('data', data => output += data);
      proc.on('close', code => {
        if (code === 0) resolve(output);
        else reject(new Error(`Exit code ${code}`));
      });
    });
  }
}

Phase 2: Vector Pattern Matching

AgentDB Integration

Setup Vector Database

import { AgentDB, VectorSearchOptions } from 'agentdb';
import { z } from 'zod';

const PatternSchema = z.object({
  pattern_id: z.string(),
  category: z.enum(['jailbreak', 'prompt-injection', 'data-leak', 'bias']),
  severity: z.number().min(0).max(1),
  description: z.string(),
  embedding: z.array(z.number())
});

export class PatternDatabase {
  private db: AgentDB;

  const
Полный SKILL.md на GitHub

Установить AIMDS в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

temporal-compare
nanosecond-scheduler
temporal-attractor-studio
temporal-neural-solver
strange-loop
quic-multistream
agentdb
lean-agentic

FAQ

Что делает скилл AIMDS?

AI Manipulation Defense System implementation with Midstream, AgentDB, and lean-agentic

Как установить скилл AIMDS?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл AIMDS запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить AIMDS с