# Function createSecurityError

Skills module exports (Voyager-style skill library) - Issue #528 Split from agents.ts for file size compliance (Issue #285)

- createSecurityError(
  code: SecurityErrorCode,
  message: string,
  context?: Record<string, unknown>,
  ): SkillSecurityError

  Creates a security error with the given code and message.

  #### Parameters

  - code: SecurityErrorCode

    The error code

  - message: string

    Human-readable error message

  - `Optional` context: Record<string, unknown>

    Additional context for debugging

  #### Returns SkillSecurityError

  A SkillSecurityError

  - Defined in packages/nexus-agents/src/agents/skills/skill-security.ts:222