# Guardrail Patterns

> Codex adapter for opencode-swarm destructive-command guardrail changes. Use before modifying src/hooks/guardrails.ts, checkDestructiveCommand, dcNormalizeCommand, shell-wrapper parsing, .swarm destructive-command blocking, or guardrails unit/adversarial tests.

- Skill: `zaxbysauce/guardrail-patterns` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add zaxbysauce/guardrail-patterns`
- Raw SKILL.md: https://api.skillmd.com/api/skills/zaxbysauce/guardrail-patterns/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: zaxbysauce (https://skillmd.com/u/zaxbysauce)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/zaxbysauce/guardrail-patterns

---


# Guardrail Patterns

Read, in order:

1. `AGENTS.md`
2. `.agents/skills/engineering-conventions/SKILL.md`
3. `.agents/skills/writing-tests/SKILL.md` if tests are touched
4. `.opencode/skills/generated/guardrail-patterns/SKILL.md`

Codex-specific execution notes:

- Use `rg` to locate the current guardrail section numbers before editing; line numbers in generated skills can drift.
- Preserve wrapper-unwrapping, normalization, and per-segment evaluation order unless the task is specifically to change it.
- Add or update adversarial tests for bypass surfaces, argument-order permutations, Windows shell forms, and `.swarm` path variants.
- Run focused guardrail tests after the change and report exact commands.

