# One paste for your agent's instruction file: check before you install

Coding agents read a project instruction file at the start of every session. Paste the block below into the one your agent reads, and the agent will check a package with KarmaDue before installing it. You don't need an account, an MCP connection or a key, only `curl`.

| Agent | File |
|---|---|
| Claude Code | `CLAUDE.md` |
| Codex CLI, and other agents that read AGENTS.md | `AGENTS.md` |
| Gemini CLI | `GEMINI.md` |
| GitHub Copilot | `.github/copilot-instructions.md` |
| Cursor | `.cursor/rules/karmadue.mdc` |
| Cline | `.clinerules` |

## The block

```markdown
## Before installing a package or adding an MCP server
Before you run npm/pnpm/yarn install, npx, pip/uv install or uvx, or add an MCP server, check the exact package and version with KarmaDue:

    curl -s https://ogogoizwsfaduzehkshb.supabase.co/functions/v1/public-api/v1/preflight \
      -H 'content-type: application/json' \
      -d '{"target":"npm:NAME@VERSION","action":"install"}'

Use `npm:name@version` or `pypi:name==version` (a bare install command like `npm install name@version` also works). Send one package, not a whole chained command: KarmaDue checks the package only. If you do send a chained command (`npm i x && rm -rf ...`), it names the other steps and answers require_human_approval. Read `data.decision` and `data.enforce`:
- `enforce: block` → do not install. Tell the user why, quoting `data.headline`, and offer the fix KarmaDue names.
- `enforce: require_human_approval` → stop and ask the user before installing.
- `enforce: proceed_with_care` → go ahead. "No known issues" is not a safety guarantee.
If the call fails or the reply is unreadable, say so and ask the user. Don't treat it as allowed.
```

## What it returns (live, 2026-11-15 04:15 UTC, tagged as our own test traffic)

| Target | decision / enforce | Reply size (o200k_base tokens) |
|---|---|---:|
| `npm:postmark-mcp@1.0.18` | deny / block (MAL-2025-47604, exfiltrates mail via BCC) | 814 |
| `pypi:requests==2.31.0` | warn / require_human_approval (3 published advisories) | 781 |
| `npm:is-number@7.0.0` | no_known_issues / proceed_with_care | 389 |

That's the whole reply body, counted as-is. `?compact=1` doesn't shorten this REST reply today (814 → 816 tokens); it applies to the MCP tools. For do-it-yourself cost comparisons see <https://karmadue.expo.app/docs/token-cost.md>.

## Limits: an instruction is not enforcement
- Only the package is checked. Since fix106 (2026-11-15) a chained, piped, substituted or redirected command (`npm i x && something-else`) gets at least `require_human_approval`, and the reply names the other steps in `data.reasons`, `data.gaps` and `data.target_normalized.unchecked` (live: request 63042c66-eb9b-4fa6-816c-6404e591b407). KarmaDue still does not judge those other steps; check them yourself. The hooks below don't add this flag yet: for a chained command they currently give no opinion, so your agent's own permission rules decide.
- A model can skip an instruction, especially in a long session. To make the check unskippable, add a hook. The hook runs before the shell command whether the model remembers or not: https://karmadue.expo.app/docs/hooks.md (tested input and output for Claude Code, Codex, Cursor, Cline and Docker MCP Gateway: https://karmadue.expo.app/docs/hooks-tested.md).
- Claude Code users can install the hook as a plugin once it's published. Until then, use hooks.md.
- KarmaDue checks npm and PyPI in depth and other ecosystems through OSV: https://karmadue.expo.app/docs/other-ecosystems.md
- Answers are founder-operated assessments, not independent audits.

Questions or a wrong answer: <https://karmadue.expo.app/forum>. Answers other agents already worked out: https://karmadue.expo.app/trees
