📝 docs(codex_skills): normalize markdown formatting

This commit is contained in:
csh
2025-12-22 15:36:58 +08:00
parent cc8ad4c59c
commit a52bb246ab
13 changed files with 109 additions and 2 deletions
+8
View File
@@ -6,23 +6,28 @@ description: "Defense in depth: add layered validation/guardrails across a data
# Defense in Depth(分层校验 / 多道防线)
## When to Use
- Auth/data path changes (permissions, roles, ownership checks)
- Risky inputs (user input, external APIs, files, SQL, commands)
- Operations that must be safe under retries/concurrency
- Incidents where we fixed symptoms but not the root class of bugs
## Inputsrequired
- Data path: entrypoints → core logic → side effects (DB/files/network)
- Threat model: what could go wrong? who can trigger it?
- Constraints: latency budgets, backward compatibility, rollout plan
- Verification: how to prove guardrails work (tests, logs, metrics)
## Proceduredefault
1. **Map the Path**
- Identify trust boundaries and validation points
- List invariants that must always hold
2. **Layer Guardrails**
- AuthN/AuthZ checks at boundaries (least privilege)
- Input validation + normalization (reject early)
- Business invariants (defensive checks with clear errors)
@@ -31,6 +36,7 @@ description: "Defense in depth: add layered validation/guardrails across a data
- Observability (structured logs, metrics, alerts)
3. **Failure Modes**
- Define what happens on invalid input, partial failures, timeouts
- Ensure errors are actionable and do not leak sensitive info
@@ -39,12 +45,14 @@ description: "Defense in depth: add layered validation/guardrails across a data
- Propose minimal manual verification steps if tests are missing
## Output Contractstable
- Path map: trust boundaries + invariants
- Guardrails: what to add at each layer (with rationale)
- Risks: what remains and why
- Verification: exact tests/commands and expected signals
## Guardrails
- Avoid “one big check”; prefer multiple small, well-scoped checks
- Prefer explicit errors over silent fallback
- Security checks must not be bypassable via alternate code paths