Instruction file imported from alisonjsilva/cl-agent-cli (
.cursor/rules/security.mdc). Copyright stays with the author.
Security Invariants
These rules are non-negotiable. Do not bypass, weaken, or remove them.
- Mutation confirmation — Every mutation tool must call
requireConfirm(). No exceptions, no shortcuts. - Secret redaction — API keys, Bearer tokens, JWTs, and client secrets must be stripped from any user-visible output, error messages, and logs. See
SECRET_PATTERNSinsrc/utils/logger.tsandindex.tsx. - Config permissions —
saveConfig()writes with0o600. Do not change. - Endpoint validation —
validateEndpoint()blocks non-*.commercelayer.iodomains unlessallowCustomEndpoint: true. Do not relax. - MCP env isolation — Stdio MCP subprocesses receive only
SAFE_ENV_KEYS(PATH, HOME, XDG dirs, proxy/TLS). Never pass fullprocess.env. - Rate limiting — API calls: 60/min. Auth requests: 5/min. Do not raise without justification.
- Token lifetime — 2-hour max cap in
cl-auth.ts. Do not increase. - System prompt injection defense — The system prompt in
src/ai/system-prompt.tsrejects prompt injection from API data. Do not weaken these defenses. - Security logging —
logSecurityEvent()always writes to disk regardless ofCL_AGENT_DEBUG. Do not gate behind debug flag.