New:Introducing Socket Scanning for VS Code Marketplace Extensions.Learn more →
Get Started

@mcpolyglot/security

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mcpolyglot/security

Non-bypassable security middleware for mcpolyglot: scopes, redaction, audit, rate-limit, and untrusted-data wrapping.

Source
npmnpm
Version
0.0.3
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

@mcpolyglot/security

The non-bypassable security middleware for mcpolyglot. Implements every phase of the pipeline that wraps tool calls in @mcpolyglot/core.

What's in here

  • ScopeGuard — refuses tools whose required scopes aren't in the granted set.
  • RateLimiter — token bucket per session per tool, plus a max-concurrent gate.
  • Redactor — built-in regex set (emails, JWTs, AWS access keys, GitHub tokens, SSNs, credit-card numbers) plus per-table column deny lists.
  • AuditLogger — JSONL appender for ~/.mcpolyglot/audit.log. Logs argshash + metadata; never raw args or results.
  • wrapUntrusted / enforceSize — <mcpolyglot-data> prompt-injection wrapper and a hard byte cap on serialized output.
  • defaultSecurityHooks(opts) — composes all of the above into the SecurityHooks shape McpolyglotServer expects.
  • composeHooks(...hooks) — chain custom hooks alongside the defaults.

Why a separate package

Connectors, the CLI, and any embedding host all need to construct the security hooks the same way. Keeping them in one package makes that boring and reviewable.

Docs

MIT licensed.

FAQs

Package last updated on 28 Sep 2026

Related posts