Releases: davccavalcante/mcpcustoms
Releases · davccavalcante/mcpcustoms
Release list
[PUBLISHED ON NPMJS] @takk/mcpcustoms@1.0.0
STATUS: PUBLISHED ON NPMJS. This version was published to the npm registry on 2026-06-18T10:42:18Z with provenance attestation. View on npm: https://www.npmjs.com/package/@takk/mcpcustoms/v/1.0.0
[1.0.0] - 2026-06-18T03:34:14Z
Initial stable release. Universal, zero-runtime-dependency NPM library and CLI: a runtime customs and semantic firewall that inspects every Massive Intelligence (IM) agent tool call before execution and reaches an allow, block, or ask verdict, fail-closed by default.
Added
Core engine
createCustoms(options)factory returning theCustomsengine:inspect,inspectManifest,preview,registerDetector,setPolicy,auditTrail,verifyAuditChain,stats,prune,flush,snapshot,on.- Deterministic, side-effect-free inspection: never executes the tool, performs no network I/O, and reads time only through an injectable clock.
Verdictshape:decision(allow/block/ask), ariskScorein[0, 100], the collectedfindings, the tool, the instant, and the audit sequence.
Detectors (default suite)
metadata.tool-poisoning(critical): hidden instructions in the tool's own description.parameter.command-injection(critical): shell metacharacters, command substitution, chained destructive commands.parameter.path-traversal(high):../sequences and sensitive absolute paths.parameter.sql-injection(high): tautologies,UNION SELECT, stacked queries.parameter.secret-exfiltration(high): credential-store references and known key shapes.parameter.prompt-injection(medium): instruction-override phrasing.capability.side-effect-overreach(high): inferred side effects exceeding the declared ones.- Pure-function
Detectorcontract,stringLeavesargument flattening, andregisterDetectorfor custom detectors. A throwing detector is isolated to oneinfofinding. - Normalization pre-pass (
normalizeVariants): detectors run over percent-decoded, embedded-base64-decoded, Unicode NFKC-folded, and zero-width-stripped views of each argument and the description, so payloads obfuscated by common encodings are still matched. Bounded by depth, count, and length; a match on a decoded view is marked(after decoding).
Reputation
- Pluggable
ReputationSourcehook consulted on every inspection: aflaggedtool or publisher contributes a finding, atrustedone aninfosignal.staticReputationbuilds a source from in-memory allow and deny sets. The on-ramp for an external reputation database without coupling the core to a service.
Policy
DEFAULT_POLICY(fail-closed: block critical/high, ask medium) andSTRICT_POLICY(block down to medium, ask low).decide,dominantSeverity, and a monotonicriskScore.
Publisher verification
- Ed25519 version-locked manifest signing and verification against a pinned trust anchor:
signManifest,verifyPublisherClaim,manifestMessage,generatePublisherKeyPair. nodeSigner(node:crypto) andwebSigner(Web Crypto) producing byte-identical keys; the core engine carries no platform crypto import, the entries inject the signer.
Audit trail
- FNV-1a hash-chained, append-only, frozen audit events with
verifyAuditChain,prune(re-seals the surviving chain),maxAuditretention cap, andredactEvidencefor non-reversible evidence redaction.
State backends
memoryState(default),fileState({ path })(atomic JSON snapshot, corrupt-file quarantine, Node only), andkvState(kv, key?)(any structural key-value store, edge-friendly).
Entry points and adapters
- Eight subpath exports:
.,./publisher,./integrations,./vercel,./mcp,./store,./web,./edge. - Framework-agnostic guard (
createGuard,guardTool,enforceVerdict); Vercel AI SDK adapter (guardVercelTool,guardVercelTools); MCP adapter (guardMcpCall,inspectMcpCall,mcpToToolCall) that mapsreadOnlyHint/openWorldHintannotations to declared side effects. - The
webandedgebundles are verified free of anynode:reference.
CLI
- Binary
mcpcustomsexposed viapackage.json#bin. - Subcommands
inspect,verify,keygen,sign,help,version. Exit codes follow the verdict (0 allow, 1 block, 2 ask, 64 usage error). The CLI logic is pure over an injectedCliIO.
Distribution
- Dual ESM + CJS bundles built with tsup 8, target
es2022. - Separate
.d.tsand.d.ctstype files per entry point;exportsmap with splitimport/requireconditions. - Zero required runtime dependencies. Sibling
@takk/*packages are optional peers.
Quality
- 158 tests across 19 suites passing under Vitest 4 on Node 20, 22, and 24.
- Coverage: lines 95.7%, statements 95.3%, functions 98.6%, branches 89.1%.
- Labeled evasion benchmark in CI: each payload class is asserted blocked in its raw form and after base64, percent, zero-width, Unicode, and double encoding, the regression guard for the normalization pre-pass.
- Lint clean under Biome 2, typecheck clean under TypeScript 6 in maximum strict mode.
publintclean,attwgreen on all eight entry points (CJS, ESM, bundler),size-limitbudgets met (core 6.46 kB brotli ESM).
Security
- Published with
--provenance(SLSA attestation by GitHub Actions). Verify vianpm view @takk/mcpcustoms --json | jq .dist.attestations. - Fail-closed default policy; publisher verification requires a pinned trust anchor and an injected signer.
- Defense-in-depth, not a sole control: the detectors are heuristic pattern matchers over a normalization pre-pass, not a complete static analyzer. See SECURITY.md for the threat model.
Licensing
- Licensed under the Apache License, Version 2.0.
NOTICEships in the tarball alongsideLICENSE.
Engines
- Node
>=20.0.0. Tested on Node 20, 22, and 24.