Introducing a new way to review your PRs.

Read the announcement

affaan-m / agentshield

AI agent security scanner. Detect vulnerabilities in agent configurations, MCP servers, and tool permissions. Available as CLI, GitHub Action, ECC plugin, and GitHub App integration. 🛡️

View on GitHub

20 documents · Updated Sep 11, 2026

docs / threat-intelligence

Threat intelligence

Threat intelligence gives AgentShield a local knowledge base of known weaknesses and harmful package signals. It turns this knowledge into evidence for security analysis and supply-chain decisions, so a package or MCP server can be assessed against known risk before a team chooses to use it. See Supply-chain security for the wider risk model and Supply-chain verification for package discovery and verification.

Intelligence scope

The threat intelligence service records Common Vulnerabilities and Exposures (CVEs), known harmful packages, and MCP server packages with known weaknesses. The records focus on AI coding tools and their integrations, where a package can affect command execution, file access, credentials, or agent permissions.

Vulnerability records

Each CVE record connects a vulnerability identifier to the affected package, severity, risk category, description, and any known fixed version. Some records also include patterns that help the security rules recognize a vulnerable configuration and links to external research that supports the record. The collection covers MCP components, Claude Code, Cursor, GitHub Copilot, OpenAI Codex CLI, and other AI development tools.

References: src/…/cve-database.ts• L1-37 src/…/cve-database.ts• L242-461

Harmful package indicators

Package indicators extend CVE data to threats that do not use a CVE identifier. They describe typosquats, malicious packages, and compromised package versions. The same knowledge set also maps vulnerable MCP server names to their related CVEs, which lets analysis report one server-level risk even when a configuration invokes the package through a command such as npx.

References: src/…/cve-database.ts• L39-53 src/…/cve-database.ts• L463-582

Security analysis

Threat intelligence is useful when it is joined to an observed package or configuration. AgentShield keeps the knowledge set separate from the rules that inspect input, then lets those rules translate a match into a finding with severity, evidence, and a suggested action.

MCP configuration analysis

The MCP analysis rules inspect MCP and settings JSON files for configured servers. They compare both the command and its arguments with known vulnerable server packages and harmful package names. A match becomes a critical finding that names the server, identifies the package or CVEs, and directs the user to update, replace, or remove it.

The flow moves from a configuration file to a package match and then to a finding consumed by the normal security report.

flowchart LR
    A[MCP or settings JSON] --> B[Read server command and arguments]
    B --> C{Known vulnerable server?}
    C -- Yes --> D[CVE-backed finding]
    C -- No --> E{Known harmful package?}
    E -- Yes --> F[Malicious-package finding]
    E -- No --> G[No threat-intelligence finding]
    D --> H[Security report]
    F --> H

The rules skip other file types and ignore invalid JSON rather than treating unrelated text as a package match. They recognize a package when it is the command itself or when it appears as a non-flag argument.

References: src/…/mcp-cve.ts• L8-23 src/…/mcp-cve.ts• L24-60 src/…/mcp-cve.ts• L63-115 src/…/index.ts• L1-25

Package verification enrichment

Supply-chain verification uses the same intelligence when it reviews extracted packages. It adds a critical known-malicious risk for a matching harmful package and a high known-vulnerable risk for a matching vulnerable server. The resulting package record keeps the CVE identifiers as evidence beside other signals such as name similarity, Git pinning, and registry metadata.

This shared source keeps configuration analysis and package analysis aligned. A package can therefore affect both the detailed security findings and the broader supply-chain report when the two workflows observe it in different forms.

References: src/…/verify.ts• L21-57 src/…/types.ts• L29-61

Supply-chain decisions

Known vulnerability intelligence supports a decision rather than replacing one. A match gives the reviewer a clear reason to update or replace a dependency, while the surrounding verification signals show whether the package also has provenance, version, or registry concerns.

Offline intelligence checks

The local threat records are available without a registry request. In offline mode, verification still checks known harmful packages, known vulnerable servers, typosquatting, and unpinned Git sources. This allows a supply-chain review to produce useful risk evidence when external package metadata is not available.

References: src/…/verify.ts• L24-27 src/…/verify.ts• L34-74 src/action-supply-chain.ts• L26-44

Risk gates

The supply-chain report counts risky packages and separates critical from high risk. When the supply-chain gate is enabled, either count causes the job to fail. When the gate is disabled, the job reports the evidence without blocking the workflow.

References: src/action-supply-chain.ts• L3-24 src/action-supply-chain.ts• L26-60 src/…/types.ts• L63-81

Change checklist

When these files or sections are changed, remember to consider these:

  • Keep the CVE record fields, package indicators, and vulnerable-server mappings consistent. A new record without a usable package mapping may be visible to direct lookup but not to configuration or package checks.
  • Keep package-version changes aligned with the version rules for compromised packages. A stale affected-version list can create false risk or miss a known compromise.
  • Preserve the link between risk types and report severity. The supply-chain gate depends on critical and high counts rather than on the presence of a CVE identifier alone.
  • Keep MCP rule registration aligned with the threat-intelligence checks. A rule that is not part of the rule set cannot turn a known match into a security finding.

Important failure modes

TriggerConsequenceGuard
A package name is added to harmful-package data without the affected version for a version-limited compromise.Safe versions can be flagged as harmful.Keep affectedVersions current and validate both affected and patched versions.
A vulnerable MCP package is invoked under a path or through command arguments that the package matcher does not recognize.The CVE-backed finding is missed.Keep command and argument forms covered when adding or changing server mappings.
A known-vulnerable server mapping omits its CVE identifiers.The risk may appear in a report without traceable vulnerability evidence.Keep each vulnerable-server mapping linked to one or more CVE records.
The gate is enabled while threat records or package mappings are stale.A job can pass a risky package or fail on a package that is no longer affected.Review the local intelligence data when advisories or fixed versions change.

Key files

FileWhy to read it
src/…/cve-database.tsDefines the CVE records, harmful package indicators, vulnerable MCP server mappings, and lookup checks.
src/…/mcp-cve.tsShows how threat matches become security findings for MCP and settings configurations.
src/…/index.tsShows where the CVE-aware rules enter the shared security rule set.
src/…/verify.tsShows how known threat matches become package risks during supply-chain verification.
src/…/types.tsDefines the package risk and report shapes that carry threat evidence into decisions.
src/action-supply-chain.tsShows how report severity controls the supply-chain job status and optional failure gate.