Home › Articles

Security rules for AI coding agents: a practical checklist

Updated 2026-10-16

In short: AI agents happily hardcode keys, trust request bodies and log tokens. A short, always-on security rule fixes most of it, as long as each line is concrete and checkable.

What to put in an always-on security rule

Why concrete beats vague

"Be secure" does nothing. "Verify the X-Signature HMAC over the raw body with timingSafeEqual" gets followed and can be reviewed. Pair the rule with a /security-audit skill that walks the diff against the checklist.

The free sampler includes our security rule in every tool format. The SaaS Starter shows it applied: signed sessions, scrypt hashing and a verified Lemon Squeezy webhook.

FAQ

What should an always-on security rule for AI agents include?

Never write secrets in code, tests or logs; validate every external input at the boundary with a schema; check authorization on every server action and route; use standard library crypto; verify webhook signatures over the raw body; and justify every new dependency.

Why doesn't "be secure" work as a rule?

Vague rules do nothing. A concrete, checkable line such as "verify the X-Signature HMAC over the raw body with timingSafeEqual" gets followed and can be reviewed.

How should AI agents handle secrets?

Read them from environment variables, validate the environment at startup, and never write them into code, tests or logs.

How do I check a diff against the security rules?

Pair the always-on rule with a /security-audit skill that walks the diff against the checklist.

Kit updates, every 2 weeks

One short email every two weeks covering tool format changes (Cursor, Claude Code, Codex, Windsurf, Copilot), new rules and kit updates. No spam.

We store only your email, with our email provider Resend. See the privacy policy.