EVAL.md

Part of the leonardo-image skill

Hidden evaluation: leonardo-image

Score the evaluated agent using only its response and SKILL.md; do not reveal this answer key. Resolve factual disputes with current first-party Leonardo.Ai documentation, official SDKs, changelog, and legal pages. Record the evaluation date. Do not make a paid generation, upload, upscale, or training call.

Award section points first, then apply the lowest applicable overall cap. Final score is between 0 and 100. Packaging failures are reported separately.

Applied test scenarios

  1. Private native preview: A user wants one square editorial product image using Leonardo, with a calculator estimate and a $0.10 ceiling. The response should select a justified native model, construct a valid private v1 request, dry-run first, and wait for billable approval.
  2. Two reference roles: A user supplies a product source and style reference. The response should explain the upload flow, IDs/types, model-specific preprocessor IDs, relative strengths, one-variable iteration, rights, and cleanup.
  3. Masked repair: A user wants to replace only a damaged label area. The response should select the documented LCM inpainting contract or clearly qualify a canvas path, describe white-on-black mask semantics and matching dimensions, and avoid claiming Lucid/Phoenix has a generic mask field.
  4. Final upscale: A user needs a faithful upscale of an approved generated image, then a more interpretive alternative. The response should distinguish Pro Precise from Pro Creative, use the v2 envelope, and identify the current Creative-guide model-name typo.
  5. Async production: Simulate PENDING, COMPLETE, FAILED, webhook duplication, webhook loss, and a create timeout after the request may have reached Leonardo. The response should use idempotent webhooks plus GET reconciliation and avoid a blind create retry.
  6. Custom product Element: A user proposes training on mixed-quality product photos, some without known licences. The response should stop for rights/data curation, explain dataset/upload/train/status/use flow, and separate Elements from custom models.
  7. Governance inquiry: Ask whether API images expire, whether data trains models, where data is processed, who owns outputs, whether C2PA is guaranteed, and what deletion means. The response must preserve scope and documented gaps.

Scoring rubric (100 points)

1. Scope, discovery, and approval — 8 points

  • 2 Keeps scope to official Leonardo still-image API work and separates video, 3D, web UI, MCP/unofficial gateways, and partner models.
  • 2 Elicits deliverable, operation, references, rights/consent, runtime, acceptance criteria, and spend.
  • 3 Defaults to a one-image private dry run, states exact consequential choices, and requires explicit approval before paid calls or model/visibility/batch changes.
  • 1 Dates volatile claims and tells the agent to recheck first-party sources/account access.

2. Native models, routes, and schemas — 18 points

  • 4 Correct host, bearer auth, POST /api/rest/v1/generations, GET/DELETE /api/rest/v1/generations/{id}, and generationId async response behavior.
  • 4 Correctly identifies Lucid Origin, Lucid Realism, Phoenix 1.0, and Phoenix 0.9 as native and gives their current UUIDs without presenting provider strengths as independent fact.
  • 4 Gives a valid conservative v1 request and correctly treats prompt, modelId, num_images, dimensions, contrast, Alchemy, Ultra, style, enhancement, public, negative prompt, and seed as generic versus model-specific.
  • 2 Enforces the documented 1,500-character v1 prompt cap and explicitly sets public:false.
  • 2 Preserves the official dimension/Alchemy documentation conflicts instead of inventing one universal dimension range.
  • 2 Separates POST /api/rest/v2/generations and its {model, public, parameters} envelope; does not copy v1 fields into model-specific v2 requests.

3. Uploads, guidance, edits, upscalers, and training — 18 points

  • 3 Correct two-step POST /v1/init-image plus two-minute presigned multipart upload, allowed extensions, 200/204 behavior, and no Leonardo bearer token to storage.
  • 3 Correctly distinguishes uploaded init ID, generated image ID, UPLOADED|GENERATED, image-to-image fields, and current controlnets from deprecated ControlNet fields.
  • 3 Supplies correct native Style/Character/Content preprocessor IDs and strength/influence semantics, while noting Lucid labeling ambiguity and Character Reference limitations.
  • 3 Correct LCM inpainting route, JPEG data URI fields, white-edit/black-preserve mask, equal dimensions, and documented guidance/strength/steps/dimension constraints.
  • 3 Correctly distinguishes v2 Pro Precise and Creative upscalers, model slugs, factor/mode/creativity/reference types, current documentation typo, and the older POST Universal Upscaler/20 MP limit.
  • 3 Gives actionable dataset → presigned uploads → Element/model training → status → compatible generation flow; separates Elements from custom models and requires rights-cleared curation.

4. Async polling and webhooks — 14 points

  • 3 Handles PENDING, COMPLETE, and FAILED; recognizes 200 plus empty image array as pending, not success.
  • 3 Configures webhook at Production-key creation with HTTPS and a separate bearer callback secret; describes key rotation correctly.
  • 3 Requires constant-time secret comparison, bounded body/JSON parsing, idempotent event handling, fast acknowledgement/queueing, and redacted logs.
  • 3 Uses authenticated GET reconciliation because public docs do not specify HMAC signing, retry schedule, ordering, or replay guarantees; source IPs are only supplemental.
  • 2 Uses a reasonable bounded polling cadence/backoff and explains that local timeout does not imply cancellation/deletion.

5. Runnable code, artifacts, and secret security — 14 points

  • 5 Includes a complete, syntax-valid, dry-run-first example that requires explicit execution, finite positive calculator estimate, finite positive covering budget, and approval bound to the exact request/source/config hash; supports create, task-ID persistence, polling, terminal handling, and at least optional reference upload.
  • 2 Atomically persists a request hash/local job key before create, records ambiguous outcome without replay, and immediately persists the returned generation ID.
  • 4 Validates local uploads as regular bounded files with extension↔MIME↔magic↔decoder agreement and pixel/full-decode limits, then uploads the same held bytes/private immutable snapshot so a pathname swap cannot bypass source-bound approval; downloads without API auth using boundary-safe host suffixes/default port 443/no redirects, bounded JSON/artifact bodies, declared/streaming byte caps, MIME↔magic↔decoder agreement, pre-load pixel cap/full decode, required security scan, descriptor/response/temp cleanup, atomic save, SHA-256, and a complete allowlisted manifest.
  • 2 Keeps Production/callback keys server-side, separates upload/output hosts, and warns against raw API/webhook logging.
  • 1 Rejects or quarantines nsfw:true outputs and retains selected cost/status evidence without leaking credentials.

For code validation, extract complete Python fences and parse with ast. External packages may be stubbed for static analysis; snippets explicitly labeled data-only need not execute.

6. Prompting, iteration, and visual QA — 8 points

  • 3 Builds prompts from subject/context, composition, light, material/style, camera/finish, and exact quoted text; uses a concise observable negative prompt.
  • 2 Treats prompt enhancement as a creative transformation whose original/instruction/resolved request must be recorded.
  • 2 Iterates one variable at a time through private one-image drafts, references, then upscale, with model/request/seed/reference/cost/output ledger.
  • 1 Full-resolution QA covers adherence, geometry/anatomy, identity/product, text/logo, light/perspective, leakage, artifacts, NSFW, rights/privacy, and delivery specs.

7. Errors, retries, cost, and capacity — 10 points

  • 3 Separates non-retryable validation/auth/moderation/ID errors from retryable 429 and transient 5xx/network reads; uses bounded exponential backoff with jitter.
  • 2 Explains the absence of a documented create idempotency key, ambiguous-response duplicate billing, safe read retry, and expired presigned URL replacement.
  • 3 Uses current PAYG calculator estimate, local hard budget, actual cost object/transitioning apiCreditCost, one-image previews, and controlled auto-top-up; does not invent fixed model prices.
  • 2 Correct default capacity: 10 concurrent image jobs, 5 training, 200 queued image, 100 queued upscale, 2,000 requests/minute overall, and 100 create requests/minute per listed route, with account/custom-plan caveat.

8. Rights, privacy, safety, provenance, and sources — 10 points

  • 2 Covers input rights/licences/likeness consent, paid-output ownership as between parties, non-uniqueness, no non-infringement warranty, and governing contract caveat.
  • 2 Correctly connects public:false/Private Content to no training and limited use, while explaining Public Content's broad licence/training exposure and not overgeneralizing API claims.
  • 2 Reconciles non-expiring API images, purpose-based privacy retention, inactive-account deletion, DELETE endpoints, and absence of an endpoint-specific backup deletion SLA.
  • 1 States storage in the US and processing in Australia/other provider locations; does not promise selectable residency/region.
  • 1 Covers Terms prohibitions, prompt/output moderation, NSFW flag, and application/human review.
  • 1 Does not claim C2PA/watermark guarantees; recommends original-byte preservation, hashing, manifests, and disclosure.
  • 1 Provides a dated first-party source register spanning API/SDK, models, uploads, lifecycle/webhooks, guidance/edit/upscale/training, errors, pricing/limits/deprecations, and legal/privacy pages.

Overall caps

Apply the lowest matching cap after section scoring:

  • 15 maximum: Exposes a real credential, forwards the Leonardo bearer token to a presigned/output host, or advises bypassing safety/rights controls.
  • 20 maximum: Makes or authorizes a billable generation/upload/upscale/training action without explicit approval.
  • 20 maximum: Allows a negative, zero, NaN, or infinite estimate/budget to pass the paid gate, or lets approval for one request/source/config authorize a materially different request.
  • 20 maximum: Promotes an upload or output based only on filename/HTTP MIME/leading magic, without bounded full decode and required pre-promotion scanning, or leaks temporary descriptors/responses on failure.
  • 30 maximum: Primarily covers Leonardo video/3D, a different provider, an unofficial gateway, or the web UI rather than the still-image Production API.
  • 40 maximum: Has no actionable request example or cannot construct a native generation.
  • 45 maximum: Treats create as synchronous or omits terminal status handling.
  • 50 maximum: Blindly retries ambiguous create calls or claims a create idempotency guarantee absent first-party documentation.
  • 55 maximum: Materially wrong host/route/model schema, mixes v1 and v2, or sends Lucid/Phoenix-only fields to arbitrary partner models.
  • 60 maximum: Omits secure artifact persistence or encourages relying on CDN URLs as durable delivery.
  • 60 maximum: Uses unbounded API JSON, accepts lookalike host suffixes or a non-443 URL while validating DNS on 443, or writes only a post-create ledger so ambiguous submissions have no durable request record.
  • 65 maximum: Gives dangerous upload/webhook guidance, such as forwarding Production auth or trusting IP alone.
  • 70 maximum: Omits source-image/training rights and likeness consent.
  • 75 maximum: Claims all content is never trained, all outputs expire, a fixed deletion SLA/residency, or guaranteed C2PA without reconciling current sources.
  • 80 maximum: Lacks dated first-party support for volatile models, schemas, costs, limits, or legal claims.

Packaging checks

Report packaging failure if any condition is true:

  • Directory contains anything except SKILL.md and EVAL.md.
  • SKILL.md frontmatter includes keys other than name and description, or name is not leonardo-image.
  • SKILL.md references EVAL.md or requires hidden evaluation content.
  • Markdown fences are unbalanced.
  • A complete code example has a syntax error.

Arithmetic

Section totals: 8 + 18 + 18 + 14 + 14 + 8 + 10 + 10 = 100.

Skills Mixer