
Map each application's user to its own permitted task records before reading media with a shared Imagild service key. Imagild checks ownership at the API-account boundary. If several users of your application share that account, your backend must separately decide which user may inspect each task, reference and downloaded file.
Key Takeaways
- Possessing or guessing a task UUID does not establish application permission.
- Filter application records by the authenticated user's actual access policy.
- Apply the same decision to status, downloads, previews and exports.
Separate two ownership boundaries
A valid Imagild key belongs to an account, and the API guide documents authenticated task access. A task from another Imagild account is not accessible simply because its identifier is known.
A shared-key application introduces another boundary inside that account. User A and user B may both have tasks submitted by the same service account. The remote account check cannot identify your application's users if you never communicate their identity as separate accounts.
Do not describe a shared key as an audited multi-tenant isolation feature. Your own user-to-resource mapping is responsible for the additional authorization.
Resolve an application item before its remote task
Expose an application item identifier to the browser and resolve it through your own authorized storage. For a simple owner-only application, the lookup can follow this pattern:
const user = await requireAppUser(request);
const item = await database.mediaOperation.findFirst({
where: { id: applicationItemId, ownerId: user.id }
});
if (!item) throw new Error("Media item is unavailable");
const task = await readRemoteTask(item.remoteTaskId);
These are illustrative application functions. They are not Imagild endpoints or a complete workspace-permission system. If your application supports teams, implement its membership and role policy rather than assuming that every team member can access every file.
OWASP's object-level authorization guidance explains why resource identifiers need authorization checks. UUIDs are useful identities, not substitutes for those checks.
Protect every path to the bytes
Apply the permission decision before a status read and again before a result download. A protected task-details page is insufficient if its download route accepts any raw remote ID.
Cache entries and stored derivatives also need an owner or permitted workspace context. Do not place private results into an unrestricted public bucket merely to simplify an image tag. If your application offers deliberate sharing, give that feature its own explicit authorization and publishing decision.
The download troubleshooting guide helps diagnose incorrect response types. It does not turn authenticated media into public URLs.
Keep references attached to their rightful user
An uploaded file can be valid for the Imagild account yet inappropriate for another user of your application. Store the application owner and source identity when receiving a photo or approving a generated reference.
Before sending file_id or image_task_id, check both your application permission and the remote selector requirements. The latter requires an owned usable upload or a completed owned image task. Send only one selector.
Review the reference attachment audit when reordering or reusing sources. A UI label such as “Image 1” cannot establish either ownership boundary.
Test denial without leaking existence
Using a local fake transport, create A's item and B's item under one simulated service account. Authenticate as A, then try B's application ID, remote task ID, preview route and export action. Denied requests should not reach the remote transport or disclose B's prompt or media metadata.
Also verify the positive case: A can retrieve A's completed result and recover it after a refresh. Keep failures consistent with your application's error policy so a denied lookup does not become an account directory.
Pass the integration when authorization covers every media path and changing an identifier cannot cross a user boundary. These tests demonstrate your application's checks; they are not a claim that Imagild provides your tenant roles or a completed security certification.
Related tasks
- Why Does My Downloaded Image Open as a Web Page?
- After Reordering References, Does “Image 1” Still Point to the Right File?
Sources and scope
- Imagild API console: Actual model API authentication, membership, task ownership, supported routes and private media retrieval.
- OWASP API1 Broken Object Level Authorization: Resource identifiers require object-level authorization; a shared remote account does not implement application-user permissions.
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.