gpt-image — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited gpt-image (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
Execution-only runbook for GPT Image generation and editing. Use the packaged CLI; do not reimplement image API code.
generate, edit, inpaint, multi-reference, or chroma-key background removal.openai>=1.55.OPENAI_API_KEY for the default OpenAI endpoint. Calls may incur API charges..env, or write API keys unless the user explicitly requests setup.python "$SKILL_DIR/scripts/src/gpt_image_cli/cli.py" -p "PROMPT" [-f OUT] [-i REF...] [-m MASK] [options]OPENAI_API_KEY from process env, then .env, then ~/.env, without overriding an existing environment value.OPENAI_BASE_URL in the environment to use a compatible endpoint. The OpenAI API is the default.OPENAI_API_KEY is unset, report it; do not write or print secrets.| Flag | Values | Use |
|---|---|---|
-p, --prompt | string | Required prompt or edit instruction |
-f, --file | path | Output path; auto-named if omitted |
-i, --image | repeatable path | Use edits endpoint; supports multiple references |
-m, --mask | PNG path | Inpaint with alpha mask; requires -i |
--model | default gpt-image-2 | Image model |
--size | 1k, 2k, 4k, portrait, landscape, square, wide, tall, or literal | Canvas size |
--quality | low, medium, high, auto | Cost and quality |
-n, --n | integer | Number of images |
--background | auto, opaque | Background behavior; use opaque for chroma-key removal |
--remove-background | flag | After the API response, run the bundled chroma-key remover on every output and replace each keyed PNG/WebP with its alpha result |
--moderation | auto, low | Generation moderation setting |
--input-fidelity | low, high | Edit fidelity; dropped for gpt-image-2, which rejects it |
--format | png, jpeg, webp | Output encoding |
--compression | 0-100 | JPEG or WebP compression |
--user | string | Optional end-user identifier |
Quality policy:
low: cheap drafts, broad exploration, many variants.medium: normal exploration, style probing, balanced cost.high: final assets, Chinese text, posters, diagrams, UI, paper figures, dense labels.Size policy:
1k / 1024x1024portraitlandscape2k4ktallTimeout policy:
1k, portrait, landscape, or square: 180000 ms (3 minutes)2k, 4k, or multi-image batches (-n > 1): 360000 ms (6 minutes)| Mode | Trigger | Endpoint |
|---|---|---|
| Text-to-image | no -i | /v1/images/generations |
| Reference edit | one or more -i | /v1/images/edits |
| Inpaint | -i + -m | /v1/images/edits with mask |
Surface enough of API errors for debugging. Exit codes are 0 for success, 1 for API error or refusal, and 2 for invalid arguments or a missing key.
Use chroma-key removal for transparent assets. The only supported path is --background opaque --remove-background.
Default sequence:
#00ff00, use #ff00ff for green subjects, and avoid #0000ff for blue subjects.Create the requested subject on a perfectly flat solid #00ff00 chroma-key background for background removal.
The background must be one uniform color with no shadows, gradients, texture, reflections, floor plane, or lighting variation.
Keep the subject fully separated from the background with crisp edges and generous padding.
Do not use #00ff00 anywhere in the subject.
No cast shadow, no contact shadow, no reflection, no watermark, and no text unless explicitly requested.--background opaque --remove-background. The CLI flag does not modify the prompt or decide whether chroma-key removal is appropriate; it only applies the bundled post-processor after generation. Continue to use the normal skill judgment above to decide when to pass it.python "$SKILL_DIR/scripts/remove_chroma_key.py" \
--input generated.png \
--out transparent.png \
--auto-key border \
--soft-matte \
--transparent-threshold 12 \
--opaque-threshold 220 \
--despillUse the helper command directly only when post-processing an image that already exists. For a new CLI generation, prefer --remove-background so generation and post-processing share one command. The flag supports batches and processes every returned image. It requires Pillow and a final .png or .webp output; it preserves the keyed source at the requested path if post-processing fails.
--edge-contract 1. Use --edge-feather 0.25 only when the edge is visibly stair-stepped and the subject is not shiny or reflective.Write the final output as .png or .webp to preserve alpha. Never overwrite an existing output unless explicitly requested; use --force only with authorization. If the matte removes subject details or the subject contains the key color, regenerate with a contrasting key color instead of increasing tolerance aggressively.
Chroma-key removal is unsuitable for hair, fur, feathers, smoke, glass, liquids, translucent materials, reflective objects, soft shadows, realistic product grounding, or subjects that conflict with every practical key color. If the chroma-key result fails validation or the subject is unsuitable, report the limitation instead of switching models or inventing another transparency path.
remove_chroma_key.py options| Option | Meaning | ||
|---|---|---|---|
--input PATH | Required source image | ||
--out PATH | Required .png or .webp alpha output | ||
--key-color HEX | Exact key color; default #00ff00 | ||
| `--auto-key none\ | corners\ | border` | Sample the key color instead; prefer border for generated images |
--tolerance 0..255 | Hard-key distance; default 12 | ||
--soft-matte + --transparent-threshold / --opaque-threshold | Enable a smooth alpha ramp; defaults 12 / 96, while this workflow uses 12 / 220 | ||
--despill, --spill-cleanup | Equivalent flags that reduce key-color edge spill | ||
--edge-contract 0..16, --edge-feather 0..64 | Shrink or soften the alpha edge | ||
--force | Overwrite an existing output |
Read references/openai-cookbook.md only when API behavior, supported parameters, or model semantics are uncertain. Do not use it to expand or rewrite the supplied prompt.
-i path and any -m path exist.~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.