catpilotai/catpilot-ai-guardrails/catpilot-security-core
Claude Code and agent skill by catpilotai/catpilot-ai-guardrails
- community
Checking that the SKILL.md file is still in the repository.
Catpilot''s universal AI-coding-agent security baseline: advisory guardrails across nine components: cloud CLI mutations, database state changes, local CLI destruction, Docker container builds, hardcoded secrets, secrets management, supply-chain integrity, PII / test-data hygiene, and language-agnostic secure-coding patterns (SQL injection, command injection, XSS, path traversal, insecure deserialization, eval-class APIs, SSRF). Intended to apply on every code generation, file write, and shell command in a host that has loaded it. Born from real production incidents. Guidance the agent reads, not a runtime control.
Install
npx vskill@latest install catpilotai/catpilot-ai-guardrails/catpilot-security-coreSKILL.md
The same SKILL.md was published earlier as catpilotai/catpilot-ai-guardrails/catpilot-security-core.
Catpilot Security Core
Catpilot's universal security baseline for AI coding agents, intended to apply on every file write, diff review, and shell command the agent is about to run, regardless of language or framework, whenever the host has loaded this skill. It is advice the agent reads: installing this bundle is not activation, and an instruction the agent has read is not an enforced control. The repository's protection contract explains the difference between advice, coaching, and enforcement.
This file is deliberately short. Each component below names its reference file, states when it applies, and lists the rules that always hold. Do not answer from this file alone: before acting in a component's area (a cloud command that changes infrastructure, a database migration or data change, a Dockerfile, a dependency change, anything that handles a secret or real personal data, or code in the language-baseline patterns), read the named reference file with your file-reading tool and follow it. The examples, the remediation steps, and the detection patterns live there, and so do the facts that decide whether a command is safe. Component IDs match the catpilot-components entry in the frontmatter and the bundle.components list in catpilot.json next to this file, so a finding can be mapped back to a specific source skill (and to its severity, version, and control mappings).
This bundle is generated deterministically from src/skills/core/<id>/SKILL.md by tools/bundle.py in the catpilotai/catpilot-ai-guardrails repository. Edits to this file or to the reference files are overwritten on the next bundle. To change behavior, edit the corresponding source skill and rebuild.
cloud-cli-safety
Before acting in this area, read references/cloud-cli-safety.md in this skill's directory; the rules below are the minimum, not the whole component.
Applies when: Before invoking a mutating az, aws, gcloud/gsutil, kubectl, helm, or terraform command, or a custom deploy wrapper (./deploy.sh, make deploy), especially against production-heuristic targets.
Always:
- Query current state (read-only) and show the relevant fields before any mutating command.
- Show the full command and affected targets; preserve env/secret references and never expand credentials into chat, logs, or history.
- Enumerate fields that will change (env vars, IAM bindings, replica counts, CPU/memory, probes).
- Get explicit confirmation (a literal "yes") before executing; do not infer consent.
- Prepare a rollback command before executing the forward command.
- Know which flags merge and which replace:
az containerapp update --set-env-varsadds or updates only the named variables and keeps the rest;--replace-env-varsand--yamlreplace the whole set;aws lambda update-function-configuration --environmentreplaces the whole map. - Verify after execution by re-running the read-only query and diffing against the pre-change snapshot.
Never:
az containerapp update --yaml <partial>— overwrites all unspecified fields;--replace-env-varsremoves unspecified variables too.aws lambda update-function-configuration --environment "Variables={ONLY_ONE=value}"— replaces, does not merge.aws s3 rm s3://bucket --recursivewithout prioraws s3 lsand explicit confirmation.gcloud projects set-iam-policy PROJECT policy.json— wipes existing bindings; useadd-iam-policy-bindinginstead.terraform apply -auto-approve/terraform destroy -auto-approveanywhere production is plausible.kubectl delete namespace productionorkubectl delete pods --all -n <ns>against a non-dev namespace.
Open the full component before acting: it has the examples, the remediation steps, and the detection patterns.
database-safety
Before acting in this area, read references/database-safety.md in this skill's directory; the rules below are the minimum, not the whole component.
Applies when: Any SQL execution, ORM write, schema operation, migration command, or query-string construction against a real database, especially prod/production/live/customer environments.
Always:
- Require a
WHEREclause on everyDELETE,UPDATE, orMERGE(and ORM equivalents) unless the user has explicitly confirmed "all rows." - Run the matching
SELECT COUNT(*)with the same predicate and show the count before any mutating statement; the count is what the user approves. - Wrap every mutating statement in an explicit transaction (
BEGIN/COMMIT) opened by the agent; never autocommit against a production-class database. - Clear all three migration gates in order: dry-run on a staging clone, backup taken in the same maintenance window, and a tested reversible migration (or approved restore procedure).
- Parameterize every query through driver-level binding; never build SQL by concatenation, f-strings, or ORM raw-query helpers that bypass binding.
- Identify rows by primary key and redact sensitive columns when debugging; never log full rows or copy production data downstream.
Never:
DELETE/UPDATE/MERGEwithout aWHEREclause, or ORM equivalents likeModel.objects.all().delete()orprisma.model.deleteMany({})with an emptywhere.- A mutating statement run in autocommit mode against a production-class database.
- A migration run straight against production with no dry-run, no backup, no rollback.
- SQL built by string concatenation, f-strings, template literals, or raw-query ORM helpers.
- Copying production rows into development, staging, or any lower-controlled environment, "just for testing."
Open the full component before acting: it has the examples, the remediation steps, and the detection patterns.
docker-safety
Before acting in this area, read references/docker-safety.md in this skill's directory; the rules below are the minimum, not the whole component.
Applies when: Writing or running a Dockerfile/Containerfile, docker-compose.yml, docker build/run/exec (or podman/nerdctl/buildah equivalents), or a Kubernetes manifest setting securityContext, hostNetwork, hostPID, hostIPC, privileged, or hostPath volumes.
Always:
- Pin base images to an immutable digest (
FROM <image>@sha256:...); floating tags (latest, major/minor only) are for non-deployed internal tooling only. - Declare and switch to a non-root
USERbeforeCMD/ENTRYPOINT;COPY --chown=app:appfiles the runtime needs to read. - Pass build-time secrets with BuildKit
--mount=type=secret; pass runtime secrets via--env-fileor a secret store, never baked into the image. - Run production containers with
read_only/--read-only,no-new-privileges, andcap_drop: [ALL]with only required capabilities re-added. - Pin package versions, use the minimal-install flag, and clean the package cache in the same layer; verify checksums for downloaded binaries.
Never:
--privileged/privileged: true— disables seccomp, AppArmor, and capability dropping.--net=host/network_mode: hostor--pid=host/pid: host— shares the host's network or process namespace.-v /:/hostor mounting/var/run/docker.sockinto the container — full host filesystem or Docker daemon control.ENV/ARGfor secrets, orCOPY .env .— persists secrets in image history.chmod -R 777inside a container image.
Open the full component before acting: it has the examples, the remediation steps, and the detection patterns.
language-baseline
Before acting in this area, read references/language-baseline.md in this skill's directory; the rules below are the minimum, not the whole component.
Applies when: Writing or committing code that builds SQL from non-literal values, runs a subprocess/shell with non-literal arguments, writes input into the DOM/HTML, resolves a filesystem path from input, deserializes untrusted data, executes a string as code, bypasses type-system checks, or issues an outbound HTTP request to an input-derived URL.
Always:
- Route SQL values through driver parameter binding; never string concatenation, f-strings, template literals, or ORM raw-query helpers.
- Run subprocesses with an argv array and no shell (
shell=False); the command name is a literal or from an allowlist, never derived from input. - Write user-controlled values to the DOM/HTML only through escaping sinks (
textContent, notinnerHTML/document.write); sanitize with a vetted library when raw HTML is required. - Normalize input-derived filesystem paths: strip to basename, join against a known-safe directory, resolve symlinks, and reject anything outside that directory.
- Deserialize untrusted data only with type-constrained formats (
json.loads,yaml.safe_load); neverpickle.loads, unsafeyaml.load,Marshal.load,ObjectInputStream, orunserialize. - Never execute a string as code (
eval,new Function,setTimeout(stringArg)) or bypass type-system checks (as any,@ts-ignore) on external input. - Before an outbound HTTP request to an input-derived URL, check the host against an allowlist and reject internal/link-local IP ranges.
Never:
- SQL built by string concatenation, f-strings, or template literals with non-literal values.
subprocess/exec/systeminvoked with a single shell-interpreted string containing non-literal elements.innerHTML,document.write,dangerouslySetInnerHTML, or{{ x | safe }}fed with unsanitized user input.pickle.loads,yaml.load/yaml.unsafe_load,Marshal.load, orunserializeon external data.eval,new Function, or TypeScriptas any/@ts-ignoreused to bypass validation of external input.
Open the full component before acting: it has the examples, the remediation steps, and the detection patterns.
local-cli-safety
Before acting in this area, read references/local-cli-safety.md in this skill's directory; the rules below are the minimum, not the whole component.
Applies when: Running rm/find ... -delete/shred/dd on paths outside the project or from a variable, chmod/chown with -R near credential directories, history-rewriting git commands, commands that start a network service, or anything piping credentials or env into a network request.
Always:
- Verify a destructive-command path is non-empty and not
/or$HOMEbefore running; never interpolate a bare, unguarded variable. - Keep
chmod/chownscoped, never recursive (-R) on$HOMEor a credential directory (~/.ssh,~/.aws, etc.); tighten permissions, never loosen them. - Treat
main,master,release/*,production,staging,develop,prod*as protected: no history-rewritinggitcommand against them; use--force-with-leaseelsewhere. - Bind development network services to
127.0.0.1, never0.0.0.0, unless the user explicitly names external exposure. - Keep credential paths and
env/printenvoutput out of any network call, even to what looks like an internal URL. - Scope
sudoto the specific named command; run the minimum privileged step and return to the unprivileged shell.
Never:
rm -rf/find ... -deleteagainst an unset or unguarded variable, or any path outside the project directory.- Recursive
chmod/chownon$HOMEor a credential directory, or world-readable/writable modes on credential files. git push --force/push -f,reset --hard,clean -fd,filter-branch, orfilter-repoagainstmain,master,release/*,production,staging, ordevelop.- Binding a dev service to
0.0.0.0. - Piping
~/.ssh,~/.aws, or anenvdump into a network request, or untrusted content intosudo bash/sudo sh.
Open the full component before acting: it has the examples, the remediation steps, and the detection patterns.
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/catpilot-security-core/SKILL.md
Popularity
- Repository stars
- 2
- Repository forks
- 3
- 7-day trend score
- 5
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/catpilotai/catpilot-ai-guardrails/catpilot-security-core)