error-handling-security

仓库创建 2026年7月1日最近提交 23 天前SkillHot 收录 22 天前
▸ 精选理由

避免泄露堆栈/路径等敏感信息,提升安全与可观测性。

这个 Skill 做什么

服务端记录完整错误日志,外部返回通用且脱敏的错误信息。

让服务端把错误完整记录到日志,但对外只返回脱敏的通用错误信息,不能把 stack trace、SQL 片段或路径等内部细节泄露给客户端。在 HTTP handler、RPC 方法或消息边界捕获异常时采用。外部响应保留稳定错误码、简短可读信息和请求 ID,服务器端则做结构化日志以便排查。

▸ 展开 SKILL.md 英文原文

No stack traces / SQL / paths / framework versions in client responses; generic errors out, structured errors in logs

开发编程错误处理日志脱敏安全响应通用
2
Stars
0
Forks
40
仓库内 Skill
+0
7 日增星
安装 / 使用
给你的 Agent 一句话(通用)
帮我安装这个 skill:https://raw.githubusercontent.com/ShieldNet-360/secure-vibe/main/skills/error-handling-security/SKILL.md
或 curl 直取 SKILL.md
curl -fsSL "https://raw.githubusercontent.com/ShieldNet-360/secure-vibe/main/skills/error-handling-security/SKILL.md"
SKILL.MD 节选查看完整文件 ↗
# Error-Handling Security

## Rules (for AI agents)

### ALWAYS
- Catch exceptions at the boundary (HTTP handler, RPC method, message
  consumer). Log them with full context server-side; return a sanitized
  error externally.
- External error responses include: a stable error code, a short
  human-readable message, and a correlation / request ID. They never
  include: stack trace, SQL fragment, file path, internal hostname,
  framework version banner.
- Log errors at the appropriate level: `ERROR` / `WARN` for actionable
  failures; `INFO` for expected business outcomes; `DEBUG` for diagnostic
  detail (and only when explicitly enabled).
- Return uniform error responses across the API surfac
via SKILL·HOT · 数据来自 GitHub 公开信息 · 原文版权归作者所有