AG

agent-security-manager

Provides security protocols for distributed consensus systems, including threat detection and cryptographic verification.

Install

mkdir -p .claude/skills/agent-security-manager && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/890" && unzip -o skill.zip -d .claude/skills/agent-security-manager && rm skill.zip

Installs to .claude/skills/agent-security-manager

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Agent skill for security-manager - invoke with $agent-security-manager
70 charsno explicit “when” trigger
Advanced

Key capabilities

  • Deploys threshold cryptography and ZK proofs
  • Detects Byzantine and DoS network attacks
  • Manages distributed key generation and rotation
  • Secures communications with TLS 1.3
  • Audits security protocols post-execution

How it works

Hooks into task execution to verify consensus data via cryptographic threshold signatures and threat mitigation protocols.

Inputs & outputs

You give it
Consensus task context
You get back
Security audit logs and cryptographic verification results

When to use agent-security-manager

  • Deploy threshold cryptography
  • Identify Byzantine attacks
  • Manage key rotation

About this skill


name: security-manager type: security color: "#F44336" description: Implements comprehensive security mechanisms for distributed consensus protocols capabilities:

  • cryptographic_security
  • attack_detection
  • key_management
  • secure_communication
  • threat_mitigation priority: critical hooks: pre: | echo "🔐 Security Manager securing: $TASK"

    Initialize security protocols

    if [[ "$TASK" == "consensus" ]]; then echo "🛡️ Activating cryptographic verification" fi post: | echo "✅ Security protocols verified"

    Run security audit

    echo "🔍 Conducting post-operation security audit"

Consensus Security Manager

Implements comprehensive security mechanisms for distributed consensus protocols with advanced threat detection.

Core Responsibilities

  1. Cryptographic Infrastructure: Deploy threshold cryptography and zero-knowledge proofs
  2. Attack Detection: Identify Byzantine, Sybil, Eclipse, and DoS attacks
  3. Key Management: Handle distributed key generation and rotation protocols
  4. Secure Communications: Ensure TLS 1.3 encryption and message authentication
  5. Threat Mitigation: Implement real-time security countermeasures

Technical Implementation

Threshold Signature System

class ThresholdSignatureSystem {
  constructor(threshold, totalParties, curveType = 'secp256k1') {
    this.t = threshold; // Minimum signatures required
    this.n = totalParties; // Total number of parties
    this.curve = this.initializeCurve(curveType);
    this.masterPublicKey = null;
    this.privateKeyShares = new Map();
    this.publicKeyShares = new Map();
    this.polynomial = null;
  }

  // Distributed Key Generation (DKG) Protocol
  async generateDistributedKeys() {
    // Phase 1: Each party generates secret polynomial
    const secretPolynomial = this.generateSecretPolynomial();
    const commitments = this.generateCommitments(secretPolynomial);
    
    // Phase 2: Broadcast commitments
    await this.broadcastCommitments(commitments);
    
    // Phase 3: Share secret values
    const secretShares = this.generateSecretShares(secretPolynomial);
    await this.distributeSecretShares(secretShares);
    
    // Phase 4: Verify received shares
    const validShares = await this.verifyReceivedShares();
    
    // Phase 5: Combine to create master keys
    this.masterPublicKey = this.combineMasterPublicKey(validShares);
    
    return {
      masterPublicKey: this.masterPublicKey,
      privateKeyShare: this.privateKeyShares.get(this.nodeId),
      publicKeyShares: this.publicKeyShares
    };
  }

  // Threshold Signature Creation
  async createThresholdSignature(message, signatories) {
    if (signatories.length < this.t) {
      throw new Error('Insufficient signatories for threshold');
    }

    const partialSignatures = [];
    
    // Each signatory creates partial signature
    for (const signatory of signatories) {
      const partialSig = await this.createPartialSignature(message, signatory);
      partialSignatures.push({
        signatory: signatory,
        signature: partialSig,
        publicKeyShare: this.publicKeyShares.get(signatory)
      });
    }

    // Verify partial signatures
    const validPartials = partialSignatures.filter(ps => 
      this.verifyPartialSignature(message, ps.signature, ps.publicKeyShare)
    );

    if (validPartials.length < this.t) {
      throw new Error('Insufficient valid partial signatures');
    }

    // Combine partial signatures using Lagrange interpolation
    return this.combinePartialSignatures(message, validPartials.slice(0, this.t));
  }

  // Signature Verification
  verifyThresholdSignature(message, signature) {
    return this.curve.verify(message, signature, this.masterPublicKey);
  }

  // Lagrange Interpolation for Signature Combination
  combinePartialSignatures(message, partialSignatures) {
    const lambda = this.computeLagrangeCoefficients(
      partialSignatures.map(ps => ps.signatory)
    );

    let combinedSignature = this.curve.infinity();
    
    for (let i = 0; i < partialSignatures.length; i++) {
      const weighted = this.curve.multiply(
        partialSignatures[i].signature,
        lambda[i]
      );
      combinedSignature = this.curve.add(combinedSignature, weighted);
    }

    return combinedSignature;
  }
}

Zero-Knowledge Proof System

class ZeroKnowledgeProofSystem {
  constructor() {
    this.curve = new EllipticCurve('secp256k1');
    this.hashFunction = 'sha256';
    this.proofCache = new Map();
  }

  // Prove knowledge of discrete logarithm (Schnorr proof)
  async proveDiscreteLog(secret, publicKey, challenge = null) {
    // Generate random nonce
    const nonce = this.generateSecureRandom();
    const commitment = this.curve.multiply(this.curve.generator, nonce);
    
    // Use provided challenge or generate Fiat-Shamir challenge
    const c = challenge || this.generateChallenge(commitment, publicKey);
    
    // Compute response
    const response = (nonce + c * secret) % this.curve.order;
    
    return {
      commitment: commitment,
      challenge: c,
      response: response
    };
  }

  // Verify discrete logarithm proof
  verifyDiscreteLogProof(proof, publicKey) {
    const { commitment, challenge, response } = proof;
    
    // Verify: g^response = commitment * publicKey^challenge
    const leftSide = this.curve.multiply(this.curve.generator, response);
    const rightSide = this.curve.add(
      commitment,
      this.curve.multiply(publicKey, challenge)
    );
    
    return this.curve.equals(leftSide, rightSide);
  }

  // Range proof for committed values
  async proveRange(value, commitment, min, max) {
    if (value < min || value > max) {
      throw new Error('Value outside specified range');
    }

    const bitLength = Math.ceil(Math.log2(max - min + 1));
    const bits = this.valueToBits(value - min, bitLength);
    
    const proofs = [];
    let currentCommitment = commitment;
    
    // Create proof for each bit
    for (let i = 0; i < bitLength; i++) {
      const bitProof = await this.proveBit(bits[i], currentCommitment);
      proofs.push(bitProof);
      
      // Update commitment for next bit
      currentCommitment = this.updateCommitmentForNextBit(currentCommitment, bits[i]);
    }
    
    return {
      bitProofs: proofs,
      range: { min, max },
      bitLength: bitLength
    };
  }

  // Bulletproof implementation for range proofs
  async createBulletproof(value, commitment, range) {
    const n = Math.ceil(Math.log2(range));
    const generators = this.generateBulletproofGenerators(n);
    
    // Inner product argument
    const innerProductProof = await this.createInnerProductProof(
      value, commitment, generators
    );
    
    return {
      type: 'bulletproof',
      commitment: commitment,
      proof: innerProductProof,
      generators: generators,
      range: range
    };
  }
}

Attack Detection System

class ConsensusSecurityMonitor {
  constructor() {
    this.attackDetectors = new Map();
    this.behaviorAnalyzer = new BehaviorAnalyzer();
    this.reputationSystem = new ReputationSystem();
    this.alertSystem = new SecurityAlertSystem();
    this.forensicLogger = new ForensicLogger();
  }

  // Byzantine Attack Detection
  async detectByzantineAttacks(consensusRound) {
    const participants = consensusRound.participants;
    const messages = consensusRound.messages;
    
    const anomalies = [];
    
    // Detect contradictory messages from same node
    const contradictions = this.detectContradictoryMessages(messages);
    if (contradictions.length > 0) {
      anomalies.push({
        type: 'CONTRADICTORY_MESSAGES',
        severity: 'HIGH',
        details: contradictions
      });
    }
    
    // Detect timing-based attacks
    const timingAnomalies = this.detectTimingAnomalies(messages);
    if (timingAnomalies.length > 0) {
      anomalies.push({
        type: 'TIMING_ATTACK',
        severity: 'MEDIUM',
        details: timingAnomalies
      });
    }
    
    // Detect collusion patterns
    const collusionPatterns = await this.detectCollusion(participants, messages);
    if (collusionPatterns.length > 0) {
      anomalies.push({
        type: 'COLLUSION_DETECTED',
        severity: 'HIGH',
        details: collusionPatterns
      });
    }
    
    // Update reputation scores
    for (const participant of participants) {
      await this.reputationSystem.updateReputation(
        participant,
        anomalies.filter(a => a.details.includes(participant))
      );
    }
    
    return anomalies;
  }

  // Sybil Attack Prevention
  async preventSybilAttacks(nodeJoinRequest) {
    const identityVerifiers = [
      this.verifyProofOfWork(nodeJoinRequest),
      this.verifyStakeProof(nodeJoinRequest),
      this.verifyIdentityCredentials(nodeJoinRequest),
      this.checkReputationHistory(nodeJoinRequest)
    ];
    
    const verificationResults = await Promise.all(identityVerifiers);
    const passedVerifications = verificationResults.filter(r => r.valid);
    
    // Require multiple verification methods
    const requiredVerifications = 2;
    if (passedVerifications.length < requiredVerifications) {
      throw new SecurityError('Insufficient identity verification for node join');
    }
    
    // Additional checks for suspicious patterns
    const suspiciousPatterns = await this.detectSybilPatterns(nodeJoinRequest);
    if (suspiciousPatterns.length > 0) {
      await this.alertSystem.raiseSybilAlert(nodeJoinRequest, suspiciousPatterns);
      throw new SecurityError('Potential Sybil attack detected');
    }
    
    return true;
  }

  // Eclipse Attack Protection
  async protectAgainstEclipseAttacks(nodeId, connectionRequests) {
    const diversityMetrics = this.analyzePeerDiversity(connectionRequests);
    
    // Check for geographic diversity
    if (diversityMetrics.geographicEntropy < 2.0) {
      await this.

---

*Content truncated.*

When not to use it

  • When working with centralized systems without consensus requirements
  • When the system complexity outweighs the security risk

Prerequisites

Distributed protocol infrastructure

Limitations

  • High operational overhead for consensus nodes
  • Cryptographic implementations are sensitive to errors

How it compares

It provides specialized security orchestration for distributed consensus instead of general system security.

Compared to similar skills

agent-security-manager side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
agent-security-manager (this skill)36moNo flagsAdvanced
cosmos-vulnerability-scanner32moNo flagsAdvanced
token-integration-analyzer12moNo flagsAdvanced
skills027dReviewIntermediate

Try saying

Example prompts that trigger this skill in your AI assistant.

You might also like

cosmos-vulnerability-scanner

trailofbits

Scans Cosmos SDK blockchains for 9 consensus-critical vulnerabilities including non-determinism, incorrect signers, ABCI panics, and rounding errors. Use when auditing Cosmos chains or CosmWasm contracts.

32

token-integration-analyzer

trailofbits

Token integration and implementation analyzer based on Trail of Bits' token integration checklist. Analyzes token implementations for ERC20/ERC721 conformity, checks for 20+ weird token patterns, assesses contract composition and owner privileges, performs on-chain scarcity analysis, and evaluates how protocols handle non-standard tokens. Context-aware for both token implementations and token integrations.

12

skills

zhaoxuya520

本目录收录了一系列逆向工程相关的技能模块,每个子目录是一个独立模块,内含 `SKILL.md` 描述其适用场景、工具链和工作流程。

00

solidity-security

wshobson

Master smart contract security best practices to prevent common vulnerabilities and implement secure Solidity patterns. Use when writing smart contracts, auditing existing contracts, or implementing security measures for blockchain applications.

15115

supabase-rls-policy-generator

hopeoverture

This skill should be used when the user requests to generate, create, or add Row-Level Security (RLS) policies for Supabase databases in multi-tenant or role-based applications. It generates comprehensive RLS policies using auth.uid(), auth.jwt() claims, and role-based access patterns. Trigger terms include RLS, row level security, supabase security, generate policies, auth policies, multi-tenant security, role-based access, database security policies, supabase permissions, tenant isolation.

11109

backend-security-coder

sickn33

Expert in secure backend coding practices specializing in input validation, authentication, and API security. Use PROACTIVELY for backend security implementations or security code reviews.

2446

Search skills

Search the agent skills registry