[{"data":1,"prerenderedAt":1151},["ShallowReactive",2],{"docs:/docs/scopes/multi-tenancy":3},{"id":4,"title":5,"body":6,"description":1144,"extension":1145,"meta":1146,"navigation":184,"path":1147,"seo":1148,"stem":1149,"__hash__":1150},"docs/docs/scopes/multi-tenancy.md","Multi-Tenant Patterns with Access Scopes",{"type":7,"value":8,"toc":1126},"minimark",[9,13,17,22,25,28,33,46,50,353,357,360,363,366,377,380,538,542,545,548,559,562,754,758,767,777,780,1078,1095,1099,1122],[10,11,5],"h1",{"id":12},"multi-tenant-patterns-with-access-scopes",[14,15,16],"p",{},"Real-world patterns for using Access Scopes to build multi-tenant applications.",[18,19,21],"h2",{"id":20},"pattern-1-one-scope-per-tenant-customer","Pattern 1: One Scope per Tenant Customer",[14,23,24],{},"The most common pattern. When a new customer signs up for your SaaS product, create a scope for them. All actors belonging to that customer are assigned to the scope, and their communication is automatically isolated from other tenants.",[14,26,27],{},"This eliminates the need to create separate apps or projects per tenant. A single app serves all tenants, with scopes providing the isolation boundary.",[29,30,32],"h3",{"id":31},"when-to-use","When to use",[34,35,36,40,43],"ul",{},[37,38,39],"li",{},"B2B SaaS where each customer organization needs isolated communication",[37,41,42],{},"White-label products where tenants must not see each other's data",[37,44,45],{},"Marketplace platforms where vendors operate independently",[29,47,49],{"id":48},"implementation","Implementation",[51,52,53],"code-tabs",{},[54,55,61],"pre",{"className":56,"code":57,"filename":58,"language":59,"meta":60,"style":60},"language-typescript shiki shiki-themes github-light github-dark","// When a new customer signs up, create a scope for them\nasync function onboardTenant(tenantSlug: string, tenantName: string) {\n  // 1. Create the scope\n  const scope = await api.post(\n    `/v1/organizations/${orgId}/projects/${projectId}/scopes`,\n    { slug: tenantSlug, name: tenantName }\n  );\n\n  // 2. Create actors for this tenant's users\n  const actor = await api.post(\n    `/v1/organizations/${orgId}/projects/${projectId}/actors`,\n    {\n      name: \"user-alice\",\n      accessScopeId: scope.accessScopeId,\n    }\n  );\n\n  // 3. Grant the actor access to your apps\n  await api.post(\n    `/v1/organizations/${orgId}/projects/${projectId}/apps/${appId}/actors`,\n    { actorId: actor.actorId }\n  );\n\n  // Alice's topics are now namespaced under the tenant slug:\n  //   my-app/acme-corp/chat/messages\n  //   my-app/acme-corp/notifications/alerts\n  return { scope, actor };\n}\n","TypeScript","typescript","",[62,63,64,73,115,121,145,167,173,179,186,192,210,226,232,243,249,255,260,265,271,283,304,310,315,320,326,332,338,347],"code",{"__ignoreMap":60},[65,66,69],"span",{"class":67,"line":68},"line",1,[65,70,72],{"class":71},"sJ8bj","// When a new customer signs up, create a scope for them\n",[65,74,76,80,83,87,91,95,98,102,105,108,110,112],{"class":67,"line":75},2,[65,77,79],{"class":78},"szBVR","async",[65,81,82],{"class":78}," function",[65,84,86],{"class":85},"sScJk"," onboardTenant",[65,88,90],{"class":89},"sVt8B","(",[65,92,94],{"class":93},"s4XuR","tenantSlug",[65,96,97],{"class":78},":",[65,99,101],{"class":100},"sj4cs"," string",[65,103,104],{"class":89},", ",[65,106,107],{"class":93},"tenantName",[65,109,97],{"class":78},[65,111,101],{"class":100},[65,113,114],{"class":89},") {\n",[65,116,118],{"class":67,"line":117},3,[65,119,120],{"class":71},"  // 1. Create the scope\n",[65,122,124,127,130,133,136,139,142],{"class":67,"line":123},4,[65,125,126],{"class":78},"  const",[65,128,129],{"class":100}," scope",[65,131,132],{"class":78}," =",[65,134,135],{"class":78}," await",[65,137,138],{"class":89}," api.",[65,140,141],{"class":85},"post",[65,143,144],{"class":89},"(\n",[65,146,148,152,155,158,161,164],{"class":67,"line":147},5,[65,149,151],{"class":150},"sZZnC","    `/v1/organizations/${",[65,153,154],{"class":89},"orgId",[65,156,157],{"class":150},"}/projects/${",[65,159,160],{"class":89},"projectId",[65,162,163],{"class":150},"}/scopes`",[65,165,166],{"class":89},",\n",[65,168,170],{"class":67,"line":169},6,[65,171,172],{"class":89},"    { slug: tenantSlug, name: tenantName }\n",[65,174,176],{"class":67,"line":175},7,[65,177,178],{"class":89},"  );\n",[65,180,182],{"class":67,"line":181},8,[65,183,185],{"emptyLinePlaceholder":184},true,"\n",[65,187,189],{"class":67,"line":188},9,[65,190,191],{"class":71},"  // 2. Create actors for this tenant's users\n",[65,193,195,197,200,202,204,206,208],{"class":67,"line":194},10,[65,196,126],{"class":78},[65,198,199],{"class":100}," actor",[65,201,132],{"class":78},[65,203,135],{"class":78},[65,205,138],{"class":89},[65,207,141],{"class":85},[65,209,144],{"class":89},[65,211,213,215,217,219,221,224],{"class":67,"line":212},11,[65,214,151],{"class":150},[65,216,154],{"class":89},[65,218,157],{"class":150},[65,220,160],{"class":89},[65,222,223],{"class":150},"}/actors`",[65,225,166],{"class":89},[65,227,229],{"class":67,"line":228},12,[65,230,231],{"class":89},"    {\n",[65,233,235,238,241],{"class":67,"line":234},13,[65,236,237],{"class":89},"      name: ",[65,239,240],{"class":150},"\"user-alice\"",[65,242,166],{"class":89},[65,244,246],{"class":67,"line":245},14,[65,247,248],{"class":89},"      accessScopeId: scope.accessScopeId,\n",[65,250,252],{"class":67,"line":251},15,[65,253,254],{"class":89},"    }\n",[65,256,258],{"class":67,"line":257},16,[65,259,178],{"class":89},[65,261,263],{"class":67,"line":262},17,[65,264,185],{"emptyLinePlaceholder":184},[65,266,268],{"class":67,"line":267},18,[65,269,270],{"class":71},"  // 3. Grant the actor access to your apps\n",[65,272,274,277,279,281],{"class":67,"line":273},19,[65,275,276],{"class":78},"  await",[65,278,138],{"class":89},[65,280,141],{"class":85},[65,282,144],{"class":89},[65,284,286,288,290,292,294,297,300,302],{"class":67,"line":285},20,[65,287,151],{"class":150},[65,289,154],{"class":89},[65,291,157],{"class":150},[65,293,160],{"class":89},[65,295,296],{"class":150},"}/apps/${",[65,298,299],{"class":89},"appId",[65,301,223],{"class":150},[65,303,166],{"class":89},[65,305,307],{"class":67,"line":306},21,[65,308,309],{"class":89},"    { actorId: actor.actorId }\n",[65,311,313],{"class":67,"line":312},22,[65,314,178],{"class":89},[65,316,318],{"class":67,"line":317},23,[65,319,185],{"emptyLinePlaceholder":184},[65,321,323],{"class":67,"line":322},24,[65,324,325],{"class":71},"  // Alice's topics are now namespaced under the tenant slug:\n",[65,327,329],{"class":67,"line":328},25,[65,330,331],{"class":71},"  //   my-app/acme-corp/chat/messages\n",[65,333,335],{"class":67,"line":334},26,[65,336,337],{"class":71},"  //   my-app/acme-corp/notifications/alerts\n",[65,339,341,344],{"class":67,"line":340},27,[65,342,343],{"class":78},"  return",[65,345,346],{"class":89}," { scope, actor };\n",[65,348,350],{"class":67,"line":349},28,[65,351,352],{"class":89},"}\n",[18,354,356],{"id":355},"pattern-2-scopes-for-environment-isolation","Pattern 2: Scopes for Environment Isolation",[14,358,359],{},"Use scopes to isolate environments within the same project. Staging actors and production actors share the same app configuration but operate in completely separate topic namespaces.",[14,361,362],{},"This is useful during development and testing. You can run integration tests against a staging scope without any risk of interfering with production traffic.",[29,364,32],{"id":365},"when-to-use-1",[34,367,368,371,374],{},[37,369,370],{},"Separating staging, preview, and production traffic",[37,372,373],{},"Running automated tests against a shared project",[37,375,376],{},"Blue-green deployment patterns",[29,378,49],{"id":379},"implementation-1",[51,381,382],{},[54,383,385],{"className":56,"code":384,"filename":58,"language":59,"meta":60,"style":60},"// Create scopes for environment isolation\nawait api.post(`/v1/.../scopes`, { slug: \"staging\", name: \"Staging\" });\nawait api.post(`/v1/.../scopes`, { slug: \"production\", name: \"Production\" });\n\n// Assign actors to environments\nawait api.patch(`/v1/.../actors/${testActorId}`, {\n  accessScopeId: stagingScope.accessScopeId,\n});\n\nawait api.patch(`/v1/.../actors/${prodActorId}`, {\n  accessScopeId: productionScope.accessScopeId,\n});\n\n// Staging actors publish to: my-app/staging/room/topic\n// Production actors publish to: my-app/production/room/topic\n// They never interfere with each other.\n",[62,386,387,392,421,445,449,454,477,482,487,491,510,515,519,523,528,533],{"__ignoreMap":60},[65,388,389],{"class":67,"line":68},[65,390,391],{"class":71},"// Create scopes for environment isolation\n",[65,393,394,397,399,401,403,406,409,412,415,418],{"class":67,"line":75},[65,395,396],{"class":78},"await",[65,398,138],{"class":89},[65,400,141],{"class":85},[65,402,90],{"class":89},[65,404,405],{"class":150},"`/v1/.../scopes`",[65,407,408],{"class":89},", { slug: ",[65,410,411],{"class":150},"\"staging\"",[65,413,414],{"class":89},", name: ",[65,416,417],{"class":150},"\"Staging\"",[65,419,420],{"class":89}," });\n",[65,422,423,425,427,429,431,433,435,438,440,443],{"class":67,"line":117},[65,424,396],{"class":78},[65,426,138],{"class":89},[65,428,141],{"class":85},[65,430,90],{"class":89},[65,432,405],{"class":150},[65,434,408],{"class":89},[65,436,437],{"class":150},"\"production\"",[65,439,414],{"class":89},[65,441,442],{"class":150},"\"Production\"",[65,444,420],{"class":89},[65,446,447],{"class":67,"line":123},[65,448,185],{"emptyLinePlaceholder":184},[65,450,451],{"class":67,"line":147},[65,452,453],{"class":71},"// Assign actors to environments\n",[65,455,456,458,460,463,465,468,471,474],{"class":67,"line":169},[65,457,396],{"class":78},[65,459,138],{"class":89},[65,461,462],{"class":85},"patch",[65,464,90],{"class":89},[65,466,467],{"class":150},"`/v1/.../actors/${",[65,469,470],{"class":89},"testActorId",[65,472,473],{"class":150},"}`",[65,475,476],{"class":89},", {\n",[65,478,479],{"class":67,"line":175},[65,480,481],{"class":89},"  accessScopeId: stagingScope.accessScopeId,\n",[65,483,484],{"class":67,"line":181},[65,485,486],{"class":89},"});\n",[65,488,489],{"class":67,"line":188},[65,490,185],{"emptyLinePlaceholder":184},[65,492,493,495,497,499,501,503,506,508],{"class":67,"line":194},[65,494,396],{"class":78},[65,496,138],{"class":89},[65,498,462],{"class":85},[65,500,90],{"class":89},[65,502,467],{"class":150},[65,504,505],{"class":89},"prodActorId",[65,507,473],{"class":150},[65,509,476],{"class":89},[65,511,512],{"class":67,"line":212},[65,513,514],{"class":89},"  accessScopeId: productionScope.accessScopeId,\n",[65,516,517],{"class":67,"line":228},[65,518,486],{"class":89},[65,520,521],{"class":67,"line":234},[65,522,185],{"emptyLinePlaceholder":184},[65,524,525],{"class":67,"line":245},[65,526,527],{"class":71},"// Staging actors publish to: my-app/staging/room/topic\n",[65,529,530],{"class":67,"line":251},[65,531,532],{"class":71},"// Production actors publish to: my-app/production/room/topic\n",[65,534,535],{"class":67,"line":257},[65,536,537],{"class":71},"// They never interfere with each other.\n",[18,539,541],{"id":540},"pattern-3-scopes-for-team-isolation","Pattern 3: Scopes for Team Isolation",[14,543,544],{},"Use scopes to partition communication by team or department within a single organization. Each team gets its own isolated set of topics while sharing the same app infrastructure.",[29,546,32],{"id":547},"when-to-use-2",[34,549,550,553,556],{},[37,551,552],{},"Enterprise applications with departmental isolation requirements",[37,554,555],{},"Compliance scenarios where teams must not share communication channels",[37,557,558],{},"Internal tools with per-team dashboards and notifications",[29,560,49],{"id":561},"implementation-2",[51,563,564],{},[54,565,567],{"className":56,"code":566,"filename":58,"language":59,"meta":60,"style":60},"// Create scopes for team isolation\nconst teams = [\"engineering\", \"sales\", \"support\"];\n\nfor (const team of teams) {\n  await api.post(`/v1/.../scopes`, {\n    slug: team,\n    name: team.charAt(0).toUpperCase() + team.slice(1),\n  });\n}\n\n// Assign actors to their teams\nawait api.patch(`/v1/.../actors/${engineerActorId}`, {\n  accessScopeId: engineeringScope.accessScopeId,\n});\n\n// Each team gets isolated communication channels:\n//   my-app/engineering/standup/messages\n//   my-app/sales/pipeline/updates\n//   my-app/support/tickets/notifications\n",[62,568,569,574,603,607,626,640,645,684,689,693,697,702,721,726,730,734,739,744,749],{"__ignoreMap":60},[65,570,571],{"class":67,"line":68},[65,572,573],{"class":71},"// Create scopes for team isolation\n",[65,575,576,579,582,584,587,590,592,595,597,600],{"class":67,"line":75},[65,577,578],{"class":78},"const",[65,580,581],{"class":100}," teams",[65,583,132],{"class":78},[65,585,586],{"class":89}," [",[65,588,589],{"class":150},"\"engineering\"",[65,591,104],{"class":89},[65,593,594],{"class":150},"\"sales\"",[65,596,104],{"class":89},[65,598,599],{"class":150},"\"support\"",[65,601,602],{"class":89},"];\n",[65,604,605],{"class":67,"line":117},[65,606,185],{"emptyLinePlaceholder":184},[65,608,609,612,615,617,620,623],{"class":67,"line":123},[65,610,611],{"class":78},"for",[65,613,614],{"class":89}," (",[65,616,578],{"class":78},[65,618,619],{"class":100}," team",[65,621,622],{"class":78}," of",[65,624,625],{"class":89}," teams) {\n",[65,627,628,630,632,634,636,638],{"class":67,"line":147},[65,629,276],{"class":78},[65,631,138],{"class":89},[65,633,141],{"class":85},[65,635,90],{"class":89},[65,637,405],{"class":150},[65,639,476],{"class":89},[65,641,642],{"class":67,"line":169},[65,643,644],{"class":89},"    slug: team,\n",[65,646,647,650,653,655,658,661,664,667,670,673,676,678,681],{"class":67,"line":175},[65,648,649],{"class":89},"    name: team.",[65,651,652],{"class":85},"charAt",[65,654,90],{"class":89},[65,656,657],{"class":100},"0",[65,659,660],{"class":89},").",[65,662,663],{"class":85},"toUpperCase",[65,665,666],{"class":89},"() ",[65,668,669],{"class":78},"+",[65,671,672],{"class":89}," team.",[65,674,675],{"class":85},"slice",[65,677,90],{"class":89},[65,679,680],{"class":100},"1",[65,682,683],{"class":89},"),\n",[65,685,686],{"class":67,"line":181},[65,687,688],{"class":89},"  });\n",[65,690,691],{"class":67,"line":188},[65,692,352],{"class":89},[65,694,695],{"class":67,"line":194},[65,696,185],{"emptyLinePlaceholder":184},[65,698,699],{"class":67,"line":212},[65,700,701],{"class":71},"// Assign actors to their teams\n",[65,703,704,706,708,710,712,714,717,719],{"class":67,"line":228},[65,705,396],{"class":78},[65,707,138],{"class":89},[65,709,462],{"class":85},[65,711,90],{"class":89},[65,713,467],{"class":150},[65,715,716],{"class":89},"engineerActorId",[65,718,473],{"class":150},[65,720,476],{"class":89},[65,722,723],{"class":67,"line":234},[65,724,725],{"class":89},"  accessScopeId: engineeringScope.accessScopeId,\n",[65,727,728],{"class":67,"line":245},[65,729,486],{"class":89},[65,731,732],{"class":67,"line":251},[65,733,185],{"emptyLinePlaceholder":184},[65,735,736],{"class":67,"line":257},[65,737,738],{"class":71},"// Each team gets isolated communication channels:\n",[65,740,741],{"class":67,"line":262},[65,742,743],{"class":71},"//   my-app/engineering/standup/messages\n",[65,745,746],{"class":67,"line":267},[65,747,748],{"class":71},"//   my-app/sales/pipeline/updates\n",[65,750,751],{"class":67,"line":273},[65,752,753],{"class":71},"//   my-app/support/tickets/notifications\n",[18,755,757],{"id":756},"agent-multi-tenancy","Agent Multi-Tenancy",[14,759,760,761,766],{},"Access Scopes are particularly powerful when combined with ",[762,763,765],"a",{"href":764},"/docs/agents/getting-started","AI Agents",". You can deploy the same agent workflow for multiple tenants, with each tenant's agents operating in complete isolation.",[14,768,769,770,104,773,776],{},"The agent coordination topics (",[62,771,772],{},"_handoff/dispatch",[62,774,775],{},"_blackboard/state",", etc.) are automatically namespaced under the scope. An orchestrator in tenant A cannot dispatch tasks to workers in tenant B.",[29,778,49],{"id":779},"implementation-3",[51,781,782],{},[54,783,785],{"className":56,"code":784,"filename":58,"language":59,"meta":60,"style":60},"// Multi-tenant agent deployment\n// Each tenant gets their own scoped agents\n\nasync function deployAgentForTenant(tenantSlug: string, scopeId: string) {\n  // Create an orchestrator actor scoped to this tenant\n  const orchestrator = await api.post(`/v1/.../actors`, {\n    name: `${tenantSlug}-orchestrator`,\n    accessScopeId: scopeId,\n  });\n\n  // Create worker actors scoped to this tenant\n  const worker = await api.post(`/v1/.../actors`, {\n    name: `${tenantSlug}-worker`,\n    accessScopeId: scopeId,\n  });\n\n  // Grant both actors access to the agents app\n  await api.post(`/v1/.../apps/${agentsAppId}/actors`, {\n    actorId: orchestrator.actorId,\n  });\n  await api.post(`/v1/.../apps/${agentsAppId}/actors`, {\n    actorId: worker.actorId,\n  });\n\n  // These agents can only coordinate within their tenant's scope.\n  // Acme's orchestrator dispatches tasks to Acme's workers.\n  // Beta Corp's agents are in a completely separate namespace.\n  //\n  // Acme:      agents-app/acme-corp/_handoff/dispatch\n  // Beta Corp: agents-app/beta-corp/_handoff/dispatch\n}\n\n// Deploy for each tenant\nawait deployAgentForTenant(\"acme-corp\", acmeScopeId);\nawait deployAgentForTenant(\"beta-corp\", betaScopeId);\n",[62,786,787,792,797,801,829,834,856,871,876,880,884,889,910,923,927,931,935,940,960,965,969,987,992,996,1000,1005,1010,1015,1020,1026,1032,1037,1042,1048,1063],{"__ignoreMap":60},[65,788,789],{"class":67,"line":68},[65,790,791],{"class":71},"// Multi-tenant agent deployment\n",[65,793,794],{"class":67,"line":75},[65,795,796],{"class":71},"// Each tenant gets their own scoped agents\n",[65,798,799],{"class":67,"line":117},[65,800,185],{"emptyLinePlaceholder":184},[65,802,803,805,807,810,812,814,816,818,820,823,825,827],{"class":67,"line":123},[65,804,79],{"class":78},[65,806,82],{"class":78},[65,808,809],{"class":85}," deployAgentForTenant",[65,811,90],{"class":89},[65,813,94],{"class":93},[65,815,97],{"class":78},[65,817,101],{"class":100},[65,819,104],{"class":89},[65,821,822],{"class":93},"scopeId",[65,824,97],{"class":78},[65,826,101],{"class":100},[65,828,114],{"class":89},[65,830,831],{"class":67,"line":147},[65,832,833],{"class":71},"  // Create an orchestrator actor scoped to this tenant\n",[65,835,836,838,841,843,845,847,849,851,854],{"class":67,"line":169},[65,837,126],{"class":78},[65,839,840],{"class":100}," orchestrator",[65,842,132],{"class":78},[65,844,135],{"class":78},[65,846,138],{"class":89},[65,848,141],{"class":85},[65,850,90],{"class":89},[65,852,853],{"class":150},"`/v1/.../actors`",[65,855,476],{"class":89},[65,857,858,861,864,866,869],{"class":67,"line":175},[65,859,860],{"class":89},"    name: ",[65,862,863],{"class":150},"`${",[65,865,94],{"class":89},[65,867,868],{"class":150},"}-orchestrator`",[65,870,166],{"class":89},[65,872,873],{"class":67,"line":181},[65,874,875],{"class":89},"    accessScopeId: scopeId,\n",[65,877,878],{"class":67,"line":188},[65,879,688],{"class":89},[65,881,882],{"class":67,"line":194},[65,883,185],{"emptyLinePlaceholder":184},[65,885,886],{"class":67,"line":212},[65,887,888],{"class":71},"  // Create worker actors scoped to this tenant\n",[65,890,891,893,896,898,900,902,904,906,908],{"class":67,"line":228},[65,892,126],{"class":78},[65,894,895],{"class":100}," worker",[65,897,132],{"class":78},[65,899,135],{"class":78},[65,901,138],{"class":89},[65,903,141],{"class":85},[65,905,90],{"class":89},[65,907,853],{"class":150},[65,909,476],{"class":89},[65,911,912,914,916,918,921],{"class":67,"line":234},[65,913,860],{"class":89},[65,915,863],{"class":150},[65,917,94],{"class":89},[65,919,920],{"class":150},"}-worker`",[65,922,166],{"class":89},[65,924,925],{"class":67,"line":245},[65,926,875],{"class":89},[65,928,929],{"class":67,"line":251},[65,930,688],{"class":89},[65,932,933],{"class":67,"line":257},[65,934,185],{"emptyLinePlaceholder":184},[65,936,937],{"class":67,"line":262},[65,938,939],{"class":71},"  // Grant both actors access to the agents app\n",[65,941,942,944,946,948,950,953,956,958],{"class":67,"line":267},[65,943,276],{"class":78},[65,945,138],{"class":89},[65,947,141],{"class":85},[65,949,90],{"class":89},[65,951,952],{"class":150},"`/v1/.../apps/${",[65,954,955],{"class":89},"agentsAppId",[65,957,223],{"class":150},[65,959,476],{"class":89},[65,961,962],{"class":67,"line":273},[65,963,964],{"class":89},"    actorId: orchestrator.actorId,\n",[65,966,967],{"class":67,"line":285},[65,968,688],{"class":89},[65,970,971,973,975,977,979,981,983,985],{"class":67,"line":306},[65,972,276],{"class":78},[65,974,138],{"class":89},[65,976,141],{"class":85},[65,978,90],{"class":89},[65,980,952],{"class":150},[65,982,955],{"class":89},[65,984,223],{"class":150},[65,986,476],{"class":89},[65,988,989],{"class":67,"line":312},[65,990,991],{"class":89},"    actorId: worker.actorId,\n",[65,993,994],{"class":67,"line":317},[65,995,688],{"class":89},[65,997,998],{"class":67,"line":322},[65,999,185],{"emptyLinePlaceholder":184},[65,1001,1002],{"class":67,"line":328},[65,1003,1004],{"class":71},"  // These agents can only coordinate within their tenant's scope.\n",[65,1006,1007],{"class":67,"line":334},[65,1008,1009],{"class":71},"  // Acme's orchestrator dispatches tasks to Acme's workers.\n",[65,1011,1012],{"class":67,"line":340},[65,1013,1014],{"class":71},"  // Beta Corp's agents are in a completely separate namespace.\n",[65,1016,1017],{"class":67,"line":349},[65,1018,1019],{"class":71},"  //\n",[65,1021,1023],{"class":67,"line":1022},29,[65,1024,1025],{"class":71},"  // Acme:      agents-app/acme-corp/_handoff/dispatch\n",[65,1027,1029],{"class":67,"line":1028},30,[65,1030,1031],{"class":71},"  // Beta Corp: agents-app/beta-corp/_handoff/dispatch\n",[65,1033,1035],{"class":67,"line":1034},31,[65,1036,352],{"class":89},[65,1038,1040],{"class":67,"line":1039},32,[65,1041,185],{"emptyLinePlaceholder":184},[65,1043,1045],{"class":67,"line":1044},33,[65,1046,1047],{"class":71},"// Deploy for each tenant\n",[65,1049,1051,1053,1055,1057,1060],{"class":67,"line":1050},34,[65,1052,396],{"class":78},[65,1054,809],{"class":85},[65,1056,90],{"class":89},[65,1058,1059],{"class":150},"\"acme-corp\"",[65,1061,1062],{"class":89},", acmeScopeId);\n",[65,1064,1066,1068,1070,1072,1075],{"class":67,"line":1065},35,[65,1067,396],{"class":78},[65,1069,809],{"class":85},[65,1071,90],{"class":89},[65,1073,1074],{"class":150},"\"beta-corp\"",[65,1076,1077],{"class":89},", betaScopeId);\n",[1079,1080,1082,1088],"callout",{"type":1081},"info",[14,1083,1084],{},[1085,1086,1087],"strong",{},"Key Advantage",[14,1089,1090,1091,1094],{},"With Access Scopes, you deploy ",[1085,1092,1093],{},"one app, one set of rooms, one set of topics",". The scopes handle isolation automatically. Without scopes, you would need to create a separate app (or even a separate project) for each tenant, duplicating configuration and complicating management.",[18,1096,1098],{"id":1097},"next-steps","Next Steps",[34,1100,1101,1108,1115],{},[37,1102,1103,1107],{},[762,1104,1106],{"href":1105},"/docs/scopes/concepts","Concepts"," - understand how scopes work under the hood",[37,1109,1110,1114],{},[762,1111,1113],{"href":1112},"/docs/scopes/api-reference","API Reference"," - complete endpoint documentation",[37,1116,1117,1121],{},[762,1118,1120],{"href":1119},"/docs/agents/patterns","Agent Patterns"," - coordination patterns that work with scopes",[1123,1124,1125],"style",{},"html pre.shiki code .sJ8bj, html code.shiki .sJ8bj{--shiki-default:#6A737D;--shiki-dark:#6A737D}html pre.shiki code .szBVR, html code.shiki .szBVR{--shiki-default:#D73A49;--shiki-dark:#F97583}html pre.shiki code .sScJk, html code.shiki .sScJk{--shiki-default:#6F42C1;--shiki-dark:#B392F0}html pre.shiki code .sVt8B, html code.shiki .sVt8B{--shiki-default:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .s4XuR, html code.shiki .s4XuR{--shiki-default:#E36209;--shiki-dark:#FFAB70}html pre.shiki code .sj4cs, html code.shiki .sj4cs{--shiki-default:#005CC5;--shiki-dark:#79B8FF}html pre.shiki code .sZZnC, html code.shiki .sZZnC{--shiki-default:#032F62;--shiki-dark:#9ECBFF}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":60,"searchDepth":75,"depth":75,"links":1127},[1128,1132,1136,1140,1143],{"id":20,"depth":75,"text":21,"children":1129},[1130,1131],{"id":31,"depth":117,"text":32},{"id":48,"depth":117,"text":49},{"id":355,"depth":75,"text":356,"children":1133},[1134,1135],{"id":365,"depth":117,"text":32},{"id":379,"depth":117,"text":49},{"id":540,"depth":75,"text":541,"children":1137},[1138,1139],{"id":547,"depth":117,"text":32},{"id":561,"depth":117,"text":49},{"id":756,"depth":75,"text":757,"children":1141},[1142],{"id":779,"depth":117,"text":49},{"id":1097,"depth":75,"text":1098},"Build multi-tenant applications with Access Scopes. Patterns for tenant isolation, environment separation, team partitioning, and agent multi-tenancy.","md",{},"/docs/scopes/multi-tenancy",{"title":5,"description":1144},"docs/scopes/multi-tenancy","fHNmrnlM3Gz3HWLkNlsbg4Ea_RH-CNvxCq3gDAd2xpI",1788160344464]