Repository navigation
Writing recipes
A recipe teaches creep about one kind of sink: a hint for the model and two fixtures, one vulnerable and one safe, that prove the hint works with your model. Recipes are JSON data, never code. The rules behind them: ADR 0025 (format and trust) and ADR 0028 (installing pinned recipes). If this page and the ADRs disagree, the ADRs win; the command reference is in Commands and flags.
Versions. creep recipe new|lint|test are in v0.2.0. creep recipe add, creep.lock and scans that use installed recipes are on main since #34 and ship with v0.3; install a release as in Install and verify.
- A model configured in your config (
~/.creep/config.yaml), as in the Quickstart.creep recipe testsends the recipe's hint and its two fixtures, redacted, to that model, and calibrates it first if no calibration is cached. - The first send to an endpoint asks for consent on the terminal (
[y/N]). Runrecipe testfrom a terminal the first time: without one (a pipe, CI) the prompt declines on its own and the test exits 2 withno consent to send code to this endpoint; nothing was sent. In CI, consent comes only from the org policy'sconsentlist (consent: ["<endpoint>"]in the fileCREEP_POLICYnames). The endpoint is the URL for an HTTP model, orcommand://<program>-<hash>for a model CLI;recipe testprints it on its first line. - Git, if you want to publish the recipe for others (step 5).
Recipes never come from the repository you scan: creep reads only the file you name, and scans read only what you installed under ~/.creep/recipes.
Work in a repository of your own that will hold your recipes, with them in a recipes/ directory at its root (step 5 needs that layout):
mkdir -p my-recipes/recipes && cd my-recipes
git init
creep recipe new recipes/python-subprocess-shell.jsonrecipe new writes a working template (a Python SQL injection recipe). The path must be relative, inside the current directory, end in .json, and its directory must already exist; it never overwrites a file. Recipe file names that you want to install later may use only a-z, 0-9, - and _.
Replace the template with your own class of sink. A complete example, Python command injection through subprocess with shell=True:
{
"version": 1,
"id": "python-subprocess-shell-true",
"class": "command_injection",
"applies_to": [".py"],
"sources": ["request.args", "request.form"],
"sinks": ["subprocess.run(", "subprocess.call("],
"hint": "A request value formatted into a command string reaches subprocess with shell=True.\nOnly a list of arguments without shell=True stops this class.",
"fixtures": {
"vulnerable": {
"code": "import subprocess\nfrom flask import Flask, request\napp = Flask(__name__)\n\n@app.route(\"/ping\")\ndef ping():\n host = request.args[\"host\"]\n subprocess.run(f\"ping -c 1 {host}\", shell=True)\n return \"ok\"\n",
"source_line": 7,
"sink_line": 8
},
"safe": {
"code": "import subprocess\nfrom flask import Flask, request\napp = Flask(__name__)\n\n@app.route(\"/ping\")\ndef ping():\n host = request.args[\"host\"]\n subprocess.run([\"ping\", \"-c\", \"1\", \"--\", host])\n return \"ok\"\n",
"source_line": 7,
"sink_line": 8
}
}
}| Field | Rules |
|---|---|
version |
1 |
id |
your recipe's name: 2 to 63 bytes of a-z, 0-9 and -, starting with a letter or digit |
class |
one of sql_injection, command_injection, path_traversal, ssrf, template_injection, nosql_injection, and from v0.6 code_injection (code evaluated from a string: eval(, new Function(, CWE-94) and insecure_deserialization (objects decoded from bytes: pickle.loads(, unserialize(, CWE-502). From v0.6 a finding at an eval or deserialization sink carries one of those two classes, not command_injection (ADR 0034), so a command_injection recipe for such a sink never gets its hint used: recipe lint warns and names the class to set. Neither class takes a poc
|
applies_to |
file extensions the hint is used for, such as [".py"]
|
sources, sinks
|
lexical signatures: 2 to 64 bytes of printable ASCII, at most 16 each. The fixture's source_line must contain one of sources and its sink_line one of sinks
|
hint |
at most 400 bytes and 8 lines of printable ASCII. It is shown to the model as data, never as an instruction: describe the dangerous flow and what makes it safe; do not tell the model what to answer |
poc |
optional; a closed PoC template from ADR 0019, only for a class that has one (sql_injection takes sql_payload, as in the template). Leave it out otherwise |
fixtures.vulnerable, fixtures.safe
|
code up to 8 KiB and 200 lines, source_line, sink_line (1-based). The two fixtures must differ |
The whole file is at most 64 KiB; unknown, repeated or differently cased keys are refused. No endpoint, command, path, URL, gate or redaction rule can go in a recipe. Your editor can check the file against docs/schemas/recipe-v1.json.
Keep fixtures short. recipe test runs at your model's calibrated tier, and a fixture that does not fit a tier S slice whole fails there. Make the safe fixture the same program with only the fix applied, so the hint has to tell them apart.
creep recipe lint recipes/python-subprocess-shell.json # format only, no model call
creep recipe test recipes/python-subprocess-shell.json # both fixtures through your modelExpected output. This run used a model CLI set by hand in the config, not a preset: model: {contract: command, run: 'claude -p --model haiku --tools "" --strict-mcp-config --output-format text'}. The second line names your model and its endpoint; with a preset it also says (preset <name>), as in the model command claude (preset claude-code) at command://claude-.... The last line names your model's calibrated tier:
recipe python-subprocess-shell-true: valid (command_injection); its fixtures are not checked yet: run creep recipe test recipes/python-subprocess-shell.json
recipe test: sends the recipe's hint and its two fixtures, redacted, to the model command claude at command://claude-10154e3465d165d6
recipe python-subprocess-shell-true: loaded at tier M: the vulnerable fixture was flagged and the safe fixture was clean
The first recipe test with a model calibrates it first, which takes minutes (about 13 with a model CLI); later runs reuse the cached calibration for 30 days and take a few calls. Run state and the calibration cache go to .creep/ in the current directory, which creep keeps out of git with its own .gitignore.
| Exit |
recipe test means |
What to do |
|---|---|---|
| 0 | the vulnerable fixture was flagged and the safe one was clean | done |
| 2 | refused: a format error (the field is named), or recipe fixtures failed: the vulnerable fixture was not flagged / the safe fixture was not clean
|
fix the field; for fixtures, make the hint clearer, the fixtures shorter, or the safe fixture obviously safe |
| 3 | the model failed (endpoint, tool canary, calibration) | fix the model setup (Quickstart, creep doctor); this is never a verdict on the recipe |
Without calling the model again. --record stores the model's answers in creep's run state; --replay serves only stored answers and never sends anything, so a reviewer with the same model config and state can re-run the check offline:
creep recipe test --record recipes/python-subprocess-shell.json
creep recipe test --replay recipes/python-subprocess-shell.json # no model callA replay with no recorded answer exits 3 (a model error: nothing is sent), and a replay still needs the same model config (for a model CLI, the program must still be on PATH, though it is not run). Any change to the recipe changes the request, so record again after editing.
A recipe that passes with one model can fail with another. Say in your PR or README which models and tiers you tested.
Push the repository to GitHub with the recipes directly in recipes/ (1 to 32 files). Anyone who installs it, you included, does it from a clone checked out at a full commit SHA; creep itself never fetches anything:
git clone https://github.com/<owner>/<repo>.git recipe-src
git -C recipe-src checkout --detach <40-hex commit sha>
creep recipe add github.com/<owner>/<repo>@<40-hex commit sha> recipe-srcadd refuses a branch, tag, short or upper-case SHA (exit 2), a clone whose HEAD is not that commit detached, or whose origin is not that repository (https://github.com/..., git@github.com:... or ssh://git@github.com/...). The clone must be a plain clone with a .git directory: a git worktree or submodule (a .git file) is refused. creep runs no git command; it reads .git/HEAD and .git/config itself. It checks every recipe file with lint's rules, copies them to ~/.creep/recipes/<owner>/<repo>/<commit>/ and pins each file's SHA-256 in ~/.creep/recipes/creep.lock. Installing the same source again replaces its pin. On success it prints:
recipe: installed 1 recipe files from github.com/<owner>/<repo>@<commit> into ~/.creep/recipes and pinned them in creep.lock; each scan checks their checksums, then their fixtures with the model, before using them
From then on, every creep scan checks each installed file against creep.lock and runs its fixtures through your model before discovery:
recipes: checking the fixtures of 1 installed recipe files from ~/.creep/recipes/creep.lock, redacted, with the model before the scan uses their hints
A changed or missing file (installed recipe does not match creep.lock), a file that no longer passes lint's rules or a source the policy no longer allows fails the scan with exit 2 before any model call. A recipe whose fixtures fail with your model also fails the scan with exit 2; a model failure exits 3. To stop using a source, remove its entries from creep.lock.
Org allowlist. The org policy (CREEP_POLICY, an absolute path) may limit which sources can be installed and loaded:
recipe_sources: ["github.com/<org>/*", "github.com/<owner>/<repo>"]An empty list allows none. Only the policy can set it; a user config or creep.yaml naming it fails to load.
Propose a recipe with the Recipe proposal issue form: the class or CWE, the language and frameworks, the recipe JSON, and the recipe test output with the model and tier it ran on. Drop the endpoint from its first line before you post it: it can name an internal host. To share how a model does on recipes or calibration, see Sharing model results.
Home · Current release: latest
Guides: Quickstart · Sandbox · Verification statuses · CI with the Action · Nightly scan · Local models · FAQ
Reference: Commands and flags · Output and exit codes · Configuration · Models and presets · Calibration · Languages · Guarantees and limits · Roadmap
Contributing: Writing recipes · Using creep from an agent (MCP) · Sharing model results
- Architecture
- v0.1 Progress
- v0.2 Progress
- v0.3 Progress
- v0.4 Progress
- v0.5 Progress
- v0.6 Progress
- v0.7 Progress
- Decisions
- Development Workflow
- Release
- Install and verify
- Nightly scan
Repository · Roadmap · Install: brew tap Ludocius/creep https://github.com/Ludocius/creep, scoop bucket add creep https://github.com/Ludocius/creep (details)