Isolate multiple email agents with inboxes, projects and keys
Choose the isolation boundary that matches agent responsibility and customer ownership.
Map customers, workflows and shared resources to the authorization boundaries the API actually enforces.
A Lupin workspace owns projects, API keys and resources. A project provides a namespace for inboxes, threads, drafts, domains, webhooks, lists and metrics. An inbox identifies one communication address and its email resources. This hierarchy gives an agent service several isolation choices without requiring one workspace per process. Start with customer ownership and operational accountability: a customer project with multiple purpose-specific inboxes often maps better to the domain than a new project for every model run or a shared inbox for unrelated customers.
Persist the application tenant, organization_id and project_id in trusted server-side state. Select the credential from that mapping when constructing a job. The model may identify a candidate resource from received content, but it must not choose another tenant’s key or replace the authenticated organization. Include inbox_id in email jobs and verify it belongs to the selected project before exposing content. A subject line, arbitrary metadata field or sender-supplied project identifier is useful context only after your application checks the authorized resource relationship.
Project routes include /v0/projects/:project_id/emails/inboxes and related thread, draft, domain and webhook paths. A scoped key remains fenced even when it calls an organization-level route, while explicit scoped paths make client intent easier to audit. A project key can create inboxes in its own project if permissions allow; an inbox key cannot create a new inbox. Org-level list endpoints can span projects for a properly authorized operator. Avoid giving workers that broader view unless their task actually needs cross-project administration.
Deleting a project cascades into its inboxes, threads and messages, so tightly gate the destructive permission and keep an explicit retirement plan. Durable production organization moves are unsupported; a target workspace ID cannot transfer ownership. A human claim is the supported way to associate a human with an autonomous workspace. If your product needs a customer to leave, design an application-level export and retirement process around actual supported reads and deletions rather than promising a transfer endpoint that cannot preserve production ownership.
Create synthetic tenant A and tenant B projects, each with one inbox and a scoped key. Check that each can read its own fixture and cannot read the other’s, including through org-level routes and MCP dispatch. Your next step is to make that mapping visible in operations so the selected credential, project and inbox can be checked before any agent sees customer content.
Reviewed against checked-in Lupin API handlers and documentation. Example requests were not executed against live providers.
Prepared with AI assistance by Lupin editorial. How we research and maintain these guides.