Sign In

@opena2a/ai-classifier

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@opena2a/ai-classifier

Tier-based AI package classification (native / adjacent / unrelated) for OpenA2A trust tooling

latest
Source
npmnpm
Version
0.1.1
Version published
Weekly downloads
64
39.13%
Maintainers
1
Weekly downloads
 
Created
Source

@opena2a/ai-classifier

Decides whether a package is AI-native, AI-adjacent, or unrelated so ai-trust, hackmyagent, and opena2a can route it correctly.

Why it exists

ai-trust is for AI packages. Scanning lodash with it produces confusing scores and wastes the user's time. This package is the shared rulebook that every OpenA2A CLI uses to answer one question: does AI trust apply to this package?

Tiers (v0.1)

TierMeaningExampleai-trust behavior
nativeAI-specific (MCP server, A2A agent, skill, AI tool, LLM)@modelcontextprotocol/server-filesystemFull trust verification
adjacentGeneral-purpose but in the AI trust boundaryopenai, dotenvStubbed in v0.3 → v0.4
unrelatedGeneral-purpose library, no AI surfaceexpress, chalk, typescriptDefer to HMA
unknownCan't classify confidentlynovel or unnamed packagesSurface uncertainty, let user decide

Usage

import { classify, isAiTrustScope } from "@opena2a/ai-classifier";

const result = classify({ name: "express", packageType: "library" });
// { tier: "unrelated", reasons: [], reasoning: "Registered as a general-purpose library" }

if (isAiTrustScope(result)) {
  // run ai-trust verification
} else {
  // route to HMA
}

Design rules

  • Registry package_type is the strongest signal. We trust the registry's classification first.
  • Name-based fallback is conservative. We only call a package "unrelated" by name when it's on a curated allowlist of well-known libraries (chalk, typescript, @types/*, etc.).
  • Never false-classify as unrelated. Ambiguous packages return unknown, not unrelated. False rejections (dropping an AI package from an audit) are worse than uncertainty.

FAQs

Package last updated on 22 Apr 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts