-
Notifications
You must be signed in to change notification settings - Fork 1
feat: add npm malware detection on deploy #693
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- Add packages/server/src/api/project/malware.ts with Zod schemas and API client - Add packages/cli/src/utils/deps.ts for dependency extraction via bun pm ls - Integrate malware check into deploy flow (async during build) - Add Security Scan step before upload - Add comprehensive unit tests for deps and malware API
📝 WalkthroughWalkthroughIntroduces malware scanning capability for cloud deployments with dependency extraction utilities and API integration. Includes refactoring of CLI formatting across multiple modules, infrastructure updates for error handling and code organization, and comprehensive test coverage for the new scanning functionality. Changes
🚥 Pre-merge checks | ✅ 1✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 🧹 Recent nitpick comments
📜 Recent review detailsConfiguration used: Organization UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (16)
🧰 Additional context used📓 Path-based instructions (8)packages/cli/src/cmd/*/index.ts📄 CodeRabbit inference engine (packages/cli/AGENTS.md)
Files:
packages/cli/src/cmd/**/*.ts📄 CodeRabbit inference engine (packages/cli/AGENTS.md)
Files:
packages/cli/src/**/*.ts📄 CodeRabbit inference engine (packages/cli/AGENTS.md)
Files:
**/*.{ts,tsx}📄 CodeRabbit inference engine (AGENTS.md)
Files:
packages/server/src/**/*.ts📄 CodeRabbit inference engine (packages/server/AGENTS.md)
Files:
packages/*/test/**/*.{ts,tsx}📄 CodeRabbit inference engine (AGENTS.md)
Files:
packages/server/**/*.test.ts📄 CodeRabbit inference engine (packages/server/AGENTS.md)
Files:
packages/runtime/**/*.{ts,tsx}📄 CodeRabbit inference engine (packages/runtime/AGENTS.md)
Files:
🧠 Learnings (5)📚 Learning: 2025-12-21T00:31:41.858ZApplied to files:
📚 Learning: 2025-12-19T14:19:33.765ZApplied to files:
📚 Learning: 2025-12-30T00:13:37.849ZApplied to files:
📚 Learning: 2026-01-13T04:32:02.691ZApplied to files:
📚 Learning: 2025-12-13T14:15:18.261ZApplied to files:
🧬 Code graph analysis (5)packages/server/src/api/sandbox/util.ts (1)
packages/cli/test/schema-parser-confirm-alias.test.ts (1)
packages/server/test/malware.test.ts (1)
packages/cli/test/deps.test.ts (1)
packages/server/src/api/project/malware.ts (3)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (10)
🔇 Additional comments (27)
✏️ Tip: You can disable this entire section by setting Comment |
📦 Canary Packages Publishedversion: PackagesInstallAdd to your {
"dependencies": {
"@agentuity/auth": "https://agentuity-sdk-objects.t3.storage.dev/npm/0.1.24-42e6d18/agentuity-auth-0.1.24-42e6d18.tgz",
"@agentuity/evals": "https://agentuity-sdk-objects.t3.storage.dev/npm/0.1.24-42e6d18/agentuity-evals-0.1.24-42e6d18.tgz",
"@agentuity/core": "https://agentuity-sdk-objects.t3.storage.dev/npm/0.1.24-42e6d18/agentuity-core-0.1.24-42e6d18.tgz",
"@agentuity/server": "https://agentuity-sdk-objects.t3.storage.dev/npm/0.1.24-42e6d18/agentuity-server-0.1.24-42e6d18.tgz",
"@agentuity/workbench": "https://agentuity-sdk-objects.t3.storage.dev/npm/0.1.24-42e6d18/agentuity-workbench-0.1.24-42e6d18.tgz",
"@agentuity/react": "https://agentuity-sdk-objects.t3.storage.dev/npm/0.1.24-42e6d18/agentuity-react-0.1.24-42e6d18.tgz",
"@agentuity/schema": "https://agentuity-sdk-objects.t3.storage.dev/npm/0.1.24-42e6d18/agentuity-schema-0.1.24-42e6d18.tgz",
"@agentuity/cli": "https://agentuity-sdk-objects.t3.storage.dev/npm/0.1.24-42e6d18/agentuity-cli-0.1.24-42e6d18.tgz",
"@agentuity/frontend": "https://agentuity-sdk-objects.t3.storage.dev/npm/0.1.24-42e6d18/agentuity-frontend-0.1.24-42e6d18.tgz",
"@agentuity/opencode": "https://agentuity-sdk-objects.t3.storage.dev/npm/0.1.24-42e6d18/agentuity-opencode-0.1.24-42e6d18.tgz",
"@agentuity/runtime": "https://agentuity-sdk-objects.t3.storage.dev/npm/0.1.24-42e6d18/agentuity-runtime-0.1.24-42e6d18.tgz"
}
}Or install directly: bun add https://agentuity-sdk-objects.t3.storage.dev/npm/0.1.24-42e6d18/agentuity-auth-0.1.24-42e6d18.tgz
bun add https://agentuity-sdk-objects.t3.storage.dev/npm/0.1.24-42e6d18/agentuity-evals-0.1.24-42e6d18.tgz
bun add https://agentuity-sdk-objects.t3.storage.dev/npm/0.1.24-42e6d18/agentuity-core-0.1.24-42e6d18.tgz
bun add https://agentuity-sdk-objects.t3.storage.dev/npm/0.1.24-42e6d18/agentuity-server-0.1.24-42e6d18.tgz
bun add https://agentuity-sdk-objects.t3.storage.dev/npm/0.1.24-42e6d18/agentuity-workbench-0.1.24-42e6d18.tgz
bun add https://agentuity-sdk-objects.t3.storage.dev/npm/0.1.24-42e6d18/agentuity-react-0.1.24-42e6d18.tgz
bun add https://agentuity-sdk-objects.t3.storage.dev/npm/0.1.24-42e6d18/agentuity-schema-0.1.24-42e6d18.tgz
bun add https://agentuity-sdk-objects.t3.storage.dev/npm/0.1.24-42e6d18/agentuity-cli-0.1.24-42e6d18.tgz
bun add https://agentuity-sdk-objects.t3.storage.dev/npm/0.1.24-42e6d18/agentuity-frontend-0.1.24-42e6d18.tgz
bun add https://agentuity-sdk-objects.t3.storage.dev/npm/0.1.24-42e6d18/agentuity-opencode-0.1.24-42e6d18.tgz
bun add https://agentuity-sdk-objects.t3.storage.dev/npm/0.1.24-42e6d18/agentuity-runtime-0.1.24-42e6d18.tgzCLI Executables
Run Canary CLIagentuity canary 0.1.24-42e6d18 [command] [...args] |
add npm malware detection on deploy
Overview
Adds npm dependency malware detection during deployments to protect against supply chain attacks. The system uses Aikido's malware predictions database containing ~50,000 known malicious packages.
How It Works
bun pm ls --allChanges
Catalyst
internal/malware/store.go- Atomic store with O(1) lookup, wildcard version supportinternal/malware/loader.go- HTTP fetch with 30s timeout, 50MB limit, ETag supportinternal/malware/refresh.go- Background service with 24h refresh cycle (±15min jitter)server/apis/security/malware_check_2026_01_22.go- POST endpoint for package checkingserver/routes/routes.go- Route registrationserver/server.go- Service initialization on startupdocs/malware_detection.md- Architecture documentationSDK
packages/server/src/api/project/malware.ts- Zod schemas and API clientpackages/cli/src/utils/deps.ts- Dependency extraction usingbun pm ls --allpackages/cli/src/cmd/cloud/deploy.ts- Async malware check with Security Scan stepError Handling
Detection Logic
Packages are blocked if their reason is
MALWAREorSUSPICIOUS. Packages withTELEMETRYreason are NOT blocked (privacy concern but not malware).Testing
Repository-Specific Changes
packages/server/src/api/project/malware.tswith Zod schemas and API clientpackages/cli/src/utils/deps.tsfor extracting dependencies viabun pm ls --allSummary by CodeRabbit
New Features
Tests
✏️ Tip: You can customize this high-level summary in your review settings.