Skip to content

How do I keep one SaaS customer's AI output private from another customer?

Map every AISwapLab job to your own authenticated application user and check that mapping before status or download access. The service key belongs to your account; it cannot infer your SaaS tenant boundaries. A frontend-supplied job ID is not sufficient authorization, even when the remote API correctly treats all those jobs as owned by your account.

SHIP A RELIABLE INTEGRATIONAISwapLab team · Editorial methodPublished 2 min read
Open API documentationExplore 67 Image SkillsPrivate keys · Explicit credit approval
Article workflow: Store ownership at creation; Authorize every operation; Test cross-user denial.
Workflow diagram: Store ownership at creation → Authorize every operation → Test cross-user denial. Read the article for evidence and limits.

Your proxy can become an unintended sharing bridge

A backend that fetches any user-provided job ID with one account key can expose another customer's private result. The same issue applies to uploaded reference IDs and internal task records. Resource IDs should be references to authorized data, not passwords that substitute for a real ownership check.

What to do next

  1. 01

    Store ownership at creation

    Associate the internal task, approved payload and returned job ID with the requesting tenant and user. Keep that association durable through queue workers and retries.

  2. 02

    Authorize every operation

    Before polling, downloading or reusing a reference, load the server-side ownership record for the signed-in user. Ignore arbitrary owner fields supplied by the browser.

  3. 03

    Test cross-user denial

    Use fixtures representing two application users under one remote account. Verify that one cannot request the other's task or media through your own backend, without needing paid generations.

A concrete example

Illustrative attack path: a user edits a URL to contain another internal job ID. A correctly designed application denies access before calling the remote content route, even though its account-wide key could retrieve the underlying asset.

Before you call it ready

  • Every task has an application owner.
  • The server checks ownership on retrieval.
  • Cross-user denial is tested deliberately.

When to stop or choose another method

If your proxy relies only on a hard-to-guess identifier, fix authorization before serving private media. Do not make customer outputs public to simplify frontend access.

Sources

One task. A recoverable workflow.

Check the contract, approve the quote and retain the job.

Open API documentation