AI agent skill

Harden

Run the toolkit's security commands in order to surface secrets, MCP supply-chain issues, install drift, release provenance gaps, and untrusted-code risks before shipping. Use before opening a PR, after adding a dependency, or whenever the security posture needs a fresh check.

·

When to use this skill

Use Harden when an AI agent needs a reusable SKILL.md workflow for this job: Run the toolkit's security commands in order to surface secrets, MCP supply-chain issues, install drift, release provenance gaps, and untrusted-code risks before shipping. Use before opening a PR, after adding a dependency, or whenever the security posture needs a fresh check.

When not to use it

Skip Harden when the task is outside the coding category, or when a more specific skill in this directory already covers the same workflow with clearer triggers.

How to install

  1. Personal install: create ~/.claude/skills/harden/SKILL.md (and any bundled scripts) so Claude Code, Claude Desktop, and compatible agents can load it in every project.
  2. Project install: commit the same folder at .claude/skills/harden/ so teammates get the skill with the repo.
  3. Restart the agent session after copying files so it re-scans the skills directory, then ask for the task in words that match the skill description.

Full install guide for Claude, Cursor, and Codex

What this skill does

# Harden — security sweep in five ordered steps

Run each command in sequence. Stop on a non-zero exit and fix the finding before proceeding. All five must pass before the branch is considered hardened.

## Steps

### 1 · Secrets — `compass scan --staged` Scan the staged diff for secrets at the commit boundary.

``` compass scan --staged ```

Exits 0 (clean) or 1 (secrets found). Fix: remove the secret, rotate the credential, then re-stage. Add an `# allowlist secret` comment ONLY for confirmed test fixtures — never real credentials.

### 2 · MCP supply-chain pins — `scripts/check-mcp.sh` Verify every auto-installed MCP server is pinned to an exact version and that no `@latest` float or shell-injection marker has crept in.

``` bash scripts/check-mcp.sh ```

Exits 0 (pinned + clean) or non-zero (floating version or injection marker). Fix: pin the version in `mcp/servers.json` and re-run. (`setup-mcp.sh` runs this same audit as a pre-flight, and `compass doctor` includes it.)

### 3 · Install fidelity — `compass drift` Check that the installed `~/.claude` config still matches this repo's source. Catches hand-edited copies, stale hooks, and non-executable guardrail scripts.

``` compass drift ```

Exits 0 (in sync) or non-zero (drift detected). Fix: re-run `quickstart.sh` or remove the hand-edited file and let the install re-link it.

### 4 · Release provenance — `compass verify` Verify the latest release tarball's keyless SLSA attestation. Requires `gh`.

``` compass verify ```

Exits 0 (attestation valid), 77 (gh lacks attestation support — skip), or non-zero (attestation missing or invalid). A 77 is a safe skip on old gh versions; anything else is a provenance gap to investigate.

### 5 · Untrusted code — `compass sandbox -- <cmd>` Run any untrusted command inside a real OS sandbox (no network, writes confined to cwd/tmp via bwrap/firejail/sandbox-exec). Required before executing code fetched from external sources.

``` compass sandbox -- <cmd> ```

Exits 0 (ran confined), 2 (usage error — supply a command), or non-zero if the sandboxed command itself fails. If no backend is available the CLI refuses to run the command unconfined — install bwrap or firejail first.

## Notes - Run the five steps in order; each one gates the next in severity. - `compass scan --staged` should also be wired as a pre-commit hook (`compass scan --staged` in `.git/hooks/pre-commit`) for continuous coverage. - Security (`compass scan`, `compass verify`) and drift detection (`compass drift`) are also surfaced in `compass dashboard` for a fleet-wide view. - This skill does not replace a full `/security-review` — it gates the mechanical checks. Run `/security-review` on the diff for human-judgment findings.

Intended uses

  • Use Harden when this documented workflow matches the task.

Related skills

Related skills in this directory, for comparison before you install another skill.

coding

Add Backend

Guide for adding a backend (Rust or Python) to the agent-sec-core security middleware. Use when creating new backends, integrating Rust or Python code into the security middleware, or extending with new backend actions.

View skill

coding

Agent Device

Drive iOS and Android devices for the Expensify App - testing, debugging, performance profiling, bug reproduction, and feature verification. Use when the developer needs to interact with the mobile app on a device.

View skill

Ranked Claude skills