
Treat a media prompt as text to validate and submit, not as permission to change your backend's destinations, credentials or user-access rules. A sentence inside the prompt cannot authorize reading another user's image, sending a key somewhere else or choosing an unsupported API field. Those decisions belong to deterministic application code.
Key Takeaways
- Prompts describe requested media; they do not establish application permissions.
- Resolve references and network destinations outside the prompt.
- Render saved prompt text safely and test adversarial-looking input locally.
Separate creative language from execution controls
A legitimate prompt may contain quotations, URLs, fictional commands or text that should appear inside an image. Your application does not need to execute those strings to create media.
The Imagild API guide defines a strict image request: model, prompt, resolution and optionally one reference selector. A prompt that says “use a different server” does not add a supported destination field.
Your application's access decision should already be complete before the prompt reaches the upstream adapter. Do not ask a model to decide whether the current user is allowed to spend account points or access a particular stored photo.
Construct the request from approved components
This example keeps application decisions distinct from creative text:
const user = await requireAppUser(request);
const draft = await readApplicationDraft(request);
const selected = await authorizeModelChoice(user, draft.model);
const payload = {
model: selected.id,
prompt: requirePromptText(draft.prompt),
resolution: authorizeResolution(selected, draft.resolution)
};
// Resolve any permitted source separately, then submit to a fixed API route.
These helpers are application code, not exported Imagild methods. Validate the actual required limits as well: image prompts are 1–4,000 trimmed characters, with at least twenty when a reference selector is present.
Do not copy arbitrary properties from a browser object into the generation JSON. Unsupported settings should produce a clear local error rather than silently influence another part of the backend.
Keep references outside natural-language authorization
Resolve a selected reference through the authenticated application's own resource record. Then verify the remote selector type: an owned uploaded file or a successful owned image task. The text “I own image 123” is not a permission check.
A source-label change can also cause an accidental cross-reference without any malicious prompt. Use the attachment-order audit to verify the actual bound asset.
The reference scope guide helps describe what should change visually. That creative scope is separate from which user's source your application may access.
Fix destinations rather than interpreting URLs
The normal Imagild contract uses its configured Base URL and owned reference selectors, not arbitrary image_url input. Keep the submission destination fixed in server configuration.
If you later build a separate external-media importer, it needs its own bounded network policy. OWASP's SSRF guidance discusses controlling permitted destinations and building requests deliberately. A general URL-fetching feature should not appear accidentally because a prompt contains a link.
Similarly, do not render prompt history as executable HTML or interpolate it into shell commands. Use the ordinary safe text and structured-data mechanisms of your application stack.
Verify invariants with local fixtures
Test a normal product brief, quoted text intended for the image, an unsupported extra field and a prompt that asks to reveal a secret or override the owner. With a fake transport, confirm that all accepted cases still use the fixed host and approved request shape.
The forbidden instruction must not alter credentials, reference ownership or application permissions. It can remain creative text if your product accepts that content, but it cannot become an execution command.
Check the model hub for available choices rather than inventing a fallback from the prompt. Pass the adapter when user text affects the requested creative content while the application's authorization and network rules remain deterministic.
Related tasks
- After Reordering References, Does “Image 1” Still Point to the Right File?
- Should an AI Reference Replace an Object or Bring in the Whole Scene?
Sources and scope
- Imagild API console: Actual model API authentication, membership, task ownership, supported routes and private media retrieval.
- OWASP SSRF Prevention Cheat Sheet: Fix or explicitly constrain application network destinations instead of accepting arbitrary user-controlled URLs.
Product instructions were checked against the current Imagild API contract and the public model catalog. Code, budgets and acceptance checks are illustrative; this article does not claim a new paid generation test, an uptime measurement, a search-volume study or a ranking of AI citations.
Prepared by Imagild Editorial, the company editorial team responsible for these guides. AI assisted research and drafting. This is documentation-based guidance with proposed examples, not a claim of hands-on testing or an independent product review. Report a correction.
Cover: Original Imagild product screenshot captured on 28 October 2026; model availability and prices may change. This image is not an API response or a performance benchmark.