Token导航 LogoToken导航TokenDH.com
研究检索external-servicegithub未标认证来源可访问许可证需确认审计通过

secure-at-inception一开始就安全

Agent Skill

secure-at-inception 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

570

周安装

24

GitHub Stars

29

下载量

1
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:secure-at-inception(一开始就安全)
来源仓库:https://github.com/snyk/studio-recipes
仓库路径:skills/secure-at-inception
安装命令:
npx skills add https://github.com/snyk/studio-recipes --skill secure-at-inception
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/snyk/studio-recipes --skill secure-at-inception

简介

用于在项目启动阶段嵌入安全设计原则与检查清单。

  • 适合在新系统开发或架构评审中前置安全考量,降低后期改造成本。
  • 通过 GitHub 仓库安装,使用 npx 命令生成定制化安全启动模板。
  • 模板内容需根据业务场景调整,不能替代专业的渗透测试与合规审计。
  • secure-at-inception 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

Secure At Inception

Proactively scan all newly generated or modified code to prevent security vulnerabilities before they enter the codebase. Provides intelligent scanning decisions, caching, and filtering to focus only on NEW issues.


File Type → Scan Type Reference

Scan TypeTrigger FilesMCP Tool
SAST (Code)Source files: .js, .ts, .py, .java, .go, .rb, .php, .cs, .swift, .kt, .scala, .rs, .c, .cpp, .dart, and moresnyk_code_scan
SCA (Dependencies)Manifests: package.json, requirements.txt, pom.xml, build.gradle, Gemfile, go.mod, Cargo.toml, *.csproj, composer.json, and moresnyk_sca_scan
IaCInfrastructure: .tf, .tfvars, K8s YAML (with apiVersion/kind), template.json/.yaml, ARM JSON, serverless.ymlsnyk_iac_scan

Skip: binary files, non-IaC JSON/YAML, documentation (.md, .txt, .rst), assets, test fixtures.


Phase 1: Change Detection

Step 1.1: Gather Changed Files

Check for changes using one of these methods (in order of preference):

  1. Git diff (if in a git repo): git diff --name-only HEAD git diff --name-only --cached # staged files git status --porcelain
  2. Session context: Track files created/modified during the current session
  3. User-specified path: If user provides a specific file or directory

Step 1.2: Categorize Files by Scan Type

Use the File Type → Scan Type Reference table above to map each changed file to the appropriate scan. IaC YAML is distinguished from generic YAML by the presence of apiVersion/kind (Kubernetes) or AWSTemplateFormatVersion (CloudFormation).


Phase 2: Execute Scans

Run SAST, SCA, and IaC scans in parallel — they are independent of each other. Use the parameters below for each applicable scan type (determined by the File Type → Scan Type Reference table).

Step 2.1: SAST Scan (snyk_code_scan)

  • path: directory containing changed source files (or project root); scan each file individually if < 5 files changed, otherwise scan the parent directory
  • severity_threshold: "medium" (default) or as configured

Step 2.2: SCA Scan (snyk_sca_scan)

  • path: project root or directory containing the manifest
  • all_projects: true (for monorepos)
  • severity_threshold: "medium" (default) or as configured
  • Note: SCA scans the entire dependency tree, not just direct changes.

Step 2.3: IaC Scan (snyk_iac_scan)

  • path: directory containing IaC files
  • severity_threshold: "medium" (default) or as configured

Phase 3: Filter to New Issues

Apply these filters before reporting to surface only issues introduced by the current changes.

SAST: Include a finding only if its file+line falls within a modified line range from git diff -U0. Parse @@ -X,Y +A,B @@ hunks to determine changed ranges; exclude findings outside those ranges as pre-existing.

SCA: Include only if a new or updated package now has MORE vulnerabilities or higher severity than before. Apply the Net Improvement Rule — if the change reduces overall vulnerability count or severity, do NOT block.

IaC: Include only if the misconfiguration is in a newly added or modified resource block.


Phase 4: Report & Decision

Step 4.1: Severity Threshold Configuration

ModeBlock OnWarn OnAllow
StrictLow+--
StandardHigh+MediumLow
RelaxedCritical onlyHighMedium, Low

Step 4.2: Generate Report

## 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]

Step 4.3: Block Decision Logic

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 attention

Phase 5: Track Metrics

After each scan that finds and helps fix issues, run snyk_send_feedback with:

  • path: project root (absolute path)
  • preventedIssuesCount: count of NEW issues found (delta, not cumulative)
  • fixedExistingIssuesCount: 0 (this skill prevents, doesn't fix existing issues)

Only count issues found in NEW code that would have been committed without this scan.


Best Practices

  • Run automatically after generating or modifying code, and before suggesting a commit; also on request for explicit security checks.
  • Cache results keyed by file + content_hash with a 12-hour TTL; only rescan changed files and batch by directory.
  • False positives: Use a .snyk policy file to suppress confirmed false positives, then re-run to verify: ignore: SNYK-JS-EXAMPLE-12345: - '*': reason: 'False positive - input is validated upstream' expires: 2025-12-31
  • Threshold tuning: Start with Standard mode; switch to Relaxed if blocks are too frequent, or Strict after low/medium severity incidents.
  • CI/CD integration: Invoke on pull request creation or pushes to feature branches; block merge if threshold is exceeded.

Error Handling

SituationAction
Authentication errorRun snyk_auth and retry; prompt user for manual authentication if still failing
Scan timeoutRetry once with smaller scope; report partial results if still failing
No changes detectedReport "No code changes detected - nothing to scan"; offer full project scan on request
Unsupported files onlyReport "No scannable files in changes" with a list of skipped file types and reasons

Constraints

  1. New Issues Only: Never block on pre-existing issues (that's remediation's job)
  2. Minimal Noise: Filter aggressively to avoid alert fatigue
  3. Fast Feedback: Complete scan within 30 seconds for typical changes
  4. Non-Destructive: Never modify code, only report findings
  5. Actionable Output: Every finding must have a clear fix path

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

37.36%
按下载量换算0

Claude

26.48%
按下载量换算0

Cursor

17.79%
按下载量换算0

Gemini CLI

8.49%
按下载量换算0

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

external-service

该 Skill 可能调用第三方服务、云服务或外部模型 API,使用前需要确认账号、额度、数据发送范围和服务条款。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills