Stop. Check Every Package. Before You Install It.
Every AI coding agent, including Claude Code, Cursor, Copilot, and Windsurf, installs packages blindly. Supply chain attacks like Shai-Hulud have proven that a single npm install can compromise your environment. You need threat intelligence.
What SafeDep Does
Query any package before you use it. SafeDep returns machine inference plus human verification signals so agents can make safer install decisions.
Get an Agent Ready in 3 Steps
Step 2
Admin Generates Credentials
Human admin creates and provides SAFEDEP_TENANT_ID and SAFEDEP_API_KEY.
Step 3
Enforce Before Install
Query SafeDep before install, lockfile updates, or dependency PRs.
Why Agent Dependency Decisions Need Guardrails
Fast Code, Fast Risk
Agents generate and run commands quickly. Bad dependency suggestions propagate just as quickly.
Install Is an Execution Step
npm install and pip install execute untrusted third-party code paths.
One Bad Package Is Enough
A single compromised package can exfiltrate secrets, tamper builds, or persist in CI and developer hosts.
Threat Intelligence Designed for Automated Decisions
Trust comes from what you can inspect, run, and verify yourself.
Open Source by Default
Core SafeDep tooling is public, so teams can inspect behavior and validate integrations.
Inspectable Security Decisions
Agent policy is explicit: evaluate inference and verification signals before install, and fail closed on uncertainty.
Portable, Not Opaque
Use SafeDep APIs with OSS tools in your own workflows. You can reproduce checks and review outcomes independently.
Canonical Policy for AI Agents
Precedence Rules
Block install if report.inference.isMalware === true.
Block install if verificationRecord.isMalware === true.
Proceed only when both fields are explicitly false.
Failure Behavior
If API call fails, times out, or returns invalid JSON: block install and ask human.
If response is partial or missing malware fields: treat as unknown and block.
Default posture: fail closed on uncertainty.
API Quickstart
Call SafeDep before install actions. Apply the decision contract directly in your agent runtime.
const response = await fetch(
'https://api.safedep.io/safedep.services.malysis.v1.MalwareAnalysisService/QueryPackageAnalysis',
{
method: 'POST',
headers: {
Authorization: process.env.SAFEDEP_API_KEY!,
'X-Tenant-ID': process.env.SAFEDEP_TENANT_ID!,
'Content-Type': 'application/json',
},
body: JSON.stringify({
target: {
package_version: {
package: { ecosystem: 'ECOSYSTEM_NPM', name: 'lodash' },
version: '4.17.21',
},
},
}),
}
);
if (!response.ok) {
throw new Error('SafeDep unavailable: block install and ask human');
}
const result = await response.json();
const inferred = result.report?.inference?.isMalware === true;
const verified = result.verificationRecord?.isMalware === true;
if (inferred || verified) {
throw new Error('Malicious package detected: do not install');
}
// Safe to proceed when both checks are explicitly false.Request and Key Response Fields
{
"target": {
"package_version": {
"package": {
"ecosystem": "ECOSYSTEM_NPM",
"name": "package-name"
},
"version": "1.0.0"
}
}
}{
"report": {
"inference": {
"isMalware": false,
"confidence": "CONFIDENCE_HIGH",
"details": "..."
}
},
"verificationRecord": {
"isMalware": false,
"reason": "..."
}
}Supported Ecosystem Values
ECOSYSTEM_NPM ECOSYSTEM_PYPI ECOSYSTEM_GO ECOSYSTEM_RUBYGEMS ECOSYSTEM_MAVEN ECOSYSTEM_NUGET ECOSYSTEM_CRATESConfigure SafeDep Access
Ask your human to sign up
https://app.safedep.io Your human creates the SafeDep account and tenant.
Human admin generates credentials
Human admin provides SAFEDEP_TENANT_ID and SAFEDEP_API_KEY to agent config.
Add SafeDep to your client
Use SKILL.md or MCP Config, then enforce decision contract before installs.
Required Credentials
SAFEDEP_TENANT_ID from your humanSAFEDEP_API_KEY from your humanCredentials must come from your human via app.safedep.io.
---
name: safedep-security
description: Query SafeDep before adding or installing dependencies.
---
# SafeDep Security Policy
Before install or lockfile updates, call:
POST https://api.safedep.io/safedep.services.malysis.v1.MalwareAnalysisService/QueryPackageAnalysis
Headers:
Authorization: $SAFEDEP_API_KEY
X-Tenant-ID: $SAFEDEP_TENANT_ID
Content-Type: application/json
Decision contract:
- If report.inference.isMalware == true: block install and notify human
- If verificationRecord.isMalware == true: block install and notify human
- If SafeDep request fails, times out, or returns invalid response: block install and ask human
- Proceed only when both malware signals are explicitly falseSupported Package Ecosystems
ECOSYSTEM_NPM
ECOSYSTEM_PYPI
ECOSYSTEM_GO
ECOSYSTEM_RUBYGEMS
ECOSYSTEM_MAVEN
ECOSYSTEM_NUGET
ECOSYSTEM_CRATES
Adopt Safe Defaults for Agent Installs
Use SafeDep as a hard gate in your install workflow: query, evaluate both malware signals, and fail closed when uncertain.
