Loading...
Loading...
Proactive security scanning for newly generated or modified code. Intelligently detects changes, runs appropriate scans (SAST, SCA, IaC), filters to only NEW issues, and prevents vulnerabilities at the source. Use this skill when: - Agent generates new code files - Agent modifies existing code - User asks to "scan for security issues" or "check my changes" - Before committing changes - User mentions "secure at inception", "proactive scan", or "security check"
npx skill4agent add snyk/studio-recipes secure-at-inception| Scan Type | Trigger Files | MCP Tool |
|---|---|---|
| SAST (Code) | Source files: | |
| SCA (Dependencies) | Manifests: | |
| IaC | Infrastructure: | |
.md.txt.rstgit diff --name-only HEAD
git diff --name-only --cached # staged files
git status --porcelainapiVersionkindAWSTemplateFormatVersionsnyk_code_scanpathseverity_threshold"medium"snyk_sca_scanpathall_projectstrueseverity_threshold"medium"snyk_iac_scanpathseverity_threshold"medium"git diff -U0@@ -X,Y +A,B @@| Mode | Block On | Warn On | Allow |
|---|---|---|---|
| Strict | Low+ | - | - |
| Standard | High+ | Medium | Low |
| Relaxed | Critical only | High | Medium, Low |
## Secure At Inception Scan Results
### Summary
| Scan Type | New Issues | Blocked |
|----------------------|------------|---------|
| Code (SAST) | X | Yes/No |
| Dependencies (SCA) | Y | Yes/No |
| Infrastructure (IaC) | Z | Yes/No |
### New Code Vulnerabilities (SAST)
| Severity | Type | File | Line | Description |
|----------|---------------|------------|------|-----------------------|
| High | SQL Injection | src/db.ts | 45 | User input in query |
### New Dependency Vulnerabilities (SCA)
| Severity | Package | Vulnerability | Fix Version |
|----------|------------------|----------------------|-------------|
| Critical | lodash@4.17.15 | Prototype Pollution | 4.17.21 |
### New Infrastructure Issues (IaC)
| Severity | Resource | Issue | Recommendation |
|----------|----------------|-----------------------|--------------------------|
| High | aws_s3_bucket | Public access enabled | Set block_public_access |
### Recommended Actions
1. `/snyk-fix SNYK-JS-LODASH-1234` - Fix lodash vulnerability
2. Review `src/db.ts:45` for SQL injection fix
### Decision: [BLOCKED / ALLOWED]
[Reason based on severity threshold]If any NEW issue severity >= threshold:
BLOCKED - do not proceed until fixed
Provide specific fix commands
Else:
ALLOWED - safe to proceed
Note any warnings for future attentionsnyk_send_feedbackpathpreventedIssuesCountfixedExistingIssuesCount0file + content_hash.snykignore:
SNYK-JS-EXAMPLE-12345:
- '*':
reason: 'False positive - input is validated upstream'
expires: 2025-12-31| Situation | Action |
|---|---|
| Authentication error | Run |
| Scan timeout | Retry once with smaller scope; report partial results if still failing |
| No changes detected | Report "No code changes detected - nothing to scan"; offer full project scan on request |
| Unsupported files only | Report "No scannable files in changes" with a list of skipped file types and reasons |